diff --git a/hubspot-api-client.gemspec b/hubspot-api-client.gemspec index 4976faad..cf1c0538 100644 --- a/hubspot-api-client.gemspec +++ b/hubspot-api-client.gemspec @@ -2,20 +2,21 @@ $:.push File.expand_path("../lib", __FILE__) require "hubspot/version" Gem::Specification.new do |s| - s.name = "hubspot-api-client" + s.name = "hubspot-api-client-patched-pn" s.version = Hubspot::VERSION s.platform = Gem::Platform::RUBY - s.authors = ["HubSpot"] + s.authors = ["primeNumber"] s.email = [""] - s.homepage = "https://github.com/HubSpot/hubspot-api-ruby" + s.homepage = "https://github.com/primenumber-dev/hubspot-api-ruby" s.summary = "HubSpot Ruby API Gem" s.description = "HubSpot Ruby API client" s.license = "Unlicense" s.required_ruby_version = ">= 1.9" s.add_runtime_dependency 'typhoeus', '~> 1.4.0' - s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0' + s.add_runtime_dependency 'json', '>= 2.1', '< 2.7' s.add_runtime_dependency 'require_all', '~> 3.0.0' + s.add_runtime_dependency 'ffi', '~> 1.15.0' s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0' s.add_development_dependency 'vcr', '~> 3.0', '>= 3.0.1' diff --git a/lib/hubspot-api-client.rb b/lib/hubspot-api-client.rb index fb124a31..cc5bee0d 100644 --- a/lib/hubspot-api-client.rb +++ b/lib/hubspot-api-client.rb @@ -45,3 +45,5 @@ def configure end end end + +require_relative 'hubspot_patches/skip_hapikey' diff --git a/lib/hubspot/version.rb b/lib/hubspot/version.rb index d3ee3a7b..4774ffcf 100644 --- a/lib/hubspot/version.rb +++ b/lib/hubspot/version.rb @@ -1,3 +1,3 @@ module Hubspot - VERSION = '9.5.1' - end \ No newline at end of file + VERSION = '9.5.1.trocco.0.0.10' + end diff --git a/lib/hubspot_patches/skip_hapikey.rb b/lib/hubspot_patches/skip_hapikey.rb new file mode 100644 index 00000000..8ecb93b7 --- /dev/null +++ b/lib/hubspot_patches/skip_hapikey.rb @@ -0,0 +1,22 @@ +module Hubspot + module SkipHapikeyPatch # :nodoc: + def update_params_for_auth!(header, query, auth_names) + filtered = Array(auth_names).reject do |name| + name == 'hapikey' && + (@config.access_token.to_s.strip != '' || + @config.api_key['hapikey'].to_s.strip.empty?) + end + super(header, query, filtered) + end + end + + # CRM 配下にある全ての ApiClient に prepend + module Crm + constants.each do |sub| + mod = const_get(sub) + next unless mod.const_defined?(:ApiClient) + + mod::ApiClient.prepend SkipHapikeyPatch + end + end +end