source
stringclasses
1 value
repo
stringlengths
5
63
repo_url
stringlengths
24
82
path
stringlengths
5
167
language
stringclasses
1 value
license
stringclasses
5 values
stars
int64
10
51.4k
ref
stringclasses
23 values
size_bytes
int64
200
258k
text
stringlengths
137
258k
github
HubspotCommunity/hubspot-ruby
https://github.com/HubspotCommunity/hubspot-ruby
spec/shared_examples/saveable_resource.rb
Ruby
mit
194
master
986
RSpec.shared_examples_for "a saveable resource" do |factory_name| describe '#save' do context 'with a new resource' do cassette let(:resource) { build factory_name } subject { resource.save } it 'succeeds' do expect(subject).to be_truthy end it 'sets the ID' do ...
github
HubspotCommunity/hubspot-ruby
https://github.com/HubspotCommunity/hubspot-ruby
spec/shared_examples/updateable_resource.rb
Ruby
mit
194
master
2,173
RSpec.shared_examples_for "an updateable resource" do |factory_name| describe '.update' do context 'with an existing resource' do cassette let(:resource) { create factory_name } subject { described_class.update(resource.id, changed_properties) } it 'succeeds' do expect(subject).to...
github
HubspotCommunity/hubspot-ruby
https://github.com/HubspotCommunity/hubspot-ruby
spec/lib/hubspot-ruby_spec.rb
Ruby
mit
194
master
343
RSpec.describe Hubspot do describe ".configure" do it "delegates .configure to Hubspot::Config.configure" do options = { hapikey: "demo" } allow(Hubspot::Config).to receive(:configure).with(options) Hubspot.configure(options) expect(Hubspot::Config).to have_received(:configure).with(opti...
github
HubspotCommunity/hubspot-ruby
https://github.com/HubspotCommunity/hubspot-ruby
spec/lib/tasks/hubspot_spec.rb
Ruby
mit
194
master
3,405
require "rake" require "stringio" require "tempfile" RSpec.describe "hubspot rake tasks", type: :rake do let(:hapikey) { "demo" } describe "hubspot:dump_properties" do it "writes the class properties and groups to the given file" do VCR.use_cassette("dump_contact_properties_and_groups") do file ...
github
HubspotCommunity/hubspot-ruby
https://github.com/HubspotCommunity/hubspot-ruby
spec/lib/hubspot/company_properties_spec.rb
Ruby
mit
194
master
13,155
RSpec.describe Hubspot::CompanyProperties do describe '.add_default_parameters' do let(:opts) { {} } subject { Hubspot::CompanyProperties.add_default_parameters(opts) } context 'default parameters' do context 'without property parameter' do its([:property]) { should == 'email' } end ...
github
HubspotCommunity/hubspot-ruby
https://github.com/HubspotCommunity/hubspot-ruby
spec/lib/hubspot/owner_spec.rb
Ruby
mit
194
master
1,433
describe Hubspot::Owner do let(:example_owners) do VCR.use_cassette('owner_example') do HTTParty.get('https://api.hubapi.com/owners/v2/owners?hapikey=demo&portalId=62515').parsed_response end end before { Hubspot.configure(hapikey: 'demo') } describe '.all' do cassette 'owner_all' it 's...
github
HubspotCommunity/hubspot-ruby
https://github.com/HubspotCommunity/hubspot-ruby
spec/lib/hubspot/connection_spec.rb
Ruby
mit
194
master
6,345
describe Hubspot::Connection do before do Hubspot.configure hapikey: 'fake' end describe ".get_json" do it "returns the parsed response from the GET request" do path = "/some/path" body = { key: "value" } stub_request(:get, "https://api.hubapi.com/some/path?hapikey=fake"). to_r...
github
HubspotCommunity/hubspot-ruby
https://github.com/HubspotCommunity/hubspot-ruby
spec/lib/hubspot/blog_spec.rb
Ruby
mit
194
master
4,317
require 'timecop' describe Hubspot do before do Hubspot.configure(hapikey: "demo") Timecop.freeze(Time.utc(2012, 'Oct', 10)) end after do Timecop.return end describe Hubspot::Blog do describe ".list" do it "returns a list of blogs" do VCR.use_cassette("blog_list") do ...
github
HubspotCommunity/hubspot-ruby
https://github.com/HubspotCommunity/hubspot-ruby
spec/lib/hubspot/resource_spec.rb
Ruby
mit
194
master
1,216
RSpec.describe Hubspot::Resource do describe '#new' do context 'when specifying an ID' do let(:id) { 1 } subject { described_class.new(id) } it 'sets the id property' do expect(subject.id).to eq id end it "isn't persisted" do pending "rework of pending flag" ...
github
HubspotCommunity/hubspot-ruby
https://github.com/HubspotCommunity/hubspot-ruby
spec/lib/hubspot/engagement_spec.rb
Ruby
mit
194
master
5,024
describe Hubspot::Engagement do let(:example_engagement_hash) do VCR.use_cassette("engagement_example") do HTTParty.get("https://api.hubapi.com/engagements/v1/engagements/51484873?hapikey=demo").parsed_response end end let(:example_associated_engagement_hash) do VCR.use_cassette("engagement_asso...
github
HubspotCommunity/hubspot-ruby
https://github.com/HubspotCommunity/hubspot-ruby
spec/lib/hubspot/deal_spec.rb
Ruby
mit
194
master
3,362
describe Hubspot::Deal do let(:portal_id) { 62515 } let(:company_id) { 8954037 } let(:vid) { 27136 } let(:amount) { '30' } let(:example_deal_hash) do VCR.use_cassette("deal_example") do HTTParty.get("https://api.hubapi.com/deals/v1/deal/3?hapikey=demo&portalId=#{portal_id}").parsed_response end...
github
HubspotCommunity/hubspot-ruby
https://github.com/HubspotCommunity/hubspot-ruby
spec/lib/hubspot/contact_properties_spec.rb
Ruby
mit
194
master
8,121
describe Hubspot::ContactProperties do describe '.add_default_parameters' do let(:opts) { {} } subject { Hubspot::ContactProperties.add_default_parameters(opts) } context 'default parameters' do context 'without property parameter' do its([:property]) { should == 'email' } end c...
github
HubspotCommunity/hubspot-ruby
https://github.com/HubspotCommunity/hubspot-ruby
spec/lib/hubspot/company_spec.rb
Ruby
mit
194
master
8,232
RSpec.describe Hubspot::Company do # let(:example_company_hash) do # VCR.use_cassette("company_example") do # HTTParty.get("https://api.hubapi.com/companies/v2/companies/21827084?hapikey=demo").parsed_response # end # end # let(:company_with_contacts_hash) do # VCR.use_cassette("company_with_con...
github
HubspotCommunity/hubspot-ruby
https://github.com/HubspotCommunity/hubspot-ruby
spec/lib/hubspot/form_spec.rb
Ruby
mit
194
master
5,195
describe Hubspot::Form do let(:guid) { '78c2891f-ebdd-44c0-bd94-15c012bbbfbf' } # '561d9ce9-bb4c-45b4-8e32-21cdeaa3a7f0' let(:example_form_hash) do VCR.use_cassette('form_example') do HTTParty.get("https://api.hubapi.com#{Hubspot::Form::FORMS_PATH}/#{guid}/?hapikey=demo").parsed_response end end ...
github
HubspotCommunity/hubspot-ruby
https://github.com/HubspotCommunity/hubspot-ruby
spec/lib/hubspot/deprecator_spec.rb
Ruby
mit
194
master
410
RSpec.describe Hubspot::Deprecator do describe ".build" do it "returns an instance of ActiveSupport::Deprecation" do deprecator = Hubspot::Deprecator.build expect(deprecator).to be_an_instance_of(ActiveSupport::Deprecation) end it "uses the correct gem name" do deprecator = Hubspot::De...
github
HubspotCommunity/hubspot-ruby
https://github.com/HubspotCommunity/hubspot-ruby
spec/lib/hubspot/deal_pipeline_spec.rb
Ruby
mit
194
master
2,283
RSpec.describe Hubspot::DealPipeline do before do Hubspot.configure hapikey: 'demo' end describe ".find" do it "retrieves a record by id" do VCR.use_cassette("find_deal_pipeline") do deal_pipeline = Hubspot::DealPipeline.create!(label: "New Pipeline") id = deal_pipeline.pipeline_id ...
github
HubspotCommunity/hubspot-ruby
https://github.com/HubspotCommunity/hubspot-ruby
spec/lib/hubspot/properties_spec.rb
Ruby
mit
194
master
3,152
module Hubspot describe Properties do let(:params) { { 'name' => 'amount_of_new_money_lined_up', 'label' => 'New Money Lined Up (Over $50K or Under $50K)', 'description' => '', 'groupN...
github
HubspotCommunity/hubspot-ruby
https://github.com/HubspotCommunity/hubspot-ruby
spec/lib/hubspot/topic_spec.rb
Ruby
mit
194
master
481
describe Hubspot::Topic do before do Hubspot.configure(hapikey: "demo") end describe ".list" do cassette "topics_list" let(:topics) { Hubspot::Topic.list } it "should have a list of topics" do topics.count.should be(3) end end describe ".find_by_topic_id" do cassette "topics_l...
github
HubspotCommunity/hubspot-ruby
https://github.com/HubspotCommunity/hubspot-ruby
spec/lib/hubspot/contact_list_spec.rb
Ruby
mit
194
master
9,263
describe Hubspot::ContactList do let(:example_contact_list_hash) do VCR.use_cassette("contact_list_example") do HTTParty.get("https://api.hubapi.com/contacts/v1/lists/1?hapikey=demo").parsed_response end end let(:static_list) { Hubspot::ContactList.all(static: true, count: 3).last } let(:dynamic_...
github
HubspotCommunity/hubspot-ruby
https://github.com/HubspotCommunity/hubspot-ruby
spec/lib/hubspot/utils_spec.rb
Ruby
mit
194
master
5,599
describe Hubspot::Utils do describe ".properties_to_hash" do let(:properties) do { "email" => { "value" => "email@address.com" }, "firstname" => { "value" => "Bob" }, "lastname" => { "value" => "Smith" } } end subject { Hubspot::Utils.properties_to_hash(properties)...
github
HubspotCommunity/hubspot-ruby
https://github.com/HubspotCommunity/hubspot-ruby
spec/lib/hubspot/contact_spec.rb
Ruby
mit
194
master
5,154
RSpec.describe Hubspot::Contact do before{ Hubspot.configure(hapikey: 'demo') } it_behaves_like "a saveable resource", :contact do def set_property(contact) contact.firstname = "foobar" end end it_behaves_like "an updateable resource", :contact do let(:changed_properties) { { firstname: "fo...
github
HubspotCommunity/hubspot-ruby
https://github.com/HubspotCommunity/hubspot-ruby
spec/lib/hubspot/deal_properties_spec.rb
Ruby
mit
194
master
8,781
describe Hubspot::DealProperties do describe '.add_default_parameters' do let(:opts) { {} } subject { Hubspot::DealProperties.add_default_parameters(opts) } context 'default parameters' do context 'without property parameter' do its([:property]) { should == 'email' } end context...
github
HubspotCommunity/hubspot-ruby
https://github.com/HubspotCommunity/hubspot-ruby
spec/lib/hubspot/config_spec.rb
Ruby
mit
194
master
2,184
describe Hubspot::Config do describe ".configure" do it "sets the hapikey config" do hapikey = "demo" config = Hubspot::Config.configure(hapikey: hapikey) expect(config.hapikey).to eq(hapikey) end it "changes the base_url" do base_url = "https://api.hubapi.com/v2" config ...
github
HubspotCommunity/hubspot-ruby
https://github.com/HubspotCommunity/hubspot-ruby
spec/support/capture_output.rb
Ruby
mit
194
master
358
module CaptureOutput def capture_stderr previous, $stderr = $stderr, StringIO.new yield $stderr.string ensure $stderr = previous end def capture_stdout previous, $stdout = $stdout, StringIO.new yield $stdout.string ensure $stdout = previous end end RSpec.configure do |confi...
github
HubspotCommunity/hubspot-ruby
https://github.com/HubspotCommunity/hubspot-ruby
spec/support/vcr.rb
Ruby
mit
194
master
366
require "vcr" def vcr_record_mode if ENV["VCR_RECORD"] == "1" :new_episodes else :none end end VCR.configure do |c| c.cassette_library_dir = "#{RSPEC_ROOT}/fixtures/vcr_cassettes" c.hook_into :webmock c.default_cassette_options = { record: vcr_record_mode } c.filter_sensitive_data("<HAPI_KEY>") ...
github
HubspotCommunity/hubspot-ruby
https://github.com/HubspotCommunity/hubspot-ruby
spec/support/tests_helper.rb
Ruby
mit
194
master
515
module TestsHelper def expect_count_and_offset(&block) it 'returns only the number of objects specified by count' do result = block.call(count: 2) expect(result.size).to eql 2 result = block.call(count: 4) expect(result.size).to eql 4 end it 'returns objects by a specified offset...
github
HubspotCommunity/hubspot-ruby
https://github.com/HubspotCommunity/hubspot-ruby
spec/support/hubspot_api_helpers.rb
Ruby
mit
194
master
300
module HubspotApiHelpers def hubspot_api_url(path) URI.join(Hubspot::Config.base_url, path) end def assert_hubspot_api_request(method, path, options = {}) assert_requested(method, /#{hubspot_api_url(path)}/, options) end end RSpec.configure do |c| c.include HubspotApiHelpers end
github
HubspotCommunity/hubspot-ruby
https://github.com/HubspotCommunity/hubspot-ruby
spec/support/rake.rb
Ruby
mit
194
master
742
require "rake" module RakeHelpers def invoke_rake_task(name, args = []) RakeTask.new(name).invoke(*args) end end class RakeTask def initialize(name) @task_name = name prep_environment end delegate :invoke, to: :task private attr_reader :task_name def prep_environment Rake.applicati...
github
HubspotCommunity/hubspot-ruby
https://github.com/HubspotCommunity/hubspot-ruby
spec/support/cassette_helper.rb
Ruby
mit
194
master
453
module CassetteHelper def self.extended(base) base.around do |spec| VCR.insert_cassette(_cassette, _cassette_options) if defined?(_cassette) && _cassette spec.run VCR.eject_cassette if defined?(_cassette) && _cassette end end def cassette(*args) options = args.extract_options! ...
github
HubspotCommunity/hubspot-ruby
https://github.com/HubspotCommunity/hubspot-ruby
spec/factories/contacts.rb
Ruby
mit
194
master
318
FactoryBot.define do factory :contact, class: Hubspot::Contact do to_create { |instance| instance.save } firstname { Faker::Name.first_name } lastname { Faker::Name.last_name } email { Faker::Internet.safe_email("#{Time.new.to_i.to_s[-5..-1]}#{(0..3).map { (65 + rand(26)).chr }.join}") } end end
github
HubspotCommunity/hubspot-ruby
https://github.com/HubspotCommunity/hubspot-ruby
spec/factories/companies.rb
Ruby
mit
194
master
230
FactoryBot.define do factory :company, class: Hubspot::Company do to_create { |instance| instance.save } add_attribute(:name) { Faker::Company.name } add_attribute(:domain) { Faker::Internet.domain_name } end end
github
HubspotCommunity/hubspot-ruby
https://github.com/HubspotCommunity/hubspot-ruby
lib/hubspot-ruby.rb
Ruby
mit
194
master
967
require 'active_support' require 'active_support/core_ext' require 'httparty' require 'hubspot/exceptions' require 'hubspot/resource' require 'hubspot/collection' require 'hubspot/paged_collection' require 'hubspot/properties' require 'hubspot/company' require 'hubspot/company_properties' require 'hubspot/config' requi...
github
HubspotCommunity/hubspot-ruby
https://github.com/HubspotCommunity/hubspot-ruby
lib/hubspot/resource.rb
Ruby
mit
194
master
6,511
module Hubspot class Resource class_attribute :id_field, instance_writer: false class_attribute :property_name_field, instance_writer: false class_attribute :update_method, instance_writer: false self.id_field = "id" self.property_name_field = "property" self.update_method = "put" class...
github
HubspotCommunity/hubspot-ruby
https://github.com/HubspotCommunity/hubspot-ruby
lib/hubspot/utils.rb
Ruby
mit
194
master
4,553
module Hubspot class Utils class << self # Parses the hubspot properties format into a key-value hash def properties_to_hash(props) newprops = HashWithIndifferentAccess.new props.each { |k, v| newprops[k] = v["value"] } newprops end # Converts an array of property ...
github
HubspotCommunity/hubspot-ruby
https://github.com/HubspotCommunity/hubspot-ruby
lib/hubspot/deal_properties.rb
Ruby
mit
194
master
1,694
module Hubspot class DealProperties < Properties ALL_PROPERTIES_PATH = '/deals/v1/properties' ALL_GROUPS_PATH = '/deals/v1/groups' CREATE_PROPERTY_PATH = '/deals/v1/properties/' UPDATE_PROPERTY_PATH = '/deals/v1/properties/named/:property_name' DELETE_PROPERTY_PATH = '/deals/v1/properties/n...
github
HubspotCommunity/hubspot-ruby
https://github.com/HubspotCommunity/hubspot-ruby
lib/hubspot/railtie.rb
Ruby
mit
194
master
236
require 'hubspot-ruby' require 'rails' module Hubspot class Railtie < Rails::Railtie rake_tasks do spec = Gem::Specification.find_by_name('hubspot-ruby') load "#{spec.gem_dir}/lib/tasks/hubspot.rake" end end end
github
HubspotCommunity/hubspot-ruby
https://github.com/HubspotCommunity/hubspot-ruby
lib/hubspot/oauth.rb
Ruby
mit
194
master
1,591
require 'httparty' module Hubspot class OAuth < Connection include HTTParty DEFAULT_OAUTH_HEADERS = {"Content-Type" => "application/x-www-form-urlencoded;charset=utf-8"} class << self def refresh(token, params={}, options={}) oauth_post(token_url, { grant_type: "refresh_token", refresh_to...
github
HubspotCommunity/hubspot-ruby
https://github.com/HubspotCommunity/hubspot-ruby
lib/hubspot/contact_properties.rb
Ruby
mit
194
master
1,807
module Hubspot class ContactProperties < Properties ALL_PROPERTIES_PATH = "/properties/v1/contacts/properties" ALL_GROUPS_PATH = "/properties/v1/contacts/groups" CREATE_PROPERTY_PATH = "/properties/v1/contacts/properties" UPDATE_PROPERTY_PATH = "/properties/v1/contacts/properties/named/:propert...
github
HubspotCommunity/hubspot-ruby
https://github.com/HubspotCommunity/hubspot-ruby
lib/hubspot/form.rb
Ruby
mit
194
master
3,028
module Hubspot # # HubSpot Form API # # {https://developers.hubspot.com/docs/methods/forms/forms_overview} # class Form FORMS_PATH = '/forms/v2/forms' # '/contacts/v1/forms' FORM_PATH = '/forms/v2/forms/:form_guid' # '/contacts/v1/forms/:form_guid' FIELDS_PATH = '/forms/v2/fiel...
github
HubspotCommunity/hubspot-ruby
https://github.com/HubspotCommunity/hubspot-ruby
lib/hubspot/topic.rb
Ruby
mit
194
master
979
module Hubspot # # HubSpot Topics API # class Topic TOPICS_PATH = "/blogs/v3/topics" TOPIC_PATH = "/blogs/v3/topics/:topic_id" class << self # Lists the topics # {https://developers.hubspot.com/docs/methods/blogv2/get_topics) # @return [Hubspot::Topic] array of topics def li...
github
HubspotCommunity/hubspot-ruby
https://github.com/HubspotCommunity/hubspot-ruby
lib/hubspot/exceptions.rb
Ruby
mit
194
master
509
module Hubspot class RequestError < StandardError attr_accessor :response def initialize(response, message=nil) message += "\n" if message me = super("#{message}Response body: #{response.body}",) me.response = response return me end end class ConfigurationError < StandardErro...
github
HubspotCommunity/hubspot-ruby
https://github.com/HubspotCommunity/hubspot-ruby
lib/hubspot/deal_pipeline.rb
Ruby
mit
194
master
1,601
require 'hubspot/utils' module Hubspot # # HubSpot Deals API # # {http://developers.hubspot.com/docs/methods/deal-pipelines/overview} # class DealPipeline PIPELINES_PATH = "/deals/v1/pipelines" PIPELINE_PATH = "/deals/v1/pipelines/:pipeline_id" attr_reader :active attr_reader :display_orde...
github
HubspotCommunity/hubspot-ruby
https://github.com/HubspotCommunity/hubspot-ruby
lib/hubspot/company_properties.rb
Ruby
mit
194
master
1,815
module Hubspot class CompanyProperties < Properties ALL_PROPERTIES_PATH = "/properties/v1/companies/properties" ALL_GROUPS_PATH = "/properties/v1/companies/groups" CREATE_PROPERTY_PATH = "/properties/v1/companies/properties" UPDATE_PROPERTY_PATH = "/properties/v1/companies/properties/named/:pro...
github
HubspotCommunity/hubspot-ruby
https://github.com/HubspotCommunity/hubspot-ruby
lib/hubspot/subscription.rb
Ruby
mit
194
master
883
module Hubspot class Subscription SUBSCRIPTIONS_PATH = '/email/public/v1/subscriptions' TIMELINE_PATH = '/email/public/v1/subscriptions/timeline' SUBSCRIPTION_PATH = '/email/public/v1/subscriptions/:email_address' attr_reader :subscribed attr_reader :marked_as_spam attr_reader :bounced ...
github
HubspotCommunity/hubspot-ruby
https://github.com/HubspotCommunity/hubspot-ruby
lib/hubspot/paged_collection.rb
Ruby
mit
194
master
642
class Hubspot::PagedCollection < Hubspot::Collection attr_accessor :offset, :limit def initialize(opts = {}, &block) @limit_param = opts.delete(:limit_param) || "limit" @limit = opts.delete(:limit) || 25 @offset_param = opts.delete(:offset_param) || "offset" @offset = opts.delete(:offset) supe...
github
HubspotCommunity/hubspot-ruby
https://github.com/HubspotCommunity/hubspot-ruby
lib/hubspot/collection.rb
Ruby
mit
194
master
824
class Hubspot::Collection def initialize(opts = {}, &block) @options = opts @fetch_proc = block fetch end def refresh fetch self end def resources @resources end def update_all(opts = {}) return true if empty? # This assumes that all resources are the same type reso...
github
HubspotCommunity/hubspot-ruby
https://github.com/HubspotCommunity/hubspot-ruby
lib/hubspot/engagement.rb
Ruby
mit
194
master
5,936
require 'hubspot/utils' module Hubspot # # HubSpot Engagements API # # {http://developers.hubspot.com/docs/methods/engagements/create_engagement} # class Engagement CREATE_ENGAGMEMENT_PATH = '/engagements/v1/engagements' ENGAGEMENT_PATH = '/engagements/v1/engagements/:engagement_id' ASSOCIATE_E...
github
HubspotCommunity/hubspot-ruby
https://github.com/HubspotCommunity/hubspot-ruby
lib/hubspot/blog.rb
Ruby
mit
194
master
3,005
module Hubspot # # HubSpot Contacts API # class Blog BLOG_LIST_PATH = "/content/api/v2/blogs" BLOG_POSTS_PATH = "/content/api/v2/blog-posts" GET_BLOG_BY_ID_PATH = "/content/api/v2/blogs/:blog_id" class << self # Lists the blogs # {https://developers.hubspot.com/docs/methods/blogv2/g...
github
HubspotCommunity/hubspot-ruby
https://github.com/HubspotCommunity/hubspot-ruby
lib/hubspot/properties.rb
Ruby
mit
194
master
4,243
module Hubspot class Properties PROPERTY_SPECS = { group_field_names: %w(name displayName displayOrder properties), field_names: %w(name groupName description fieldType formField type displayOrder label options showCurrencySymbol), valid_field_types: %w(textarea select text date file numb...
github
HubspotCommunity/hubspot-ruby
https://github.com/HubspotCommunity/hubspot-ruby
lib/hubspot/contact_list.rb
Ruby
mit
194
master
4,872
module Hubspot # # HubSpot Contact lists API # class ContactList LISTS_PATH = '/contacts/v1/lists' LIST_PATH = '/contacts/v1/lists/:list_id' LIST_BATCH_PATH = LISTS_PATH + '/batch' CONTACTS_PATH = LIST_PATH + '/contacts/all' RECENT_CONTACTS_PATH = LIST_PATH +...
github
HubspotCommunity/hubspot-ruby
https://github.com/HubspotCommunity/hubspot-ruby
lib/hubspot/company.rb
Ruby
mit
194
master
4,844
class Hubspot::Company < Hubspot::Resource self.id_field = "companyId" self.property_name_field = "name" ADD_CONTACT_PATH = '/companies/v2/companies/:id/contacts/:contact_id' ALL_PATH = '/companies/v2/companies/paged' BATCH_UPDATE_PATH = '/companies/v1/batch-async/update' CONTAC...
github
HubspotCommunity/hubspot-ruby
https://github.com/HubspotCommunity/hubspot-ruby
lib/hubspot/connection.rb
Ruby
mit
194
master
4,631
module Hubspot class Connection include HTTParty class << self def get_json(path, opts) url = generate_url(path, opts) response = get(url, format: :json, read_timeout: read_timeout(opts), open_timeout: open_timeout(opts)) log_request_and_response url, response handle_res...
github
HubspotCommunity/hubspot-ruby
https://github.com/HubspotCommunity/hubspot-ruby
lib/hubspot/deal.rb
Ruby
mit
194
master
5,386
require 'hubspot/utils' module Hubspot # # HubSpot Deals API # # {http://developers.hubspot.com/docs/methods/deals/deals_overview} # class Deal ALL_DEALS_PATH = "/deals/v1/deal/paged" CREATE_DEAL_PATH = "/deals/v1/deal" DEAL_PATH = "/deals/v1/deal/:deal_id" RECENT_UPDATED_PATH = "/deals/v1/...
github
HubspotCommunity/hubspot-ruby
https://github.com/HubspotCommunity/hubspot-ruby
lib/hubspot/config.rb
Ruby
mit
194
master
1,914
require 'logger' require 'hubspot/connection' module Hubspot class Config CONFIG_KEYS = [ :hapikey, :base_url, :portal_id, :logger, :access_token, :client_id, :client_secret, :redirect_uri, :read_timeout, :open_timeout ] DEFAULT_LOGGER = Logger.new(nil) DEFAULT_BASE_URL = "https://api.hub...
github
HubspotCommunity/hubspot-ruby
https://github.com/HubspotCommunity/hubspot-ruby
lib/hubspot/owner.rb
Ruby
mit
194
master
1,667
module Hubspot # # HubSpot Owners API # # {http://developers.hubspot.com/docs/methods/owners/get_owners} # # TODO: Create an Owner # TODO: Update an Owner # TODO: Delete an Owner class Owner GET_OWNER_PATH = '/owners/v2/owners/:owner_id' # GET GET_OWNERS_PATH = '/owners/v2/owners' # GET ...
github
HubspotCommunity/hubspot-ruby
https://github.com/HubspotCommunity/hubspot-ruby
lib/hubspot/contact.rb
Ruby
mit
194
master
2,714
class Hubspot::Contact < Hubspot::Resource self.id_field = "vid" self.update_method = "post" ALL_PATH = '/contacts/v1/lists/all/contacts/all' CREATE_PATH = '/contacts/v1/contact' CREATE_OR_UPDATE_PATH = '/contacts/v1/contact/createOrUpdate/email/:email' DELETE_PATH ...
github
HubspotCommunity/hubspot-ruby
https://github.com/HubspotCommunity/hubspot-ruby
lib/tasks/hubspot.rake
Ruby
mit
194
master
1,731
require 'hubspot-ruby' namespace :hubspot do desc 'Dump properties to file' task :dump_properties, [:kind, :file, :hapikey, :include, :exclude] do |_, args| Hubspot::Deprecator.build.deprecation_warning("hubspot:dump_properties") hapikey = args[:hapikey] || ENV['HUBSPOT_API_KEY'] kind = args[:kind] ...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
openclacky.gemspec
Ruby
mit
194
main
3,793
# frozen_string_literal: true # Friendly Ruby version check — must come before anything else so it triggers # during `gem install` when the gemspec is evaluated. if RUBY_VERSION < "2.6.0" abort <<~MSG ✗ Ruby #{RUBY_VERSION} is not supported. OpenClacky requires Ruby >= 2.6.0, but your system is running Ru...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
Rakefile
Ruby
mit
194
main
815
# frozen_string_literal: true require "bundler/gem_tasks" require "rspec/core/rake_task" RSpec::Core::RakeTask.new(:spec) namespace :build do desc "Build both openclacky and clacky gems" task :all do puts "Building openclacky gem..." sh "gem build openclacky.gemspec" puts "Building clacky gem..." ...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
Gemfile
Ruby
mit
194
main
242
# frozen_string_literal: true source "https://rubygems.org" # Specify your gem's dependencies in openclacky.gemspec gemspec gem "irb" gem "rake", "~> 13.0" gem "debug" gem "rspec", "~> 3.0" gem "rubocop", "~> 1.21" gem "climate_control"
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
spec/agent_session_history_spec.rb
Ruby
mit
194
main
4,923
# frozen_string_literal: true require "spec_helper" RSpec.describe "Agent session history" do describe "#get_recent_user_messages" do let(:client) { instance_double(Clacky::Client) } let(:config) { Clacky::AgentConfig.new } let(:agent) { Clacky::Agent.new(client, config, working_dir: Dir.pwd, ui: nil, p...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
spec/code_style_spec.rb
Ruby
mit
194
main
1,072
# frozen_string_literal: true RSpec.describe "Code style: no standalone private keyword" do # Find all Ruby source files under lib/ and bin/ RUBY_SOURCE_FILES = Dir.glob(File.expand_path("../../{lib,bin}/**/*.rb", __FILE__)).sort.freeze it "has at least one Ruby source file to check" do expect(RUBY_SOURCE_F...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
spec/spec_helper.rb
Ruby
mit
194
main
1,045
# frozen_string_literal: true ENV["CLACKY_TEST"] = "1" require "clacky" require "tmpdir" require "fileutils" require "climate_control" require_relative "support/test_helpers" RSpec.configure do |config| # Enable flags like --only-failures and --next-failure config.example_status_persistence_file_path = ".rspec_s...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
spec/clacky_spec.rb
Ruby
mit
194
main
424
# frozen_string_literal: true RSpec.describe Clacky do it "has a version number" do expect(Clacky::VERSION).not_to be nil end it "defines the main module" do expect(Clacky).to be_a(Module) end it "defines the AgentError class" do expect(Clacky::AgentError).to be < StandardError end it "def...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
spec/support/test_helpers.rb
Ruby
mit
194
main
1,580
# frozen_string_literal: true require "climate_control" module TestHelpers # Capture stdout and stderr output def capture_output original_stdout = $stdout original_stderr = $stderr $stdout = StringIO.new $stderr = StringIO.new begin yield $stdout.string + $stderr.string ensure...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
spec/ui2/view_renderer_spec.rb
Ruby
mit
194
main
2,886
# frozen_string_literal: true require "spec_helper" require "clacky/ui2/view_renderer" RSpec.describe Clacky::UI2::ViewRenderer do let(:renderer) { described_class.new } describe "#render_user_message" do it "renders user message with symbol" do result = renderer.render_user_message("Hello") expe...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
spec/ui2/ui_controller_spec.rb
Ruby
mit
194
main
1,667
# frozen_string_literal: true require 'spec_helper' RSpec.describe Clacky::UI2::UIController do describe '#filter_thinking_tags' do let(:controller) { described_class.new } it 'removes <think>...</think> tags' do content = "<think>\nThe user is asking about X\n</think>\n\nHere is my response." ...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
spec/ui2/components/input_area_spec.rb
Ruby
mit
194
main
5,908
# frozen_string_literal: true require "spec_helper" require "clacky/ui2/components/input_area" RSpec.describe Clacky::UI2::Components::InputArea do let(:input_area) { described_class.new(row: 20) } describe "#insert_char" do it "inserts character at cursor position" do input_area.insert_char("H") ...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
spec/clacky/platform_http_client_download_spec.rb
Ruby
mit
194
main
4,264
# frozen_string_literal: true require "spec_helper" require "webrick" RSpec.describe Clacky::PlatformHttpClient, "#download_file" do let(:client) { described_class.new } let(:tmpdir) { Dir.mktmpdir } let(:dest) { File.join(tmpdir, "payload.bin") } after do FileUtils.remove_entry(tmpdir) if Dir.exist?(t...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
spec/clacky/brand_config_decrypt_spec.rb
Ruby
mit
194
main
22,051
# frozen_string_literal: true require "tmpdir" require "fileutils" require "openssl" require "base64" require "digest" require "json" require "clacky/aes_gcm" # Tests for BrandConfig#decrypt_skill_content AES-256-GCM path, # fetch_decryption_key caching, and all error branches. # # These tests use real OpenSSL encryp...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
spec/clacky/agent_config_model_id_spec.rb
Ruby
mit
194
main
7,633
# frozen_string_literal: true # Regression tests for runtime model id injection (Plan B). # # Design invariants exercised here: # 1. Every loaded model gets a stable runtime id. # 2. Ids are NOT written to config.yml (backward compat for old users). # 3. switch_model_by_id preserves identity across list reorders...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
spec/clacky/providers_spec.rb
Ruby
mit
194
main
6,790
# frozen_string_literal: true RSpec.describe Clacky::Providers do describe ".capabilities" do it "returns {} for an unknown provider" do expect(described_class.capabilities("nope-provider")).to eq({}) end it "returns the provider-level capabilities hash when no model override" do # MiniMax d...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
spec/clacky/agent_config_spec.rb
Ruby
mit
194
main
39,166
# frozen_string_literal: true RSpec.describe Clacky::AgentConfig do # Helper to create a temporary config file def with_temp_config(data = nil) temp_dir = Dir.mktmpdir config_file = File.join(temp_dir, "config.yml") if data File.write(config_file, YAML.dump(data)) end yield config_file ...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
spec/clacky/session_manager_files_for_spec.rb
Ruby
mit
194
main
1,887
# frozen_string_literal: true require "tmpdir" require "fileutils" require "json" RSpec.describe Clacky::SessionManager, "#files_for" do let(:temp_dir) { Dir.mktmpdir("clacky_sm_spec") } subject(:manager) { described_class.new(sessions_dir: temp_dir) } after { FileUtils.rm_rf(temp_dir) if Dir.exist?(temp_dir) ...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
spec/clacky/skill_spec.rb
Ruby
mit
194
main
19,141
# frozen_string_literal: true require "tempfile" require "tmpdir" RSpec.describe Clacky::Skill do let(:temp_dir) { Dir.mktmpdir } let(:skill_content) do <<~CONTENT --- name: test-skill description: A test skill for testing purposes user_invocable: true --- This is the skil...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
spec/clacky/agent_spec.rb
Ruby
mit
194
main
68,567
# frozen_string_literal: true RSpec.describe Clacky::Agent do let(:client) do instance_double(Clacky::Client).tap do |c| # Set @api_key instance variable to avoid "API key not configured" error c.instance_variable_set(:@api_key, "test-api-key") end end let(:config) do c = Clacky::AgentCon...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
spec/clacky/model_pricing_spec.rb
Ruby
mit
194
main
11,734
# frozen_string_literal: true require "spec_helper" RSpec.describe Clacky::ModelPricing do describe ".calculate_cost" do context "with Claude Opus 4.5" do let(:model) { "claude-opus-4.5" } it "calculates cost for basic input/output" do usage = { prompt_tokens: 100_000, ...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
spec/clacky/brand_config_spec.rb
Ruby
mit
194
main
10,613
# frozen_string_literal: true require "tmpdir" require "fileutils" require "yaml" RSpec.describe Clacky::BrandConfig do # ── Helpers ──────────────────────────────────────────────────────────────── # Run block with a temporary brand.yml path injected via stub. def with_temp_brand_file(data = nil) tmp_dir ...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
spec/clacky/brand_config_refresh_distribution_spec.rb
Ruby
mit
194
main
9,126
# frozen_string_literal: true require "tmpdir" require "fileutils" require "yaml" RSpec.describe Clacky::BrandConfig do # Same helper pattern as brand_config_spec.rb — isolates brand.yml to a tmpdir # so tests never touch the user's real ~/.clacky/brand.yml. def with_temp_brand_file(data = nil) tmp_dir =...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
spec/clacky/cli_client_factory_spec.rb
Ruby
mit
194
main
5,953
# frozen_string_literal: true require "spec_helper" require "clacky/cli" # Regression test for a real-world 404 bug: # # 1. User starts a session on DSK model (dsk-*, base_url http://localhost:3100, # OpenAI-compatible /chat/completions). # 2. User presses `/config` and switches to Opus (abs-*, base_url # ...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
spec/clacky/client_retryable_spec.rb
Ruby
mit
194
main
5,243
# frozen_string_literal: true require "spec_helper" RSpec.describe Clacky::Client do let(:client) { described_class.new("test-key", base_url: "https://api.example.com", model: "gpt-4") } # Helper: build a fake Faraday response def fake_response(status:, body:) Struct.new(:status, :body).new(status, body) ...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
spec/clacky/agent_time_machine_spec.rb
Ruby
mit
194
main
15,167
# frozen_string_literal: true require "spec_helper" require "fileutils" require "tmpdir" RSpec.describe "Clacky::Agent TimeMachine" do let(:client) do instance_double(Clacky::Client).tap do |c| c.instance_variable_set(:@api_key, "test-api-key") end end let(:config) do Clacky::AgentConfig.new(...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
spec/clacky/cli_spec.rb
Ruby
mit
194
main
1,229
# frozen_string_literal: true require "tmpdir" require "fileutils" require "pathname" RSpec.describe Clacky::CLI do describe "working directory validation" do let(:cli) { Clacky::CLI.new } it "uses current directory when no path is specified" do result = cli.send(:validate_working_directory, nil) ...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
spec/clacky/agent_config_fallback_spec.rb
Ruby
mit
194
main
6,374
# frozen_string_literal: true RSpec.describe Clacky::AgentConfig, "fallback state machine" do # Minimal config with a clackyai-style base_url so fallback_model_for works let(:config) do Clacky::AgentConfig.new( models: [ { "type" => "default", "model" =>...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
spec/clacky/cli_non_interactive_spec.rb
Ruby
mit
194
main
2,617
# frozen_string_literal: true require "spec_helper" require "clacky/cli" require "clacky/plain_ui_controller" RSpec.describe "CLI --message / -i non-interactive mode" do let(:cli) { Clacky::CLI.new } # Extract the private helper so we can unit-test it directly let(:run_non_interactive) do # Expose private ...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
spec/clacky/cli_slash_commands_spec.rb
Ruby
mit
194
main
6,572
# frozen_string_literal: true require "spec_helper" require "clacky/cli" # Tests for slash commands in UI2 interactive mode. # # Strategy: call run_agent_with_ui2 with a fake UIController that captures # the on_input block, then trigger the block manually with each slash command. # This avoids starting a real TUI whi...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
spec/clacky/skill_loader_spec.rb
Ruby
mit
194
main
12,177
# frozen_string_literal: true require "tempfile" require "tmpdir" RSpec.describe Clacky::SkillLoader do let(:temp_dir) { Dir.mktmpdir } let(:working_dir) { temp_dir } after do FileUtils.rm_rf(temp_dir) if Dir.exist?(temp_dir) end describe "#initialize" do it "initializes with working directory" do...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
spec/clacky/agent_subagent_spec.rb
Ruby
mit
194
main
10,377
# frozen_string_literal: true require "spec_helper" RSpec.describe Clacky::Agent, "#fork_subagent" do let(:config) do Clacky::AgentConfig.new( api_key: "test-key", base_url: "https://api.test.com", model: "claude-sonnet-4-5", anthropic_format: true ) end let(:client) { instanc...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
spec/clacky/clacky_auth_client_spec.rb
Ruby
mit
194
main
8,270
# frozen_string_literal: true require "spec_helper" require_relative "../../lib/clacky/clacky_auth_client" # Helper: build a fake Faraday response object def fake_faraday_response(status:, body:) double("Faraday::Response", status: status, body: body.is_a?(Hash) ? JSON.generate(body) : body.to_s) end RSpec.describ...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
spec/clacky/brand_config_user_licensed_spec.rb
Ruby
mit
194
main
12,672
# frozen_string_literal: true require "spec_helper" require "tmpdir" require "fileutils" require "yaml" # Tests for the user-licensed features introduced in: # 1. BrandConfig#license_user_id / #user_licensed? # 2. BrandConfig#activate! saves user_id from API response # 3. BrandConfig#save persists license_user_...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
spec/clacky/prompt_caching_spec.rb
Ruby
mit
194
main
9,407
# frozen_string_literal: true require "spec_helper" RSpec.describe "Prompt Caching Feature" do let(:client) do instance_double(Clacky::Client).tap do |c| # Set @api_key instance variable to avoid "API key not configured" error c.instance_variable_set(:@api_key, "test-api-key") end end des...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
spec/clacky/cloud_project_client_spec.rb
Ruby
mit
194
main
12,356
# frozen_string_literal: true require "spec_helper" require_relative "../../lib/clacky/cloud_project_client" # Helper: build a fake Faraday response object def fake_project_response(status:, body:) double("Faraday::Response", status: status, body: body.is_a?(Hash) ? JSON.generate(body) : body.to_s) end RSpec.descr...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
spec/clacky/message_history_spec.rb
Ruby
mit
194
main
24,387
# frozen_string_literal: true require "json" RSpec.describe Clacky::MessageHistory do subject(:history) { described_class.new } # Helper: build a basic message def user_msg(content = "hello", **opts) { role: "user", content: content, task_id: 1, created_at: Time.now.to_f }.merge(opts) end def assistan...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
spec/clacky/agent_llm_caller_fallback_spec.rb
Ruby
mit
194
main
7,422
# frozen_string_literal: true # Integration-level tests for the fallback model state machine inside Agent#call_llm. # We wire up a real Agent (with stubbed Client) and simulate 503 / 429 / network # failures to verify the three states: primary_ok → fallback_active → probing → primary_ok. RSpec.describe Clacky::Agent,...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
spec/clacky/message_format_openai_spec.rb
Ruby
mit
194
main
6,553
# frozen_string_literal: true require "spec_helper" RSpec.describe Clacky::MessageFormat::OpenAI do describe ".build_request_body" do let(:model) { "deepseek-v4-pro" } let(:tools) { [] } let(:max_tokens) { 1024 } it "passes through plain text messages unchanged" do messages = [ { role...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
spec/clacky/brand_skill_spec.rb
Ruby
mit
194
main
27,820
# frozen_string_literal: true require "tmpdir" require "fileutils" require "yaml" # Tests for the encrypted Brand Skill system: # - BrandConfig#decrypt_skill_content (mock implementation) # - BrandConfig#install_mock_brand_skill! # - BrandConfig#sync_brand_skills_async! # - Skill loaded as a brand skill (encr...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
spec/clacky/aes_gcm_spec.rb
Ruby
mit
194
main
2,176
# frozen_string_literal: true require "openssl" require "base64" require "clacky/aes_gcm" RSpec.describe Clacky::AesGcm do let(:key) { OpenSSL::Random.random_bytes(32) } let(:iv) { OpenSSL::Random.random_bytes(12) } let(:plaintext) { "Hello, pure-Ruby AES-256-GCM!" } let(:aad) { "additional authenticated dat...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
spec/clacky/ui2/progress_handle_spec.rb
Ruby
mit
194
main
10,738
# frozen_string_literal: true require "clacky/ui2/progress_handle" # ProgressHandle is an *owned* progress indicator: the caller creates one, # the handle takes responsibility for its ticker thread, its OutputBuffer # entry, and its lifecycle. When the caller finishes (or an exception # escapes a with_progress block)...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
spec/clacky/ui2/output_buffer_spec.rb
Ruby
mit
194
main
7,887
# frozen_string_literal: true require "clacky/ui2/output_buffer" RSpec.describe Clacky::UI2::OutputBuffer do # --------------------------------------------------------------------------- # append + basic queries # --------------------------------------------------------------------------- describe "#append" d...
github
clacky-ai/openclacky
https://github.com/clacky-ai/openclacky
spec/clacky/ui2/layout_manager_spec.rb
Ruby
mit
194
main
5,073
# frozen_string_literal: true require "clacky/ui2/layout_manager" RSpec.describe Clacky::UI2::LayoutManager do # Tiny stub standing in for Components::InputArea during tests. # The only layout-relevant method is +required_height+; everything else # is a no-op since we're testing output-area paint semantics, not...