github_api 0.9.2 → 0.9.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,35 @@
1
+ Feature: Github API arguments parsing
2
+
3
+ The gem permits flexible arguments parsing, which means, the arguments can
4
+ be passed in as values or named hash key parameters. Properties are dynamically
5
+ assigned when executing requests.
6
+
7
+ Scenario: Invoking multiple calls for organization information
8
+
9
+ Given I have "Github::Orgs" instance
10
+ When I want to get resource with the following arguments:
11
+ | org |
12
+ | thoughtbot |
13
+ And I make request within a cassette named "arguments/orgs/get"
14
+ And I make request within a cassette named "arguments/orgs/get"
15
+ Then the response status should be 200
16
+
17
+ Scenario: Invoking multiple calls for repository commits
18
+
19
+ Given I have "Github::Repos::Commits" instance
20
+ When I want to get resource with the following arguments:
21
+ | user | repo | sha |
22
+ | rubinius | rubinius | 7ac2bd74e8b6f16362fb3b7e6f3d139c48bb1c12 |
23
+ And I make request within a cassette named "arguments/repo_commits/get"
24
+ And I make request within a cassette named "arguments/repo_commits/get"
25
+ Then the response status should be 200
26
+
27
+ Scenario: Invoking multiple calls for fetching pull request
28
+
29
+ Given I have "Github::PullRequests" instance
30
+ When I want to get resource with the following arguments:
31
+ | user | repo | number |
32
+ | rubinius | rubinius | 2193 |
33
+ And I make request within a cassette named "arguments/pulls/get"
34
+ And I make request within a cassette named "arguments/pulls/get"
35
+ Then the response status should be 200
@@ -0,0 +1,69 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://<BASIC_AUTH>@api.github.com/orgs/thoughtbot?access_token=<TOKEN>
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - application/vnd.github.v3.full+json,application/vnd.github.beta.full+json;q=0.7,application/vnd.github+json;q=0.5,application/json;q=0.1
12
+ Accept-Charset:
13
+ - utf-8
14
+ User-Agent:
15
+ - Github Ruby Gem 0.9.2
16
+ Content-Type:
17
+ - application/json
18
+ Accept-Encoding:
19
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Server:
26
+ - GitHub.com
27
+ Date:
28
+ - Sat, 09 Mar 2013 15:31:09 GMT
29
+ Content-Type:
30
+ - application/json; charset=utf-8
31
+ Transfer-Encoding:
32
+ - chunked
33
+ Connection:
34
+ - keep-alive
35
+ Status:
36
+ - 200 OK
37
+ X-Ratelimit-Limit:
38
+ - '5000'
39
+ X-Ratelimit-Remaining:
40
+ - '4998'
41
+ Vary:
42
+ - Accept, Authorization, Cookie
43
+ Cache-Control:
44
+ - private, max-age=60, s-maxage=60
45
+ Last-Modified:
46
+ - Sat, 09 Mar 2013 14:37:58 GMT
47
+ Etag:
48
+ - ! '"ee447f8914b401051d8b55170da404a9"'
49
+ X-Github-Media-Type:
50
+ - github.v3; param=full; format=json
51
+ X-Content-Type-Options:
52
+ - nosniff
53
+ Content-Encoding:
54
+ - gzip
55
+ body:
56
+ encoding: ASCII-8BIT
57
+ string: !binary |-
58
+ H4sIAAAAAAAAA52SP0/DMBDFvwqyxJY4zp+2iSWExMDK0omlujjGtXDsyHZA
59
+ pep359q0kLIVKcNF53c+v/fbE+OUtoSTuHWj2sbWRZIQ3RG+zOsyIaM32NzG
60
+ OASeZTBoqnTcji0Vrs+cVyG7Eno5uLC5RZSdJHin/JA23qidNCjuZd9Kf6P6
61
+ LNpnU3HAOcPYGi02/xp3rZ1PhQ+I4P/YEqQYvaTKT92ToVOZQbMAVnVvRQdy
62
+ ycpmJcpaNG3HqqopxKJ87B5+EimqmkoK79CDplbGDEKQMcxiui+edQ9KBiwu
63
+ t83rFGNMq4LRwSq0wEIvr3hI7rQVFDu44QB2R7gdjUlIi+ic2UA0vEN0Av2l
64
+ 4fggFBknIGp3ROzJhYgFRo27IlbTmLNtEwZ8ufwJQekQA+GrepGQN2eM+8SE
65
+ Cc8vfxrX5SxBOHvzx9sZo1d4Ci8hym4DEdcpGKtTVqU5W+c1Z4wX7BWXG4du
66
+ fiYvU4Zfs84rXq74oj6eibvh6NGLV2D11/S+wzcEdtvNTAMAAA==
67
+ http_version: !!null
68
+ recorded_at: Sat, 09 Mar 2013 15:31:10 GMT
69
+ recorded_with: VCR 2.4.0
@@ -0,0 +1,112 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://<BASIC_AUTH>@api.github.com/repos/rubinius/rubinius/pulls/2193?access_token=<TOKEN>
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - application/vnd.github.v3.full+json,application/vnd.github.beta.full+json;q=0.7,application/vnd.github+json;q=0.5,application/json;q=0.1
12
+ Accept-Charset:
13
+ - utf-8
14
+ User-Agent:
15
+ - Github Ruby Gem 0.9.2
16
+ Content-Type:
17
+ - application/json
18
+ Accept-Encoding:
19
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Server:
26
+ - GitHub.com
27
+ Date:
28
+ - Sat, 09 Mar 2013 17:49:33 GMT
29
+ Content-Type:
30
+ - application/json; charset=utf-8
31
+ Transfer-Encoding:
32
+ - chunked
33
+ Connection:
34
+ - keep-alive
35
+ Status:
36
+ - 200 OK
37
+ X-Ratelimit-Limit:
38
+ - '5000'
39
+ X-Ratelimit-Remaining:
40
+ - '4998'
41
+ Vary:
42
+ - Accept, Authorization, Cookie
43
+ Cache-Control:
44
+ - private, max-age=60, s-maxage=60
45
+ Last-Modified:
46
+ - Sat, 09 Mar 2013 07:32:16 GMT
47
+ Etag:
48
+ - ! '"31ec316b758b2e5c24ddacee5fd26999"'
49
+ X-Github-Media-Type:
50
+ - github.v3; param=full; format=json
51
+ X-Content-Type-Options:
52
+ - nosniff
53
+ Content-Encoding:
54
+ - gzip
55
+ body:
56
+ encoding: ASCII-8BIT
57
+ string: !binary |-
58
+ H4sIAAAAAAAAA+2bW4+rOBLHv0qEtE+TDuaSkKDZuWi1K83Dalars/swL5EB
59
+ k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VHExdco8IXaEodPxBLWXsBb95AcgkRajGlKfO31/XfJrNVB
109
+ EDcAAA==
110
+ http_version: !!null
111
+ recorded_at: Sat, 09 Mar 2013 17:49:33 GMT
112
+ recorded_with: VCR 2.4.0
@@ -0,0 +1,89 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://<BASIC_AUTH>@api.github.com/repos/rubinius/rubinius/commits/7ac2bd74e8b6f16362fb3b7e6f3d139c48bb1c12?access_token=<TOKEN>
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - application/vnd.github.v3.full+json,application/vnd.github.beta.full+json;q=0.7,application/vnd.github+json;q=0.5,application/json;q=0.1
12
+ Accept-Charset:
13
+ - utf-8
14
+ User-Agent:
15
+ - Github Ruby Gem 0.9.2
16
+ Content-Type:
17
+ - application/json
18
+ Accept-Encoding:
19
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Server:
26
+ - GitHub.com
27
+ Date:
28
+ - Sat, 09 Mar 2013 17:40:08 GMT
29
+ Content-Type:
30
+ - application/json; charset=utf-8
31
+ Transfer-Encoding:
32
+ - chunked
33
+ Connection:
34
+ - keep-alive
35
+ Status:
36
+ - 200 OK
37
+ X-Ratelimit-Limit:
38
+ - '5000'
39
+ X-Ratelimit-Remaining:
40
+ - '4999'
41
+ Vary:
42
+ - Accept, Authorization, Cookie
43
+ Cache-Control:
44
+ - private, max-age=60, s-maxage=60
45
+ Last-Modified:
46
+ - Fri, 08 Mar 2013 14:43:46 GMT
47
+ Etag:
48
+ - ! '"704fbf54f76c483a606a9d0d0709debc"'
49
+ X-Github-Media-Type:
50
+ - github.v3; param=full; format=json
51
+ X-Content-Type-Options:
52
+ - nosniff
53
+ Content-Encoding:
54
+ - gzip
55
+ body:
56
+ encoding: ASCII-8BIT
57
+ string: !binary |-
58
+ H4sIAAAAAAAAA+1X/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rUtu3Yh9aLSxLQ2t1
75
+ fz01o4JNFOM4qVomN+M8RxOdT4HuDZTILGWg1ewT+aCuH1OOuqPKPJpk0ePn
76
+ /reSV9s/W4Caj+Us6M06QdH8x2PGGVffP+Aek/oL9L+X9EZAuruGLM+pisc4
77
+ ZXt7ZMe1Ww3bJa/0r+OSvb0LTvQf44qAEGSXZJyNQg43Wy/VmMmdP8pnvLzR
78
+ BkFHDQI8aZAsV5K8JKcfPh6dDsKT3tl7/SFukNPB0WF49nnwsfcpHJ7vf26Q
79
+ l+g2ZDzNtl9jrEW4dEtH+223AgxOhye9420yu+A7ZTrk/GBMRZWLxkdF+qV0
80
+ fYJ++8Ph6TA86Z+d9Q774XF/cImeaxzSTehCSsSwf9j/9CEsgU+ByhIRlAm8
81
+ uiQQqiyUSmwtXmtfWJ4QD4qpQ0qOgoSrsqLK9Mm4DXJhvJBd8kJeGNjIOnQF
82
+ xAbXXap997/GUOq8brdahlWaW3oZQpmTBmpMDRCgCsGJhW9eVZ1k6dZxb3B4
83
+ rntlB2F/0Ns/7r+tPGyXLa8NCTFNUt2My6uvGoOeU1znfESytHzGBPGKfv+e
84
+ PAYBK04Qgiyqej7Ae/PR4DAsb9F3KRGS4j0aRVvtPUSAEgWsWmh6/GQy1nXP
85
+ MfnVbj1CzGWX1qbmErkeOZewDem5xP/3BL3rFyHPp+gyoW9JinNQslX/1sNq
86
+ 95FZIWJY8L2m3/ZrY345/wc4lzd/zxIAAA==
87
+ http_version: !!null
88
+ recorded_at: Sat, 09 Mar 2013 17:40:08 GMT
89
+ recorded_with: VCR 2.4.0
@@ -34,7 +34,7 @@ When /^I want(?: to|) (.*) (?:resource|resources)$/ do |method|
34
34
  @method = method
35
35
  end
36
36
 
37
- When /^I want(?: to|) (.*) (?:resource|resources) with the following params:$/ do |method, table|
37
+ When /^I want(?: to|) (.*) (?:resource|resources) with the following (?:params|arguments):$/ do |method, table|
38
38
  table.hashes.each do |attributes|
39
39
  @method = method.to_sym
40
40
  @attributes = attributes
@@ -112,7 +112,7 @@ module Github
112
112
  end
113
113
 
114
114
  # Set an option to a given value
115
- def set(option, value=(not_set = true), &block)
115
+ def set(option, value=(not_set=true), ignore_setter=false, &block)
116
116
  raise ArgumentError, 'value not set' if block and !not_set
117
117
  return self if !not_set and value.nil?
118
118
 
@@ -121,7 +121,7 @@ module Github
121
121
  return self
122
122
  end
123
123
 
124
- if respond_to?("#{option}=")
124
+ if respond_to?("#{option}=") and not ignore_setter
125
125
  return __send__("#{option}=", value)
126
126
  end
127
127
 
@@ -141,7 +141,7 @@ module Github
141
141
  end
142
142
 
143
143
  def define_accessors(option, value)
144
- setter = proc { |val| set option, value }
144
+ setter = proc { |val| set option, val, true }
145
145
  getter = proc { value }
146
146
 
147
147
  define_singleton_method("#{option}=", setter) if setter
@@ -150,13 +150,13 @@ module Github
150
150
 
151
151
  # Dynamically define a method for setting request option
152
152
  #
153
- def define_singleton_method(name, content=Proc.new)
153
+ def define_singleton_method(method_name, content=Proc.new)
154
154
  (class << self; self; end).class_eval do
155
- undef_method(name) if method_defined? name
155
+ undef_method(method_name) if method_defined?(method_name)
156
156
  if String === content
157
- class_eval("def #{name}() #{content}; end")
157
+ class_eval("def #{method_name}() #{content}; end")
158
158
  else
159
- define_method(name, &content)
159
+ define_method(method_name, &content)
160
160
  end
161
161
  end
162
162
  end
@@ -4,7 +4,7 @@ module Github
4
4
  module VERSION
5
5
  MAJOR = 0
6
6
  MINOR = 9
7
- PATCH = 2
7
+ PATCH = 3
8
8
  BUILD = nil
9
9
 
10
10
  STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join('.');
@@ -0,0 +1,42 @@
1
+ # encoding: utf-8
2
+
3
+ require 'spec_helper'
4
+
5
+ describe Github, 'invocations' do
6
+
7
+ context 'repo commits with sha' do
8
+ let(:user) { "peter-murach" }
9
+ let(:repo) { "github" }
10
+ let(:sha) { "ceb66b61264657898cd6608c7e9ed78072169664" }
11
+
12
+ let(:request_path) { "/repos/#{user}/#{repo}/commits/#{sha}" }
13
+
14
+ before {
15
+ stub_get(request_path).to_return(:body => nil, :status => 200,
16
+ :headers => {:content_type => "application/json; charset=utf-8"})
17
+ }
18
+
19
+ it 'requests commit information twice' do
20
+ subject.repos.commits.get user, repo, sha
21
+ subject.repos.commits.get user, repo, sha
22
+ a_get(request_path).should have_been_made.times(2)
23
+ end
24
+ end
25
+
26
+ context 'organization info' do
27
+ let(:org) { "thoughtbot" }
28
+
29
+ let(:request_path) { "/orgs/#{org}" }
30
+
31
+ before {
32
+ stub_get(request_path).to_return(:body => nil, :status => 200,
33
+ :headers => {:content_type => "application/json; charset=utf-8"})
34
+ }
35
+
36
+ it 'requests organization information twice' do
37
+ subject.orgs.get org
38
+ subject.orgs.get org
39
+ a_get(request_path).should have_been_made.times(2)
40
+ end
41
+ end
42
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: github_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.2
4
+ version: 0.9.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: 2013-03-03 00:00:00.000000000Z
12
+ date: 2013-03-09 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: hashie
16
- requirement: &2155174360 !ruby/object:Gem::Requirement
16
+ requirement: &2155028260 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '2.0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2155174360
24
+ version_requirements: *2155028260
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: faraday
27
- requirement: &2155173860 !ruby/object:Gem::Requirement
27
+ requirement: &2155027760 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 0.8.1
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *2155173860
35
+ version_requirements: *2155027760
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: multi_json
38
- requirement: &2155173400 !ruby/object:Gem::Requirement
38
+ requirement: &2155027300 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '1.4'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *2155173400
46
+ version_requirements: *2155027300
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: oauth2
49
- requirement: &2155173020 !ruby/object:Gem::Requirement
49
+ requirement: &2155026920 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *2155173020
57
+ version_requirements: *2155026920
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: nokogiri
60
- requirement: &2155172480 !ruby/object:Gem::Requirement
60
+ requirement: &2155026380 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ~>
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: 1.5.2
66
66
  type: :runtime
67
67
  prerelease: false
68
- version_requirements: *2155172480
68
+ version_requirements: *2155026380
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rspec
71
- requirement: &2155171980 !ruby/object:Gem::Requirement
71
+ requirement: &2155025880 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: '0'
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *2155171980
79
+ version_requirements: *2155025880
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: cucumber
82
- requirement: &2155171520 !ruby/object:Gem::Requirement
82
+ requirement: &2155025420 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ! '>='
@@ -87,10 +87,10 @@ dependencies:
87
87
  version: '0'
88
88
  type: :development
89
89
  prerelease: false
90
- version_requirements: *2155171520
90
+ version_requirements: *2155025420
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: webmock
93
- requirement: &2155171060 !ruby/object:Gem::Requirement
93
+ requirement: &2155024960 !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
96
96
  - - ~>
@@ -98,10 +98,10 @@ dependencies:
98
98
  version: 1.9.0
99
99
  type: :development
100
100
  prerelease: false
101
- version_requirements: *2155171060
101
+ version_requirements: *2155024960
102
102
  - !ruby/object:Gem::Dependency
103
103
  name: vcr
104
- requirement: &2155170600 !ruby/object:Gem::Requirement
104
+ requirement: &2155024500 !ruby/object:Gem::Requirement
105
105
  none: false
106
106
  requirements:
107
107
  - - ~>
@@ -109,10 +109,10 @@ dependencies:
109
109
  version: 2.4.0
110
110
  type: :development
111
111
  prerelease: false
112
- version_requirements: *2155170600
112
+ version_requirements: *2155024500
113
113
  - !ruby/object:Gem::Dependency
114
114
  name: simplecov
115
- requirement: &2155170140 !ruby/object:Gem::Requirement
115
+ requirement: &2155024040 !ruby/object:Gem::Requirement
116
116
  none: false
117
117
  requirements:
118
118
  - - ~>
@@ -120,10 +120,10 @@ dependencies:
120
120
  version: 0.7.1
121
121
  type: :development
122
122
  prerelease: false
123
- version_requirements: *2155170140
123
+ version_requirements: *2155024040
124
124
  - !ruby/object:Gem::Dependency
125
125
  name: coveralls
126
- requirement: &2155169680 !ruby/object:Gem::Requirement
126
+ requirement: &2155023580 !ruby/object:Gem::Requirement
127
127
  none: false
128
128
  requirements:
129
129
  - - ~>
@@ -131,10 +131,10 @@ dependencies:
131
131
  version: 0.5.8
132
132
  type: :development
133
133
  prerelease: false
134
- version_requirements: *2155169680
134
+ version_requirements: *2155023580
135
135
  - !ruby/object:Gem::Dependency
136
136
  name: guard
137
- requirement: &2155169300 !ruby/object:Gem::Requirement
137
+ requirement: &2155023200 !ruby/object:Gem::Requirement
138
138
  none: false
139
139
  requirements:
140
140
  - - ! '>='
@@ -142,10 +142,10 @@ dependencies:
142
142
  version: '0'
143
143
  type: :development
144
144
  prerelease: false
145
- version_requirements: *2155169300
145
+ version_requirements: *2155023200
146
146
  - !ruby/object:Gem::Dependency
147
147
  name: guard-rspec
148
- requirement: &2155168840 !ruby/object:Gem::Requirement
148
+ requirement: &2155022740 !ruby/object:Gem::Requirement
149
149
  none: false
150
150
  requirements:
151
151
  - - ! '>='
@@ -153,10 +153,10 @@ dependencies:
153
153
  version: '0'
154
154
  type: :development
155
155
  prerelease: false
156
- version_requirements: *2155168840
156
+ version_requirements: *2155022740
157
157
  - !ruby/object:Gem::Dependency
158
158
  name: guard-cucumber
159
- requirement: &2155168420 !ruby/object:Gem::Requirement
159
+ requirement: &2155022320 !ruby/object:Gem::Requirement
160
160
  none: false
161
161
  requirements:
162
162
  - - ! '>='
@@ -164,10 +164,10 @@ dependencies:
164
164
  version: '0'
165
165
  type: :development
166
166
  prerelease: false
167
- version_requirements: *2155168420
167
+ version_requirements: *2155022320
168
168
  - !ruby/object:Gem::Dependency
169
169
  name: rake
170
- requirement: &2155168000 !ruby/object:Gem::Requirement
170
+ requirement: &2155021900 !ruby/object:Gem::Requirement
171
171
  none: false
172
172
  requirements:
173
173
  - - ! '>='
@@ -175,10 +175,10 @@ dependencies:
175
175
  version: '0'
176
176
  type: :development
177
177
  prerelease: false
178
- version_requirements: *2155168000
178
+ version_requirements: *2155021900
179
179
  - !ruby/object:Gem::Dependency
180
180
  name: bundler
181
- requirement: &2155167580 !ruby/object:Gem::Requirement
181
+ requirement: &2155021480 !ruby/object:Gem::Requirement
182
182
  none: false
183
183
  requirements:
184
184
  - - ! '>='
@@ -186,7 +186,7 @@ dependencies:
186
186
  version: '0'
187
187
  type: :development
188
188
  prerelease: false
189
- version_requirements: *2155167580
189
+ version_requirements: *2155021480
190
190
  description: ! ' Ruby wrapper that supports all of the GitHub API v3 methods(nearly
191
191
  200). It''s build in a modular way, that is, you can either instantiate the whole
192
192
  api wrapper Github.new or use parts of it e.i. Github::Repos.new if working solely
@@ -201,6 +201,7 @@ files:
201
201
  - features/activity/notifications.feature
202
202
  - features/activity/starring.feature
203
203
  - features/activity/watching.feature
204
+ - features/arguments_parsing.feature
204
205
  - features/auto_pagination.feature
205
206
  - features/cassettes/activity/events/issue.yml
206
207
  - features/cassettes/activity/events/network.yml
@@ -221,6 +222,9 @@ files:
221
222
  - features/cassettes/activity/watching/watch.yml
222
223
  - features/cassettes/activity/watching/watched.yml
223
224
  - features/cassettes/activity/watching/watching.yml
225
+ - features/cassettes/arguments/orgs/get.yml
226
+ - features/cassettes/arguments/pulls/get.yml
227
+ - features/cassettes/arguments/repo_commits/get.yml
224
228
  - features/cassettes/auto_pagination/repos/global_list.yml
225
229
  - features/cassettes/auto_pagination/repos/list.yml
226
230
  - features/cassettes/emojis/list.yml
@@ -822,6 +826,7 @@ files:
822
826
  - spec/integration/gists_spec.rb
823
827
  - spec/integration/git_data_spec.rb
824
828
  - spec/integration/issues_spec.rb
829
+ - spec/integration/multiple_invocations_spec.rb
825
830
  - spec/integration/options_spec.rb
826
831
  - spec/integration/orgs_spec.rb
827
832
  - spec/integration/pull_requests_spec.rb