rest-more 3.3.4 → 3.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ab435e1b0b7117a382c7428c0225a6d2f97f79d2
4
- data.tar.gz: 676394586c1415ac9650a032f410b47571594816
3
+ metadata.gz: c6890c9728c71859155f4faa86e8222567d4ea7e
4
+ data.tar.gz: 9c709ac13ba18a68c0d0b0c5436e17b39374f77d
5
5
  SHA512:
6
- metadata.gz: 66932c197c76174e7686fdbd34b6489c230f91442d64cb176adff5965b326cc924d9380967b9b330a52054e5e7d925a2ded9579ad9c236f9573540dc95d1a10d
7
- data.tar.gz: ed2ead251cbd3828c83b2ddd2fe8f3271b7478bab361e808f699ca543c1721e6ff4403ff6fa6b9e65ae3a333baf8674e74b95f237289111c6e527911fe6d3843
6
+ metadata.gz: 11e56fe43e2e321e788c527107275acbc69e44f0b17e4e18f4016a4c3acc4fa6a6bd50f43a4610976f661252443ee458d55118b84339d0ca28d0a59f250e3ead
7
+ data.tar.gz: a6a80e43e0553914b5e6365ebc024e6168e50e0124c0fa29bac360958d74ab0f022f1d9b556074c5dda0bf0a49cc5cb13f82668201e2e5504ecf0e62eb3faed8
@@ -1,14 +1,17 @@
1
-
1
+ sudo: false
2
2
  language: ruby
3
3
  rvm:
4
- - 2.0
5
- - 2.1
6
4
  - 2.2
7
- - rbx-2
8
- - jruby
5
+ - 2.3.0
6
+ - rbx
7
+ - jruby-9
9
8
 
9
+ before_install:
10
+ - rvm get head
11
+ - rvm reload
12
+ - rvm use --install $TRAVIS_RUBY_VERSION --binary --latest
10
13
  install: 'bundle install --retry=3'
11
- script: 'ruby -r bundler/setup -S rake test:travis'
14
+ script: 'ruby -vr bundler/setup -S rake test:travis'
12
15
 
13
16
  env:
14
17
  - 'RESTMORE=rest-more'
@@ -18,3 +21,5 @@ matrix:
18
21
  allow_failures:
19
22
  - rvm: 2.2
20
23
  env: 'RESTMORE=rails3'
24
+ - rvm: 2.3.0
25
+ env: 'RESTMORE=rails3'
data/CHANGES.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # CHANGES
2
2
 
3
+ ## rest-more 3.4.0 -- 2016-02-04
4
+
5
+ * `RC::Github` would now follow redirect for 5 times by default.
6
+ * `RestCore::Github::Error::ClientError` was never used and removed.
7
+ * `RestCore::Github::Error::ServerError` was also removed and favouring
8
+ just `RestCore::Github::Error`.
9
+ * Adopt rest-core 4.0.0
10
+
3
11
  ## rest-more 3.3.4 -- 2015-10-15
4
12
 
5
13
  * [`Dropbox`] Updated content API server. Thanks khoa nguyen (@khoan)
data/Rakefile CHANGED
@@ -2,19 +2,20 @@
2
2
  begin
3
3
  require "#{dir = File.dirname(__FILE__)}/task/gemgem"
4
4
  rescue LoadError
5
- sh 'git submodule update --init'
5
+ sh 'git submodule update --init --recursive'
6
6
  exec Gem.ruby, '-S', $PROGRAM_NAME, *ARGV
7
7
  end
8
8
 
9
- $LOAD_PATH.unshift(File.expand_path("#{dir}/rest-core/lib"))
9
+ %w[lib rest-builder/lib rest-builder/promise_pool/lib].each do |path|
10
+ $LOAD_PATH.unshift(File.expand_path("#{dir}/rest-core/#{path}"))
11
+ end
10
12
 
11
13
  Gemgem.init(dir) do |s|
12
14
  require 'rest-more/version'
13
- s.name = 'rest-more'
14
- s.version = RestMore::VERSION
15
- s.homepage = 'https://github.com/godfat/rest-more'
15
+ s.name = 'rest-more'
16
+ s.version = RestMore::VERSION
16
17
 
17
- %w[rest-core].each{ |g| s.add_runtime_dependency(g, '>=3.3.0') }
18
+ %w[rest-core].each{ |g| s.add_runtime_dependency(g, '>=4.0.0') }
18
19
 
19
20
  # exclude rest-core
20
21
  s.files.reject!{ |f| f.start_with?('rest-core/') }
@@ -4,31 +4,29 @@ require 'rest-core'
4
4
  # http://developer.github.com/v3/
5
5
  module RestCore
6
6
  Github = Builder.client(:client_id, :client_secret, :data) do
7
- use Timeout , 10
8
-
9
7
  use DefaultSite , 'https://api.github.com/'
10
8
  use DefaultHeaders, {'Accept' => 'application/json'}
11
9
  use Oauth2Query , nil
12
10
 
13
- use CommonLogger , nil
11
+ use Timeout , 10
12
+ use FollowRedirect, 5
14
13
  use ErrorHandler , lambda{ |env| Github::Error.call(env) }
15
14
  use ErrorDetectorHttp
16
15
  use JsonResponse , true
16
+ use CommonLogger , nil
17
17
  use Cache , nil, 600
18
18
  end
19
19
  end
20
20
 
21
21
  class RestCore::Github::Error < RestCore::Error
22
22
  include RestCore
23
- class ServerError < Github::Error; end
24
- class ClientError < Github::Error; end
25
23
 
26
24
  class BadRequest < Github::Error; end
27
25
  class Unauthorized < Github::Error; end
28
26
  class Forbidden < Github::Error; end
29
27
  class NotFound < Github::Error; end
30
28
  class UnprocessableEntity < Github::Error; end
31
- class InternalServerError < Github::Error::ServerError; end
29
+ class InternalServerError < Github::Error; end
32
30
 
33
31
  attr_reader :error, :code, :url
34
32
  def initialize error, code, url=''
@@ -1,4 +1,4 @@
1
1
 
2
2
  module RestMore
3
- VERSION = '3.3.4'
3
+ VERSION = '3.4.0'
4
4
  end
@@ -1,117 +1,117 @@
1
1
  # -*- encoding: utf-8 -*-
2
- # stub: rest-more 3.3.4 ruby lib
2
+ # stub: rest-more 3.4.0 ruby lib
3
3
 
4
4
  Gem::Specification.new do |s|
5
- s.name = "rest-more"
6
- s.version = "3.3.4"
5
+ s.name = "rest-more".freeze
6
+ s.version = "3.4.0"
7
7
 
8
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
9
- s.require_paths = ["lib"]
10
- s.authors = ["Lin Jen-Shin (godfat)"]
11
- s.date = "2015-10-15"
12
- s.description = "Various REST clients such as Facebook and Twitter built with [rest-core][].\n\n[rest-core]: https://github.com/godfat/rest-core"
13
- s.email = ["godfat (XD) godfat.org"]
14
- s.executables = ["rib-rest-core"]
8
+ s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
9
+ s.require_paths = ["lib".freeze]
10
+ s.authors = ["Lin Jen-Shin (godfat)".freeze]
11
+ s.date = "2016-02-04"
12
+ s.description = "Various REST clients such as Facebook and Twitter built with [rest-core][].\n\n[rest-core]: https://github.com/godfat/rest-core".freeze
13
+ s.email = ["godfat (XD) godfat.org".freeze]
14
+ s.executables = ["rib-rest-core".freeze]
15
15
  s.files = [
16
- ".gitignore",
17
- ".gitmodules",
18
- ".travis.yml",
19
- "CHANGES.md",
20
- "Gemfile",
21
- "LICENSE",
22
- "README.md",
23
- "Rakefile",
24
- "TODO.md",
25
- "bin/rib-rest-core",
26
- "doc/facebook.md",
27
- "example/multi.rb",
28
- "example/rails3/Gemfile",
29
- "example/rails3/README",
30
- "example/rails3/Rakefile",
31
- "example/rails3/app/controllers/application_controller.rb",
32
- "example/rails3/app/views/application/helper.html.erb",
33
- "example/rails3/config.ru",
34
- "example/rails3/config/application.rb",
35
- "example/rails3/config/boot.rb",
36
- "example/rails3/config/environment.rb",
37
- "example/rails3/config/environments/development.rb",
38
- "example/rails3/config/environments/production.rb",
39
- "example/rails3/config/environments/test.rb",
40
- "example/rails3/config/initializers/secret_token.rb",
41
- "example/rails3/config/initializers/session_store.rb",
42
- "example/rails3/config/rest-core.yaml",
43
- "example/rails3/config/routes.rb",
44
- "example/rails3/test/functional/application_controller_test.rb",
45
- "example/rails3/test/test_helper.rb",
46
- "example/rails3/test/unit/rails_util_test.rb",
47
- "example/simple.rb",
48
- "example/sinatra/config.ru",
49
- "lib/rest-core/client/dropbox.rb",
50
- "lib/rest-core/client/facebook.rb",
51
- "lib/rest-core/client/facebook/rails_util.rb",
52
- "lib/rest-core/client/github.rb",
53
- "lib/rest-core/client/github/rails_util.rb",
54
- "lib/rest-core/client/instagram.rb",
55
- "lib/rest-core/client/linkedin.rb",
56
- "lib/rest-core/client/linkedin/rails_util.rb",
57
- "lib/rest-core/client/stackexchange.rb",
58
- "lib/rest-core/client/twitter.rb",
59
- "lib/rest-core/client/twitter/rails_util.rb",
60
- "lib/rest-core/util/rails_util_util.rb",
61
- "lib/rest-more.rb",
62
- "lib/rest-more/test.rb",
63
- "lib/rest-more/version.rb",
64
- "lib/rib/app/rest-core.rb",
65
- "rest-more.gemspec",
66
- "task/README.md",
67
- "task/gemgem.rb",
68
- "test/dropbox/test_dropbox.rb",
69
- "test/facebook/test_api.rb",
70
- "test/facebook/test_default.rb",
71
- "test/facebook/test_error.rb",
72
- "test/facebook/test_handler.rb",
73
- "test/facebook/test_misc.rb",
74
- "test/facebook/test_oauth.rb",
75
- "test/facebook/test_old.rb",
76
- "test/facebook/test_page.rb",
77
- "test/facebook/test_parse.rb",
78
- "test/facebook/test_serialize.rb",
79
- "test/facebook/test_timeout.rb",
80
- "test/github/test_github.rb",
81
- "test/instagram/test_instagram.rb",
82
- "test/stackexchange/test_stackexchange.rb",
83
- "test/twitter/test_twitter.rb"]
84
- s.homepage = "https://github.com/godfat/rest-more"
85
- s.licenses = ["Apache License 2.0"]
86
- s.rubygems_version = "2.4.8"
87
- s.summary = "Various REST clients such as Facebook and Twitter built with [rest-core][]."
16
+ ".gitignore".freeze,
17
+ ".gitmodules".freeze,
18
+ ".travis.yml".freeze,
19
+ "CHANGES.md".freeze,
20
+ "Gemfile".freeze,
21
+ "LICENSE".freeze,
22
+ "README.md".freeze,
23
+ "Rakefile".freeze,
24
+ "TODO.md".freeze,
25
+ "bin/rib-rest-core".freeze,
26
+ "doc/facebook.md".freeze,
27
+ "example/multi.rb".freeze,
28
+ "example/rails3/Gemfile".freeze,
29
+ "example/rails3/README".freeze,
30
+ "example/rails3/Rakefile".freeze,
31
+ "example/rails3/app/controllers/application_controller.rb".freeze,
32
+ "example/rails3/app/views/application/helper.html.erb".freeze,
33
+ "example/rails3/config.ru".freeze,
34
+ "example/rails3/config/application.rb".freeze,
35
+ "example/rails3/config/boot.rb".freeze,
36
+ "example/rails3/config/environment.rb".freeze,
37
+ "example/rails3/config/environments/development.rb".freeze,
38
+ "example/rails3/config/environments/production.rb".freeze,
39
+ "example/rails3/config/environments/test.rb".freeze,
40
+ "example/rails3/config/initializers/secret_token.rb".freeze,
41
+ "example/rails3/config/initializers/session_store.rb".freeze,
42
+ "example/rails3/config/rest-core.yaml".freeze,
43
+ "example/rails3/config/routes.rb".freeze,
44
+ "example/rails3/test/functional/application_controller_test.rb".freeze,
45
+ "example/rails3/test/test_helper.rb".freeze,
46
+ "example/rails3/test/unit/rails_util_test.rb".freeze,
47
+ "example/simple.rb".freeze,
48
+ "example/sinatra/config.ru".freeze,
49
+ "lib/rest-core/client/dropbox.rb".freeze,
50
+ "lib/rest-core/client/facebook.rb".freeze,
51
+ "lib/rest-core/client/facebook/rails_util.rb".freeze,
52
+ "lib/rest-core/client/github.rb".freeze,
53
+ "lib/rest-core/client/github/rails_util.rb".freeze,
54
+ "lib/rest-core/client/instagram.rb".freeze,
55
+ "lib/rest-core/client/linkedin.rb".freeze,
56
+ "lib/rest-core/client/linkedin/rails_util.rb".freeze,
57
+ "lib/rest-core/client/stackexchange.rb".freeze,
58
+ "lib/rest-core/client/twitter.rb".freeze,
59
+ "lib/rest-core/client/twitter/rails_util.rb".freeze,
60
+ "lib/rest-core/util/rails_util_util.rb".freeze,
61
+ "lib/rest-more.rb".freeze,
62
+ "lib/rest-more/test.rb".freeze,
63
+ "lib/rest-more/version.rb".freeze,
64
+ "lib/rib/app/rest-core.rb".freeze,
65
+ "rest-more.gemspec".freeze,
66
+ "task/README.md".freeze,
67
+ "task/gemgem.rb".freeze,
68
+ "test/dropbox/test_dropbox.rb".freeze,
69
+ "test/facebook/test_api.rb".freeze,
70
+ "test/facebook/test_default.rb".freeze,
71
+ "test/facebook/test_error.rb".freeze,
72
+ "test/facebook/test_handler.rb".freeze,
73
+ "test/facebook/test_misc.rb".freeze,
74
+ "test/facebook/test_oauth.rb".freeze,
75
+ "test/facebook/test_old.rb".freeze,
76
+ "test/facebook/test_page.rb".freeze,
77
+ "test/facebook/test_parse.rb".freeze,
78
+ "test/facebook/test_serialize.rb".freeze,
79
+ "test/facebook/test_timeout.rb".freeze,
80
+ "test/github/test_github.rb".freeze,
81
+ "test/instagram/test_instagram.rb".freeze,
82
+ "test/stackexchange/test_stackexchange.rb".freeze,
83
+ "test/twitter/test_twitter.rb".freeze]
84
+ s.homepage = "https://github.com/godfat/rest-more".freeze
85
+ s.licenses = ["Apache License 2.0".freeze]
86
+ s.rubygems_version = "2.5.2".freeze
87
+ s.summary = "Various REST clients such as Facebook and Twitter built with [rest-core][].".freeze
88
88
  s.test_files = [
89
- "test/dropbox/test_dropbox.rb",
90
- "test/facebook/test_api.rb",
91
- "test/facebook/test_default.rb",
92
- "test/facebook/test_error.rb",
93
- "test/facebook/test_handler.rb",
94
- "test/facebook/test_misc.rb",
95
- "test/facebook/test_oauth.rb",
96
- "test/facebook/test_old.rb",
97
- "test/facebook/test_page.rb",
98
- "test/facebook/test_parse.rb",
99
- "test/facebook/test_serialize.rb",
100
- "test/facebook/test_timeout.rb",
101
- "test/github/test_github.rb",
102
- "test/instagram/test_instagram.rb",
103
- "test/stackexchange/test_stackexchange.rb",
104
- "test/twitter/test_twitter.rb"]
89
+ "test/dropbox/test_dropbox.rb".freeze,
90
+ "test/facebook/test_api.rb".freeze,
91
+ "test/facebook/test_default.rb".freeze,
92
+ "test/facebook/test_error.rb".freeze,
93
+ "test/facebook/test_handler.rb".freeze,
94
+ "test/facebook/test_misc.rb".freeze,
95
+ "test/facebook/test_oauth.rb".freeze,
96
+ "test/facebook/test_old.rb".freeze,
97
+ "test/facebook/test_page.rb".freeze,
98
+ "test/facebook/test_parse.rb".freeze,
99
+ "test/facebook/test_serialize.rb".freeze,
100
+ "test/facebook/test_timeout.rb".freeze,
101
+ "test/github/test_github.rb".freeze,
102
+ "test/instagram/test_instagram.rb".freeze,
103
+ "test/stackexchange/test_stackexchange.rb".freeze,
104
+ "test/twitter/test_twitter.rb".freeze]
105
105
 
106
106
  if s.respond_to? :specification_version then
107
107
  s.specification_version = 4
108
108
 
109
109
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
110
- s.add_runtime_dependency(%q<rest-core>, [">= 3.3.0"])
110
+ s.add_runtime_dependency(%q<rest-core>.freeze, [">= 4.0.0"])
111
111
  else
112
- s.add_dependency(%q<rest-core>, [">= 3.3.0"])
112
+ s.add_dependency(%q<rest-core>.freeze, [">= 4.0.0"])
113
113
  end
114
114
  else
115
- s.add_dependency(%q<rest-core>, [">= 3.3.0"])
115
+ s.add_dependency(%q<rest-core>.freeze, [">= 4.0.0"])
116
116
  end
117
117
  end
@@ -51,15 +51,4 @@ describe RC::Facebook::Error do
51
51
  error.should.not.kind_of?(RC::Facebook::Error::AccessToken)
52
52
  error.should .kind_of?(RC::Facebook::Error)
53
53
  end
54
-
55
- would 'nuke cache upon errors' do
56
- stub_request(:get, 'https://graph.facebook.com/me').
57
- to_return(:body => '{"error":"wrong"}').times(2)
58
-
59
- rg = RC::Facebook.new(:cache => {},
60
- :error_handler => lambda{|env|env})
61
- rg.get('me'); rg.get('me')
62
- rg.wait
63
- rg.cache.values.should.eq []
64
- end
65
54
  end
@@ -77,7 +77,7 @@ describe RC::Facebook do
77
77
 
78
78
  describe 'signed_request' do
79
79
  def encode str
80
- [str].pack('m0').tr('=', '').tr('+/', '-_')
80
+ [str].pack('m0').tr('+/', '-_')
81
81
  end
82
82
 
83
83
  def setup_sr secret, data, sig=nil
@@ -10,7 +10,7 @@ describe RC::Facebook do
10
10
  would 'respect timeout' do
11
11
  stub_request(:get, 'https://graph.facebook.com/me').
12
12
  to_return(:body => '{}')
13
- any_instance_of(RC::Timeout::Timer){ |timer|
13
+ any_instance_of(PromisePool::Timer){ |timer|
14
14
  mock(timer).on_timeout
15
15
  }
16
16
  RC::Facebook.new.get('me').should.eq({})
@@ -19,7 +19,7 @@ describe RC::Facebook do
19
19
  would 'override timeout' do
20
20
  stub_request(:get, 'https://graph.facebook.com/me').
21
21
  to_return(:body => 'true')
22
- mock(RC::Timeout::Timer).new(99, is_a(Timeout::Error))
22
+ mock(PromisePool::Timer).new(99, is_a(Timeout::Error))
23
23
  RC::Facebook.new(:timeout => 1).get('me', {}, :timeout => 99).
24
24
  should.eq true
25
25
  end
@@ -6,6 +6,8 @@ describe RC::Github do
6
6
  WebMock.reset!
7
7
  end
8
8
 
9
+ # TODO: Pork::Failure: Expect [0].==([0, 1, 2]) to return true
10
+ # https://travis-ci.org/godfat/rest-more/jobs/105298582
9
11
  would 'get all' do
10
12
  link = '</users/godfat/repos?type=o&per_page=100&page=3>; rel="last"'
11
13
  headers = {'Link' => link}
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rest-more
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.4
4
+ version: 3.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lin Jen-Shin (godfat)
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-15 00:00:00.000000000 Z
11
+ date: 2016-02-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-core
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 3.3.0
19
+ version: 4.0.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 3.3.0
26
+ version: 4.0.0
27
27
  description: |-
28
28
  Various REST clients such as Facebook and Twitter built with [rest-core][].
29
29
 
@@ -123,7 +123,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
123
123
  version: '0'
124
124
  requirements: []
125
125
  rubyforge_project:
126
- rubygems_version: 2.4.8
126
+ rubygems_version: 2.5.2
127
127
  signing_key:
128
128
  specification_version: 4
129
129
  summary: Various REST clients such as Facebook and Twitter built with [rest-core][].