api-client 2.0.3 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## v2.1.0
4
+
5
+ * Add support for classes with compost names.
6
+
3
7
  ## v2.0.3
4
8
 
5
9
  * Fix put and patch requisitions.
@@ -62,7 +62,7 @@ module ApiClient
62
62
  #
63
63
  # @return [String] a string with the root node name for this class.
64
64
  def self.root_node
65
- @root_node.blank? ? self.to_s.split('::').last.downcase : @root_node
65
+ @root_node.blank? ? self.to_s.split('::').last.underscore : @root_node
66
66
  end
67
67
 
68
68
  # Set a custom root node name instead of the Class name.
@@ -1,5 +1,5 @@
1
1
  # High Level Namespace of the library ApiClient.
2
2
  module ApiClient
3
3
  # Version of the library.
4
- VERSION = '2.0.3'
4
+ VERSION = '2.1.0'
5
5
  end
@@ -96,6 +96,12 @@ describe ApiClient::Base do
96
96
  Admin.root_node.should == 'user'
97
97
  end
98
98
  end
99
+
100
+ context 'on a class with a compost name' do
101
+ it 'should return the class name' do
102
+ InvoiceItem.root_node.should == 'invoice_item'
103
+ end
104
+ end
99
105
  end
100
106
 
101
107
  describe '.root_node=' do
data/spec/spec_helper.rb CHANGED
@@ -30,6 +30,9 @@ class Group < ApiClient::Base
30
30
  self.associations = { :members => 'User', :owner => 'Admin' }
31
31
  end
32
32
 
33
+ class InvoiceItem < ApiClient::Base
34
+ end
35
+
33
36
  ApiClient.configure do |config|
34
37
  config.path = 'http://api.example.com'
35
38
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: api-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.3
4
+ version: 2.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-06-28 00:00:00.000000000 Z
12
+ date: 2013-07-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -197,7 +197,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
197
197
  version: '0'
198
198
  segments:
199
199
  - 0
200
- hash: -3513012909283666012
200
+ hash: 3129970379733886747
201
201
  required_rubygems_version: !ruby/object:Gem::Requirement
202
202
  none: false
203
203
  requirements:
@@ -206,7 +206,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
206
206
  version: '0'
207
207
  segments:
208
208
  - 0
209
- hash: -3513012909283666012
209
+ hash: 3129970379733886747
210
210
  requirements: []
211
211
  rubyforge_project:
212
212
  rubygems_version: 1.8.25