Skip to content

Commit 6cd617c

Browse files
change call path'
1 parent f50b781 commit 6cd617c

File tree

9 files changed

+13
-13
lines changed

9 files changed

+13
-13
lines changed

lib/hubspot/client.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def api_modules
1919
events
2020
files
2121
marketing
22-
o_auth
22+
oauth
2323
settings
2424
webhooks
2525
].freeze

lib/hubspot/discovery/oauth/client.rb

-4
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@ def api_classes
1313
tokens
1414
].freeze
1515
end
16-
17-
def discovery_module_path
18-
super.gsub('o_auth', 'oauth')
19-
end
2016
end
2117
end
2218
end

lib/hubspot/helpers/camel_case.rb

+5-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@ module Hubspot
22
module Helpers
33
class CamelCase
44
def format(string)
5-
string.split('_').collect(&:capitalize).join
5+
if string == 'oauth'
6+
'OAuth'
7+
else
8+
string.split('_').collect(&:capitalize).join
9+
end
610
end
711
end
812
end

lib/hubspot/helpers/path.rb

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,11 @@ def format(module_name)
88
end
99

1010
def require_with_mapping(path)
11-
require path.gsub('o_auth', 'oauth')
11+
require path
1212
end
1313

1414
def require_with_codegen_mapping(path)
1515
require path
16-
.gsub('o_auth', 'oauth')
1716
.gsub('audit_logs/', 'audit-logs/')
1817
.gsub('blog_posts/', 'blog-posts/')
1918
.gsub('site_search', 'site-search')

lib/hubspot/helpers/snake_case.rb

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ module Hubspot
22
module Helpers
33
class SnakeCase
44
def format(string)
5-
string.gsub(/::/, '/').
5+
string.gsub('OAuth', 'Oauth').
6+
gsub(/::/, '/').
67
gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').
78
gsub(/([a-z\d])([A-Z])/,'\1_\2').
89
tr("-", "_").

spec/discovery/client_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@
1111
it { is_expected.to respond_to(:events) }
1212
it { is_expected.to respond_to(:files) }
1313
it { is_expected.to respond_to(:marketing) }
14-
it { is_expected.to respond_to(:o_auth) }
14+
it { is_expected.to respond_to(:oauth) }
1515
it { is_expected.to respond_to(:webhooks) }
1616
end
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
require 'spec_helper'
22

33
describe 'Hubspot::Discovery::OAuth::AccessTokensApi' do
4-
subject(:api) { Hubspot::Client.new(access_token: 'test').o_auth.access_tokens_api }
4+
subject(:api) { Hubspot::Client.new(access_token: 'test').oauth.access_tokens_api }
55

66
it { is_expected.to respond_to(:get) }
77
end

spec/discovery/oauth/refresh_tokens_api_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
require 'spec_helper'
22

33
describe 'Hubspot::Discovery::OAuth::RefreshTokensApi' do
4-
subject(:api) { Hubspot::Client.new(access_token: 'test').o_auth.refresh_tokens_api }
4+
subject(:api) { Hubspot::Client.new(access_token: 'test').oauth.refresh_tokens_api }
55

66
it { is_expected.to respond_to(:archive) }
77
it { is_expected.to respond_to(:get) }
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
require 'spec_helper'
22

33
describe 'Hubspot::Discovery::OAuth::TokensApi' do
4-
subject(:api) { Hubspot::Client.new(access_token: 'test').o_auth.tokens_api }
4+
subject(:api) { Hubspot::Client.new(access_token: 'test').oauth.tokens_api }
55

66
it { is_expected.to respond_to(:create) }
77
end

0 commit comments

Comments
 (0)