signet 0.3.4 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -12,6 +12,10 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
+ spec_dir = File.expand_path(File.join(File.dirname(__FILE__), "../../.."))
16
+ $:.unshift(spec_dir)
17
+ $:.uniq!
18
+
15
19
  require 'spec_helper'
16
20
 
17
21
  require 'signet/oauth_1/client'
@@ -203,7 +207,7 @@ describe Signet::OAuth1::Client, 'configured for standard Google APIs' do
203
207
  @client.token_credential_secret = 'Ew3YHAY4bcBryiOUvbdHGa57'
204
208
  response = @client.fetch_protected_resource(
205
209
  :connection => connection,
206
- :request => Faraday::Request.create(:get) do |req|
210
+ :request => Faraday.default_connection.build_request(:get) do |req|
207
211
  req.url(
208
212
  'http://www-opensocial.googleusercontent.com/api/people/@me/@self'
209
213
  )
@@ -12,6 +12,10 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
+ spec_dir = File.expand_path(File.join(File.dirname(__FILE__), "../../.."))
16
+ $:.unshift(spec_dir)
17
+ $:.uniq!
18
+
15
19
  require 'spec_helper'
16
20
 
17
21
  require 'signet'
@@ -12,6 +12,10 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
+ spec_dir = File.expand_path(File.join(File.dirname(__FILE__), ".."))
16
+ $:.unshift(spec_dir)
17
+ $:.uniq!
18
+
15
19
  require 'spec_helper'
16
20
 
17
21
  require 'signet/oauth_1'
@@ -12,6 +12,10 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
+ spec_dir = File.expand_path(File.join(File.dirname(__FILE__), "../.."))
16
+ $:.unshift(spec_dir)
17
+ $:.uniq!
18
+
15
19
  require 'spec_helper'
16
20
 
17
21
  require 'signet/oauth_2/client'
@@ -20,6 +24,8 @@ require 'openssl'
20
24
  gem 'jwt', '~> 0.1.4'
21
25
  require 'jwt'
22
26
 
27
+ conn = Faraday.default_connection
28
+
23
29
  describe Signet::OAuth2::Client, 'unconfigured' do
24
30
  before do
25
31
  @client = Signet::OAuth2::Client.new
@@ -429,7 +435,7 @@ JSON
429
435
  request = @client.generate_authenticated_request(
430
436
  :connection => connection,
431
437
  :realm => 'Example',
432
- :request => Faraday::Request.create(:get) do |req|
438
+ :request => conn.build_request(:get) do |req|
433
439
  req.url('https://www.googleapis.com/oauth2/v1/userinfo?alt=json')
434
440
  end
435
441
  )
@@ -461,14 +467,12 @@ JSON
461
467
  @client.client_id = 'client-12345'
462
468
  @client.client_secret = 'secret-12345'
463
469
  @client.access_token = '12345'
464
- (lambda do
465
- @client.generate_authenticated_request(
466
- :realm => 'Example',
467
- :request => Faraday::Request.create(:get) do |req|
468
- req.url('https://www.googleapis.com/oauth2/v1/userinfo?alt=json')
469
- end
470
- )
471
- end).should_not raise_error
470
+ request = @client.generate_authenticated_request(
471
+ :realm => 'Example',
472
+ :request => conn.build_request(:get) do |req|
473
+ req.url('https://www.googleapis.com/oauth2/v1/userinfo?alt=json')
474
+ end
475
+ )
472
476
  end
473
477
 
474
478
  it 'should raise an error if not enough information ' +
@@ -12,6 +12,10 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
+ spec_dir = File.expand_path(File.join(File.dirname(__FILE__), ".."))
16
+ $:.unshift(spec_dir)
17
+ $:.uniq!
18
+
15
19
  require 'spec_helper'
16
20
 
17
21
  require 'signet/oauth_2'
data/spec/signet_spec.rb CHANGED
@@ -12,6 +12,10 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
+ spec_dir = File.expand_path(File.join(File.dirname(__FILE__)))
16
+ $:.unshift(spec_dir)
17
+ $:.uniq!
18
+
15
19
  require 'spec_helper'
16
20
 
17
21
  require 'signet/oauth_2'
data/spec/spec.opts CHANGED
@@ -1,2 +1,2 @@
1
1
  --colour
2
- --format specdoc
2
+ --format documentation
data/spec/spec_helper.rb CHANGED
@@ -3,9 +3,11 @@ root_dir = File.expand_path(File.join(spec_dir, ".."))
3
3
  lib_dir = File.expand_path(File.join(root_dir, "lib"))
4
4
  compat_dir = File.expand_path(File.join(spec_dir, "force_compat"))
5
5
 
6
+ $:.unshift(spec_dir)
6
7
  $:.unshift(lib_dir)
7
8
  $:.unshift(compat_dir)
8
9
  $:.uniq!
9
10
 
10
11
  require 'rubygems'
11
12
  require 'signet'
13
+ require 'rspec'
data/tasks/gem.rake CHANGED
@@ -21,14 +21,14 @@ namespace :gem do
21
21
  s.extra_rdoc_files = %w( README.md )
22
22
  s.rdoc_options.concat ["--main", "README.md"]
23
23
 
24
- s.add_runtime_dependency("addressable", "~> 2.2.3")
25
- s.add_runtime_dependency("faraday", "~> 0.7.0")
24
+ s.add_runtime_dependency("addressable", ">= 2.2.3")
25
+ s.add_runtime_dependency("faraday", "~> 0.8.1")
26
26
  s.add_runtime_dependency("multi_json", ">= 1.0.0")
27
- s.add_runtime_dependency("jwt", ">= 0.1.4")
27
+ s.add_runtime_dependency("jwt", ">= 0.1.5")
28
28
 
29
- s.add_development_dependency("rake", "~> 0.8.3")
30
- s.add_development_dependency("rspec", "~> 1.1.11")
31
- s.add_development_dependency("launchy", "~> 2.0.0")
29
+ s.add_development_dependency("rake", ">= 0.9.0")
30
+ s.add_development_dependency("rspec", ">= 2.11.0")
31
+ s.add_development_dependency("launchy", ">= 2.0.0")
32
32
 
33
33
  s.require_path = "lib"
34
34
  end
data/tasks/spec.rake CHANGED
@@ -1,78 +1,59 @@
1
- require 'spec/rake/verify_rcov'
1
+ require 'rspec/core/rake_task'
2
+ require 'rake/clean'
3
+
4
+ CLOBBER.include('coverage', 'specdoc')
2
5
 
3
6
  namespace :spec do
4
- Spec::Rake::SpecTask.new(:rcov) do |t|
5
- t.spec_files = FileList['spec/**/*_spec.rb']
6
- t.spec_opts = ['--color', '--format', 'specdoc']
7
- if RCOV_ENABLED
8
- if `which rcov`.strip == ""
9
- STDERR.puts "Please install rcov:"
10
- STDERR.puts "sudo gem install relevance-rcov"
11
- exit(1)
12
- end
13
- t.rcov = true
14
- else
15
- t.rcov = false
16
- end
7
+ RSpec::Core::RakeTask.new(:rcov) do |t|
8
+ t.pattern = FileList['spec/**/*_spec.rb']
9
+ t.rspec_opts = ['--color', '--format', 'documentation']
10
+
11
+ t.rcov = RCOV_ENABLED
17
12
  t.rcov_opts = [
18
13
  '--exclude', 'lib\\/compat',
19
- '--exclude', 'lib\\/signet\\/ssl_config\\.rb',
20
14
  '--exclude', 'spec',
21
15
  '--exclude', '\\.rvm\\/gems',
22
16
  '--exclude', '1\\.8\\/gems',
23
17
  '--exclude', '1\\.9\\/gems',
24
18
  '--exclude', '\\.rvm',
25
- '--exclude', '\\/Library\\/Ruby'
19
+ '--exclude', '\\/Library\\/Ruby',
20
+ '--exclude', 'addressable\\/idna' # environment dependant
26
21
  ]
27
22
  end
28
23
 
29
- Spec::Rake::SpecTask.new(:normal) do |t|
30
- t.spec_files = FileList['spec/**/*_spec.rb']
31
- t.spec_opts = ['--color', '--format', 'specdoc']
24
+ RSpec::Core::RakeTask.new(:normal) do |t|
25
+ t.pattern = FileList['spec/**/*_spec.rb'].exclude(/compat/)
26
+ t.rspec_opts = ['--color', '--format', 'documentation']
32
27
  t.rcov = false
33
28
  end
34
29
 
35
- if RCOV_ENABLED
36
- RCov::VerifyTask.new(:verify) do |t|
37
- t.threshold = 100.0
38
- t.index_html = 'coverage/index.html'
39
- end
40
-
41
- task :verify => :rcov
30
+ RSpec::Core::RakeTask.new(:all) do |t|
31
+ t.pattern = FileList['spec/**/*_spec.rb']
32
+ t.rspec_opts = ['--color', '--format', 'documentation']
33
+ t.rcov = false
42
34
  end
43
35
 
44
36
  desc "Generate HTML Specdocs for all specs"
45
- Spec::Rake::SpecTask.new(:specdoc) do |t|
37
+ RSpec::Core::RakeTask.new(:specdoc) do |t|
46
38
  specdoc_path = File.expand_path(
47
- File.join(File.dirname(__FILE__), '../specdoc/'))
39
+ File.join(File.dirname(__FILE__), '..', 'documentation')
40
+ )
48
41
  Dir.mkdir(specdoc_path) if !File.exist?(specdoc_path)
49
42
 
50
43
  output_file = File.join(specdoc_path, 'index.html')
51
- t.spec_files = FileList['spec/**/*_spec.rb']
52
- t.spec_opts = ["--format", "\"html:#{output_file}\"", "--diff"]
44
+ t.pattern = FileList['spec/**/*_spec.rb']
45
+ t.rspec_opts = ["--format", "\"html:#{output_file}\"", "--diff"]
53
46
  t.fail_on_error = false
54
47
  end
55
48
 
56
49
  namespace :rcov do
57
50
  desc "Browse the code coverage report."
58
51
  task :browse => "spec:rcov" do
59
- coverage_path = File.expand_path(
60
- File.join(File.dirname(__FILE__), '../coverage/'))
61
52
  require "launchy"
62
- require "addressable/uri"
63
- Launchy.open(
64
- Addressable::URI.convert_path(File.join(coverage_path, "index.html"))
65
- )
53
+ Launchy::Browser.run("coverage/index.html")
66
54
  end
67
55
  end
68
56
  end
69
57
 
70
- if RCOV_ENABLED
71
- desc "Alias to spec:verify"
72
- task "spec" => "spec:verify"
73
- else
74
- desc "Alias to spec:normal"
75
- task "spec" => "spec:normal"
76
- end
77
-
78
- task "clobber" => ["spec:clobber_rcov"]
58
+ desc "Alias to spec:normal"
59
+ task "spec" => "spec:normal"
data/tasks/yard.rake CHANGED
@@ -1,26 +1,20 @@
1
- require 'rake'
1
+ require 'rake/clean'
2
2
 
3
- begin
4
- require 'yard'
5
- require 'yard/rake/yardoc_task'
3
+ CLOBBER.include('doc')
6
4
 
7
- namespace :doc do
8
- desc 'Generate Yardoc documentation'
9
- YARD::Rake::YardocTask.new do |yardoc|
10
- yardoc.name = 'yard'
11
- yardoc.options = ['--verbose', '--markup', 'markdown']
12
- yardoc.files = [
13
- 'lib/**/*.rb', 'ext/**/*.c', 'README.md', 'CHANGELOG.md', 'LICENSE'
14
- ]
15
- end
16
- end
17
-
18
- task 'clobber' => ['doc:clobber_yard']
5
+ require 'yard'
6
+ require 'yard/rake/yardoc_task'
19
7
 
20
- desc 'Alias to doc:yard'
21
- task 'doc' => 'doc:yard'
22
- rescue LoadError
23
- # If yard isn't available, it's not the end of the world
24
- desc 'Alias to doc:rdoc'
25
- task 'doc' => 'doc:rdoc'
8
+ namespace :doc do
9
+ desc 'Generate Yardoc documentation'
10
+ YARD::Rake::YardocTask.new do |yardoc|
11
+ yardoc.name = 'yard'
12
+ yardoc.options = ['--verbose', '--markup', 'markdown']
13
+ yardoc.files = [
14
+ 'lib/**/*.rb', 'ext/**/*.c', 'README.md', 'CHANGELOG.md', 'LICENSE'
15
+ ]
16
+ end
26
17
  end
18
+
19
+ desc 'Alias to doc:yard'
20
+ task 'doc' => 'doc:yard'
metadata CHANGED
@@ -1,107 +1,151 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: signet
3
- version: !ruby/object:Gem::Version
4
- version: 0.3.4
3
+ version: !ruby/object:Gem::Version
4
+ hash: 15
5
5
  prerelease:
6
+ segments:
7
+ - 0
8
+ - 4
9
+ - 0
10
+ version: 0.4.0
6
11
  platform: ruby
7
- authors:
12
+ authors:
8
13
  - Bob Aman
9
14
  autorequire:
10
15
  bindir: bin
11
16
  cert_chain: []
12
- date: 2012-05-24 00:00:00.000000000 Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
17
+
18
+ date: 2012-07-21 00:00:00 Z
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
15
21
  name: addressable
16
- requirement: &2156909880 !ruby/object:Gem::Requirement
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
17
24
  none: false
18
- requirements:
19
- - - ~>
20
- - !ruby/object:Gem::Version
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ hash: 1
29
+ segments:
30
+ - 2
31
+ - 2
32
+ - 3
21
33
  version: 2.2.3
22
34
  type: :runtime
23
- prerelease: false
24
- version_requirements: *2156909880
25
- - !ruby/object:Gem::Dependency
35
+ version_requirements: *id001
36
+ - !ruby/object:Gem::Dependency
26
37
  name: faraday
27
- requirement: &2156909220 !ruby/object:Gem::Requirement
38
+ prerelease: false
39
+ requirement: &id002 !ruby/object:Gem::Requirement
28
40
  none: false
29
- requirements:
41
+ requirements:
30
42
  - - ~>
31
- - !ruby/object:Gem::Version
32
- version: 0.7.0
43
+ - !ruby/object:Gem::Version
44
+ hash: 61
45
+ segments:
46
+ - 0
47
+ - 8
48
+ - 1
49
+ version: 0.8.1
33
50
  type: :runtime
34
- prerelease: false
35
- version_requirements: *2156909220
36
- - !ruby/object:Gem::Dependency
51
+ version_requirements: *id002
52
+ - !ruby/object:Gem::Dependency
37
53
  name: multi_json
38
- requirement: &2156908540 !ruby/object:Gem::Requirement
54
+ prerelease: false
55
+ requirement: &id003 !ruby/object:Gem::Requirement
39
56
  none: false
40
- requirements:
41
- - - ! '>='
42
- - !ruby/object:Gem::Version
57
+ requirements:
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ hash: 23
61
+ segments:
62
+ - 1
63
+ - 0
64
+ - 0
43
65
  version: 1.0.0
44
66
  type: :runtime
45
- prerelease: false
46
- version_requirements: *2156908540
47
- - !ruby/object:Gem::Dependency
67
+ version_requirements: *id003
68
+ - !ruby/object:Gem::Dependency
48
69
  name: jwt
49
- requirement: &2156907900 !ruby/object:Gem::Requirement
70
+ prerelease: false
71
+ requirement: &id004 !ruby/object:Gem::Requirement
50
72
  none: false
51
- requirements:
52
- - - ! '>='
53
- - !ruby/object:Gem::Version
54
- version: 0.1.4
73
+ requirements:
74
+ - - ">="
75
+ - !ruby/object:Gem::Version
76
+ hash: 17
77
+ segments:
78
+ - 0
79
+ - 1
80
+ - 5
81
+ version: 0.1.5
55
82
  type: :runtime
56
- prerelease: false
57
- version_requirements: *2156907900
58
- - !ruby/object:Gem::Dependency
83
+ version_requirements: *id004
84
+ - !ruby/object:Gem::Dependency
59
85
  name: rake
60
- requirement: &2156907300 !ruby/object:Gem::Requirement
86
+ prerelease: false
87
+ requirement: &id005 !ruby/object:Gem::Requirement
61
88
  none: false
62
- requirements:
63
- - - ~>
64
- - !ruby/object:Gem::Version
65
- version: 0.8.3
89
+ requirements:
90
+ - - ">="
91
+ - !ruby/object:Gem::Version
92
+ hash: 59
93
+ segments:
94
+ - 0
95
+ - 9
96
+ - 0
97
+ version: 0.9.0
66
98
  type: :development
67
- prerelease: false
68
- version_requirements: *2156907300
69
- - !ruby/object:Gem::Dependency
99
+ version_requirements: *id005
100
+ - !ruby/object:Gem::Dependency
70
101
  name: rspec
71
- requirement: &2156906600 !ruby/object:Gem::Requirement
102
+ prerelease: false
103
+ requirement: &id006 !ruby/object:Gem::Requirement
72
104
  none: false
73
- requirements:
74
- - - ~>
75
- - !ruby/object:Gem::Version
76
- version: 1.1.11
105
+ requirements:
106
+ - - ">="
107
+ - !ruby/object:Gem::Version
108
+ hash: 35
109
+ segments:
110
+ - 2
111
+ - 11
112
+ - 0
113
+ version: 2.11.0
77
114
  type: :development
78
- prerelease: false
79
- version_requirements: *2156906600
80
- - !ruby/object:Gem::Dependency
115
+ version_requirements: *id006
116
+ - !ruby/object:Gem::Dependency
81
117
  name: launchy
82
- requirement: &2156905940 !ruby/object:Gem::Requirement
118
+ prerelease: false
119
+ requirement: &id007 !ruby/object:Gem::Requirement
83
120
  none: false
84
- requirements:
85
- - - ~>
86
- - !ruby/object:Gem::Version
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ hash: 15
125
+ segments:
126
+ - 2
127
+ - 0
128
+ - 0
87
129
  version: 2.0.0
88
130
  type: :development
89
- prerelease: false
90
- version_requirements: *2156905940
91
- description: ! 'Signet is an OAuth 1.0 / OAuth 2.0 implementation.
131
+ version_requirements: *id007
132
+ description: |
133
+ Signet is an OAuth 1.0 / OAuth 2.0 implementation.
92
134
 
93
- '
94
135
  email: bobaman@google.com
95
136
  executables: []
137
+
96
138
  extensions: []
97
- extra_rdoc_files:
139
+
140
+ extra_rdoc_files:
98
141
  - README.md
99
- files:
142
+ files:
100
143
  - lib/compat/digest/hmac.rb
101
144
  - lib/compat/securerandom.rb
102
145
  - lib/signet/errors.rb
103
146
  - lib/signet/oauth_1/client.rb
104
147
  - lib/signet/oauth_1/credential.rb
148
+ - lib/signet/oauth_1/server.rb
105
149
  - lib/signet/oauth_1/signature_methods/hmac_sha1.rb
106
150
  - lib/signet/oauth_1.rb
107
151
  - lib/signet/oauth_2/client.rb
@@ -113,6 +157,7 @@ files:
113
157
  - spec/force_compat/securerandom.rb
114
158
  - spec/signet/oauth_1/client_spec.rb
115
159
  - spec/signet/oauth_1/credential_spec.rb
160
+ - spec/signet/oauth_1/server_spec.rb
116
161
  - spec/signet/oauth_1/services/google_spec.rb
117
162
  - spec/signet/oauth_1/signature_methods/hmac_sha1_spec.rb
118
163
  - spec/signet/oauth_1_spec.rb
@@ -137,28 +182,37 @@ files:
137
182
  - README.md
138
183
  homepage: http://code.google.com/p/oauth-signet/
139
184
  licenses: []
185
+
140
186
  post_install_message:
141
- rdoc_options:
187
+ rdoc_options:
142
188
  - --main
143
189
  - README.md
144
- require_paths:
190
+ require_paths:
145
191
  - lib
146
- required_ruby_version: !ruby/object:Gem::Requirement
192
+ required_ruby_version: !ruby/object:Gem::Requirement
147
193
  none: false
148
- requirements:
149
- - - ! '>='
150
- - !ruby/object:Gem::Version
151
- version: '0'
152
- required_rubygems_version: !ruby/object:Gem::Requirement
194
+ requirements:
195
+ - - ">="
196
+ - !ruby/object:Gem::Version
197
+ hash: 3
198
+ segments:
199
+ - 0
200
+ version: "0"
201
+ required_rubygems_version: !ruby/object:Gem::Requirement
153
202
  none: false
154
- requirements:
155
- - - ! '>='
156
- - !ruby/object:Gem::Version
157
- version: '0'
203
+ requirements:
204
+ - - ">="
205
+ - !ruby/object:Gem::Version
206
+ hash: 3
207
+ segments:
208
+ - 0
209
+ version: "0"
158
210
  requirements: []
211
+
159
212
  rubyforge_project:
160
- rubygems_version: 1.8.15
213
+ rubygems_version: 1.8.24
161
214
  signing_key:
162
215
  specification_version: 3
163
216
  summary: Package Summary
164
217
  test_files: []
218
+