amiando 0.5.2 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- data/amiando.gemspec +3 -2
- data/lib/amiando.rb +2 -9
- data/lib/amiando/version.rb +1 -1
- metadata +26 -10
data/amiando.gemspec
CHANGED
@@ -18,8 +18,9 @@ Gem::Specification.new do |s|
|
|
18
18
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
19
19
|
s.require_paths = ["lib"]
|
20
20
|
|
21
|
-
s.
|
22
|
-
s.
|
21
|
+
s.add_runtime_dependency 'typhoeus'
|
22
|
+
s.add_runtime_dependency 'multi_json'
|
23
|
+
s.add_runtime_dependency 'activesupport', '>= 3.0.0'
|
23
24
|
|
24
25
|
s.add_development_dependency 'hydra_cache'
|
25
26
|
s.add_development_dependency 'minitest', '2.9.0'
|
data/lib/amiando.rb
CHANGED
@@ -3,6 +3,7 @@ require "typhoeus"
|
|
3
3
|
require "multi_json"
|
4
4
|
require "ostruct"
|
5
5
|
require "benchmark"
|
6
|
+
require "active_support/notifications"
|
6
7
|
|
7
8
|
module Amiando
|
8
9
|
autoload :Request, 'amiando/request'
|
@@ -57,9 +58,6 @@ module Amiando
|
|
57
58
|
# Timeout value (in milliseconds). Default: 15 seconds.
|
58
59
|
attr_accessor :timeout
|
59
60
|
|
60
|
-
# Used for statistics (time-bandits for example)
|
61
|
-
attr_accessor :total_time, :total_requests
|
62
|
-
|
63
61
|
# Set default options for typhoeus
|
64
62
|
attr_accessor :default_options
|
65
63
|
|
@@ -89,15 +87,13 @@ module Amiando
|
|
89
87
|
def run
|
90
88
|
exception = nil
|
91
89
|
requests.each { |request| hydra.queue(request) }
|
92
|
-
@total_requests += requests.size
|
93
90
|
|
94
|
-
|
91
|
+
ActiveSupport::Notifications.instrument("run.amiando", :calls => requests.size) do
|
95
92
|
begin
|
96
93
|
hydra.run
|
97
94
|
rescue Exception => exception
|
98
95
|
end
|
99
96
|
end
|
100
|
-
@total_time += duration
|
101
97
|
|
102
98
|
raise exception if exception
|
103
99
|
ensure
|
@@ -129,7 +125,4 @@ module Amiando
|
|
129
125
|
##
|
130
126
|
# Default timeout of 15 seconds
|
131
127
|
self.timeout = 15000
|
132
|
-
|
133
|
-
self.total_time = 0.0
|
134
|
-
self.total_requests = 0
|
135
128
|
end
|
data/lib/amiando/version.rb
CHANGED
metadata
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: amiando
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.6.0
|
4
5
|
prerelease:
|
5
|
-
version: 0.5.2
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Jorge Dias
|
@@ -10,17 +10,17 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2013-
|
13
|
+
date: 2013-08-02 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: typhoeus
|
17
|
-
type: :runtime
|
18
17
|
requirement: !ruby/object:Gem::Requirement
|
19
18
|
none: false
|
20
19
|
requirements:
|
21
20
|
- - ! '>='
|
22
21
|
- !ruby/object:Gem::Version
|
23
22
|
version: '0'
|
23
|
+
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
26
|
none: false
|
@@ -30,13 +30,13 @@ dependencies:
|
|
30
30
|
version: '0'
|
31
31
|
- !ruby/object:Gem::Dependency
|
32
32
|
name: multi_json
|
33
|
-
type: :runtime
|
34
33
|
requirement: !ruby/object:Gem::Requirement
|
35
34
|
none: false
|
36
35
|
requirements:
|
37
36
|
- - ! '>='
|
38
37
|
- !ruby/object:Gem::Version
|
39
38
|
version: '0'
|
39
|
+
type: :runtime
|
40
40
|
prerelease: false
|
41
41
|
version_requirements: !ruby/object:Gem::Requirement
|
42
42
|
none: false
|
@@ -44,15 +44,31 @@ dependencies:
|
|
44
44
|
- - ! '>='
|
45
45
|
- !ruby/object:Gem::Version
|
46
46
|
version: '0'
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: activesupport
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
50
|
+
none: false
|
51
|
+
requirements:
|
52
|
+
- - ! '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 3.0.0
|
55
|
+
type: :runtime
|
56
|
+
prerelease: false
|
57
|
+
version_requirements: !ruby/object:Gem::Requirement
|
58
|
+
none: false
|
59
|
+
requirements:
|
60
|
+
- - ! '>='
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: 3.0.0
|
47
63
|
- !ruby/object:Gem::Dependency
|
48
64
|
name: hydra_cache
|
49
|
-
type: :development
|
50
65
|
requirement: !ruby/object:Gem::Requirement
|
51
66
|
none: false
|
52
67
|
requirements:
|
53
68
|
- - ! '>='
|
54
69
|
- !ruby/object:Gem::Version
|
55
70
|
version: '0'
|
71
|
+
type: :development
|
56
72
|
prerelease: false
|
57
73
|
version_requirements: !ruby/object:Gem::Requirement
|
58
74
|
none: false
|
@@ -62,13 +78,13 @@ dependencies:
|
|
62
78
|
version: '0'
|
63
79
|
- !ruby/object:Gem::Dependency
|
64
80
|
name: minitest
|
65
|
-
type: :development
|
66
81
|
requirement: !ruby/object:Gem::Requirement
|
67
82
|
none: false
|
68
83
|
requirements:
|
69
84
|
- - '='
|
70
85
|
- !ruby/object:Gem::Version
|
71
86
|
version: 2.9.0
|
87
|
+
type: :development
|
72
88
|
prerelease: false
|
73
89
|
version_requirements: !ruby/object:Gem::Requirement
|
74
90
|
none: false
|
@@ -78,13 +94,13 @@ dependencies:
|
|
78
94
|
version: 2.9.0
|
79
95
|
- !ruby/object:Gem::Dependency
|
80
96
|
name: webmock
|
81
|
-
type: :development
|
82
97
|
requirement: !ruby/object:Gem::Requirement
|
83
98
|
none: false
|
84
99
|
requirements:
|
85
100
|
- - ~>
|
86
101
|
- !ruby/object:Gem::Version
|
87
102
|
version: 1.7.9
|
103
|
+
type: :development
|
88
104
|
prerelease: false
|
89
105
|
version_requirements: !ruby/object:Gem::Requirement
|
90
106
|
none: false
|
@@ -94,13 +110,13 @@ dependencies:
|
|
94
110
|
version: 1.7.9
|
95
111
|
- !ruby/object:Gem::Dependency
|
96
112
|
name: mocha
|
97
|
-
type: :development
|
98
113
|
requirement: !ruby/object:Gem::Requirement
|
99
114
|
none: false
|
100
115
|
requirements:
|
101
116
|
- - ! '>='
|
102
117
|
- !ruby/object:Gem::Version
|
103
118
|
version: '0'
|
119
|
+
type: :development
|
104
120
|
prerelease: false
|
105
121
|
version_requirements: !ruby/object:Gem::Requirement
|
106
122
|
none: false
|
@@ -110,13 +126,13 @@ dependencies:
|
|
110
126
|
version: '0'
|
111
127
|
- !ruby/object:Gem::Dependency
|
112
128
|
name: rake
|
113
|
-
type: :development
|
114
129
|
requirement: !ruby/object:Gem::Requirement
|
115
130
|
none: false
|
116
131
|
requirements:
|
117
132
|
- - ! '>='
|
118
133
|
- !ruby/object:Gem::Version
|
119
134
|
version: '0'
|
135
|
+
type: :development
|
120
136
|
prerelease: false
|
121
137
|
version_requirements: !ruby/object:Gem::Requirement
|
122
138
|
none: false
|
@@ -287,7 +303,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
287
303
|
version: '0'
|
288
304
|
requirements: []
|
289
305
|
rubyforge_project: amiando
|
290
|
-
rubygems_version: 1.8.
|
306
|
+
rubygems_version: 1.8.25
|
291
307
|
signing_key:
|
292
308
|
specification_version: 3
|
293
309
|
summary: A ruby client for the amiando REST API
|