groupdocs 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -104,7 +104,8 @@ module GroupDocs
104
104
  #
105
105
  def variable_to_accessor(variable)
106
106
  word = variable.to_s.delete(?@)
107
- word.gsub!(/[A-Z]/) { |letter| "_#{letter.downcase}" }
107
+ word.gsub!(/(?<=[a-z])[A-Z]/) { |match| "_#{match}" }
108
+ word.downcase!
108
109
  word.to_sym
109
110
  end
110
111
 
@@ -11,14 +11,16 @@ module GroupDocs
11
11
  attr_accessor :Height
12
12
 
13
13
  # Human-readable accessors
14
- alias_method :x, :X
15
- alias_method :x=, :X=
16
- alias_method :y, :Y
17
- alias_method :y=, :Y=
18
- alias_method :w, :Width
19
- alias_method :w=, :Width=
20
- alias_method :h, :Height
21
- alias_method :h=, :Height=
14
+ alias_method :x, :X
15
+ alias_method :x=, :X=
16
+ alias_method :y, :Y
17
+ alias_method :y=, :Y=
18
+ alias_method :w, :Width
19
+ alias_method :w=, :Width=
20
+ alias_method :width, :w
21
+ alias_method :h, :Height
22
+ alias_method :h=, :Height=
23
+ alias_method :height, :Height
22
24
 
23
25
  end # Document::Rectangle
24
26
  end # GroupDocs
@@ -174,20 +174,18 @@ module GroupDocs
174
174
  #
175
175
  # Returns an array of document fields.
176
176
  #
177
- # @param [Hash] options
178
- # @option options [Boolean] :include_geometry Set to true if fields location and size should be returned
179
177
  # @param [Hash] access Access credentials
180
178
  # @option access [String] :client_id
181
179
  # @option access [String] :private_key
182
180
  # @return [Array<GroupDocs::Document::Field>]
183
181
  #
184
- def fields!(options = {}, access = {})
182
+ def fields!(access = {})
185
183
  api = Api::Request.new do |request|
186
184
  request[:access] = access
187
185
  request[:method] = :GET
188
186
  request[:path] = "/doc/{{client_id}}/files/#{file.guid}/fields"
189
187
  end
190
- api.add_params(options)
188
+ api.add_params(include_geometry: true)
191
189
  json = api.execute!
192
190
 
193
191
  json[:fields].map do |field|
@@ -1,3 +1,3 @@
1
1
  module GroupDocs
2
- VERSION = '0.2.2'
2
+ VERSION = '0.2.3'
3
3
  end # GroupDocs
@@ -50,5 +50,9 @@ describe GroupDocs::Api::Entity do
50
50
  it 'converts instance variable symbol to accessor method symbol' do
51
51
  subject.send(:variable_to_accessor, :@test).should == :test
52
52
  end
53
+
54
+ it 'converts camelized words to underscored' do
55
+ subject.send(:variable_to_accessor, :@TestOneAndTWO).should == :test_one_and_two
56
+ end
53
57
  end
54
58
  end
@@ -20,15 +20,19 @@ describe GroupDocs::Document::Rectangle do
20
20
  subject.should respond_to(:y=)
21
21
  subject.should respond_to(:w)
22
22
  subject.should respond_to(:w=)
23
+ subject.should respond_to(:width)
23
24
  subject.should respond_to(:h)
24
25
  subject.should respond_to(:h=)
25
- subject.method(:x).should == subject.method(:X)
26
- subject.method(:x=).should == subject.method(:X=)
27
- subject.method(:y).should == subject.method(:Y)
28
- subject.method(:y=).should == subject.method(:Y=)
29
- subject.method(:w).should == subject.method(:Width)
30
- subject.method(:w=).should == subject.method(:Width=)
31
- subject.method(:h).should == subject.method(:Height)
32
- subject.method(:h=).should == subject.method(:Height=)
26
+ subject.should respond_to(:height)
27
+ subject.method(:x).should == subject.method(:X)
28
+ subject.method(:x=).should == subject.method(:X=)
29
+ subject.method(:y).should == subject.method(:Y)
30
+ subject.method(:y=).should == subject.method(:Y=)
31
+ subject.method(:w).should == subject.method(:Width)
32
+ subject.method(:w=).should == subject.method(:Width=)
33
+ subject.method(:width).should == subject.method(:w)
34
+ subject.method(:h).should == subject.method(:Height)
35
+ subject.method(:h=).should == subject.method(:Height=)
36
+ subject.method(:height).should == subject.method(:h)
33
37
  end
34
38
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: groupdocs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-05-14 00:00:00.000000000 Z
12
+ date: 2012-05-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rest-client
16
- requirement: &3414420 !ruby/object:Gem::Requirement
16
+ requirement: &6748580 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '1.6'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *3414420
24
+ version_requirements: *6748580
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: json
27
- requirement: &3428980 !ruby/object:Gem::Requirement
27
+ requirement: &6763480 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '1.7'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *3428980
35
+ version_requirements: *6763480
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: ruby-hmac
38
- requirement: &3427940 !ruby/object:Gem::Requirement
38
+ requirement: &6761660 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0.4'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *3427940
46
+ version_requirements: *6761660
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rspec
49
- requirement: &3426480 !ruby/object:Gem::Requirement
49
+ requirement: &6759960 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '2.9'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *3426480
57
+ version_requirements: *6759960
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: rake
60
- requirement: &3425060 !ruby/object:Gem::Requirement
60
+ requirement: &6759060 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ~>
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: '0.9'
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *3425060
68
+ version_requirements: *6759060
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: simplecov
71
- requirement: &3424140 !ruby/object:Gem::Requirement
71
+ requirement: &6758080 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ~>
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: '0.6'
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *3424140
79
+ version_requirements: *6758080
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: yard
82
- requirement: &3422980 !ruby/object:Gem::Requirement
82
+ requirement: &6756520 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ~>
@@ -87,10 +87,10 @@ dependencies:
87
87
  version: '0.8'
88
88
  type: :development
89
89
  prerelease: false
90
- version_requirements: *3422980
90
+ version_requirements: *6756520
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: webmock
93
- requirement: &3435360 !ruby/object:Gem::Requirement
93
+ requirement: &6769060 !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
96
96
  - - ~>
@@ -98,7 +98,7 @@ dependencies:
98
98
  version: '1.8'
99
99
  type: :development
100
100
  prerelease: false
101
- version_requirements: *3435360
101
+ version_requirements: *6769060
102
102
  description: Ruby SDK for GroupDocs REST API
103
103
  email: p0deje@gmail.com
104
104
  executables: []
@@ -253,7 +253,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
253
253
  version: '0'
254
254
  segments:
255
255
  - 0
256
- hash: -3645027829218934806
256
+ hash: 2726974365030193800
257
257
  required_rubygems_version: !ruby/object:Gem::Requirement
258
258
  none: false
259
259
  requirements:
@@ -262,7 +262,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
262
262
  version: '0'
263
263
  segments:
264
264
  - 0
265
- hash: -3645027829218934806
265
+ hash: 2726974365030193800
266
266
  requirements: []
267
267
  rubyforge_project:
268
268
  rubygems_version: 1.8.10