heroku-nav 0.1.23 → 0.1.24
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/heroku-nav.gemspec +2 -2
- data/lib/heroku/nav.rb +21 -5
- metadata +72 -92
data/Rakefile
CHANGED
@@ -21,7 +21,7 @@ begin
|
|
21
21
|
gemspec.add_dependency(%q<rest-client>, [">= 1.0"])
|
22
22
|
gemspec.add_dependency(%q<json>, [">= 0"])
|
23
23
|
|
24
|
-
gemspec.version = '0.1.
|
24
|
+
gemspec.version = '0.1.24'
|
25
25
|
end
|
26
26
|
rescue LoadError
|
27
27
|
puts "Jeweler not available. Install it with: gem install jeweler"
|
data/heroku-nav.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{heroku-nav}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.24"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["David Dollar", "Pedro Belo", "Raul Murciano", "Todd Matthews"]
|
12
|
-
s.date = %q{2011-
|
12
|
+
s.date = %q{2011-10-10}
|
13
13
|
s.description = %q{}
|
14
14
|
s.email = ["david@heroku.com", "pedro@heroku.com", "raul@heroku.com", "todd@heroku.com"]
|
15
15
|
s.extra_rdoc_files = [
|
data/lib/heroku/nav.rb
CHANGED
@@ -34,9 +34,11 @@ module Heroku
|
|
34
34
|
|
35
35
|
class << self
|
36
36
|
def fetch
|
37
|
-
Timeout.timeout(
|
38
|
-
|
39
|
-
|
37
|
+
Timeout.timeout(10) do
|
38
|
+
retry_upto(10, :interval => 0.5) do
|
39
|
+
raw = RestClient.get(resource_url, :accept => :json).to_s
|
40
|
+
return JSON.parse(raw)
|
41
|
+
end
|
40
42
|
end
|
41
43
|
rescue Exception => e
|
42
44
|
STDERR.puts "Failed to fetch the Heroku #{resource}: #{e.class.name} - #{e.message}"
|
@@ -59,6 +61,18 @@ module Heroku
|
|
59
61
|
def html
|
60
62
|
@@body ||= fetch['html']
|
61
63
|
end
|
64
|
+
|
65
|
+
def retry_upto(max_retries = 1, opts = {})
|
66
|
+
yield
|
67
|
+
rescue *(opts[:rescue] || Exception)
|
68
|
+
attempt = attempt ? attempt+1 : 1
|
69
|
+
raise if (attempt == max_retries)
|
70
|
+
if interval = opts[:interval]
|
71
|
+
secs = interval.respond_to?(:call) ? interval.call(attempt) : interval
|
72
|
+
sleep(secs)
|
73
|
+
end
|
74
|
+
retry
|
75
|
+
end
|
62
76
|
end
|
63
77
|
end
|
64
78
|
|
@@ -100,8 +114,10 @@ module Heroku
|
|
100
114
|
class Provider < Base
|
101
115
|
class << self
|
102
116
|
def fetch
|
103
|
-
Timeout.timeout(
|
104
|
-
|
117
|
+
Timeout.timeout(10) do
|
118
|
+
retry_upto(10, :interval => 0.5) do
|
119
|
+
RestClient.get(resource_url).to_s
|
120
|
+
end
|
105
121
|
end
|
106
122
|
rescue => e
|
107
123
|
STDERR.puts "Failed to fetch the Heroku #{resource}: #{e.class.name} - #{e.message}"
|
metadata
CHANGED
@@ -1,14 +1,10 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: heroku-nav
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
|
6
|
-
- 0
|
7
|
-
- 1
|
8
|
-
- 23
|
9
|
-
version: 0.1.23
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.24
|
5
|
+
prerelease:
|
10
6
|
platform: ruby
|
11
|
-
authors:
|
7
|
+
authors:
|
12
8
|
- David Dollar
|
13
9
|
- Pedro Belo
|
14
10
|
- Raul Murciano
|
@@ -16,84 +12,74 @@ authors:
|
|
16
12
|
autorequire:
|
17
13
|
bindir: bin
|
18
14
|
cert_chain: []
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
dependencies:
|
23
|
-
- !ruby/object:Gem::Dependency
|
15
|
+
date: 2011-10-10 00:00:00.000000000Z
|
16
|
+
dependencies:
|
17
|
+
- !ruby/object:Gem::Dependency
|
24
18
|
name: baconmocha
|
25
|
-
|
26
|
-
|
27
|
-
requirements:
|
28
|
-
- -
|
29
|
-
- !ruby/object:Gem::Version
|
30
|
-
|
31
|
-
- 0
|
32
|
-
version: "0"
|
19
|
+
requirement: &2154312380 !ruby/object:Gem::Requirement
|
20
|
+
none: false
|
21
|
+
requirements:
|
22
|
+
- - ! '>='
|
23
|
+
- !ruby/object:Gem::Version
|
24
|
+
version: '0'
|
33
25
|
type: :development
|
34
|
-
version_requirements: *id001
|
35
|
-
- !ruby/object:Gem::Dependency
|
36
|
-
name: sinatra
|
37
26
|
prerelease: false
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
27
|
+
version_requirements: *2154312380
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
name: sinatra
|
30
|
+
requirement: &2154311900 !ruby/object:Gem::Requirement
|
31
|
+
none: false
|
32
|
+
requirements:
|
33
|
+
- - ! '>='
|
34
|
+
- !ruby/object:Gem::Version
|
35
|
+
version: '0'
|
45
36
|
type: :development
|
46
|
-
version_requirements: *id002
|
47
|
-
- !ruby/object:Gem::Dependency
|
48
|
-
name: rack-test
|
49
37
|
prerelease: false
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
38
|
+
version_requirements: *2154311900
|
39
|
+
- !ruby/object:Gem::Dependency
|
40
|
+
name: rack-test
|
41
|
+
requirement: &2154311400 !ruby/object:Gem::Requirement
|
42
|
+
none: false
|
43
|
+
requirements:
|
44
|
+
- - ! '>='
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '0'
|
57
47
|
type: :development
|
58
|
-
version_requirements: *id003
|
59
|
-
- !ruby/object:Gem::Dependency
|
60
|
-
name: rest-client
|
61
48
|
prerelease: false
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
49
|
+
version_requirements: *2154311400
|
50
|
+
- !ruby/object:Gem::Dependency
|
51
|
+
name: rest-client
|
52
|
+
requirement: &2154310880 !ruby/object:Gem::Requirement
|
53
|
+
none: false
|
54
|
+
requirements:
|
55
|
+
- - ! '>='
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
version: '1.0'
|
70
58
|
type: :runtime
|
71
|
-
version_requirements: *id004
|
72
|
-
- !ruby/object:Gem::Dependency
|
73
|
-
name: json
|
74
59
|
prerelease: false
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
60
|
+
version_requirements: *2154310880
|
61
|
+
- !ruby/object:Gem::Dependency
|
62
|
+
name: json
|
63
|
+
requirement: &2154310220 !ruby/object:Gem::Requirement
|
64
|
+
none: false
|
65
|
+
requirements:
|
66
|
+
- - ! '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
82
69
|
type: :runtime
|
83
|
-
|
84
|
-
|
85
|
-
|
70
|
+
prerelease: false
|
71
|
+
version_requirements: *2154310220
|
72
|
+
description: ''
|
73
|
+
email:
|
86
74
|
- david@heroku.com
|
87
75
|
- pedro@heroku.com
|
88
76
|
- raul@heroku.com
|
89
77
|
- todd@heroku.com
|
90
78
|
executables: []
|
91
|
-
|
92
79
|
extensions: []
|
93
|
-
|
94
|
-
extra_rdoc_files:
|
80
|
+
extra_rdoc_files:
|
95
81
|
- README.md
|
96
|
-
files:
|
82
|
+
files:
|
97
83
|
- README.md
|
98
84
|
- Rakefile
|
99
85
|
- heroku-nav.gemspec
|
@@ -101,37 +87,31 @@ files:
|
|
101
87
|
- spec/api_spec.rb
|
102
88
|
- spec/base.rb
|
103
89
|
- spec/nav_spec.rb
|
104
|
-
has_rdoc: true
|
105
90
|
homepage: http://heroku.com
|
106
91
|
licenses: []
|
107
|
-
|
108
92
|
post_install_message:
|
109
93
|
rdoc_options: []
|
110
|
-
|
111
|
-
require_paths:
|
94
|
+
require_paths:
|
112
95
|
- lib
|
113
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
requirements:
|
122
|
-
- -
|
123
|
-
- !ruby/object:Gem::Version
|
124
|
-
|
125
|
-
- 0
|
126
|
-
version: "0"
|
96
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
97
|
+
none: false
|
98
|
+
requirements:
|
99
|
+
- - ! '>='
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: '0'
|
102
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
103
|
+
none: false
|
104
|
+
requirements:
|
105
|
+
- - ! '>='
|
106
|
+
- !ruby/object:Gem::Version
|
107
|
+
version: '0'
|
127
108
|
requirements: []
|
128
|
-
|
129
109
|
rubyforge_project:
|
130
|
-
rubygems_version: 1.
|
110
|
+
rubygems_version: 1.8.10
|
131
111
|
signing_key:
|
132
112
|
specification_version: 3
|
133
|
-
summary:
|
134
|
-
test_files:
|
113
|
+
summary: ''
|
114
|
+
test_files:
|
135
115
|
- spec/api_spec.rb
|
136
116
|
- spec/base.rb
|
137
117
|
- spec/nav_spec.rb
|