uv-rays 1.3.8 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,30 +2,30 @@ require 'uv-rays'
2
2
 
3
3
  describe UV::Scheduler do
4
4
  before :each do
5
- @loop = Libuv::Loop.new
6
5
  @general_failure = []
7
- @timeout = @loop.timer do
8
- @loop.stop
6
+ @reactor = Libuv::Reactor.new
7
+ @reactor.notifier do |error, context|
8
+ begin
9
+ @general_failure << "Log called: #{context}\n#{error.message}\n#{error.backtrace.join("\n") if error.backtrace}\n"
10
+ rescue Exception
11
+ @general_failure << "error in logger #{e.inspect}"
12
+ end
13
+ end
14
+
15
+ @timeout = @reactor.timer do
16
+ @reactor.stop
9
17
  @general_failure << "test timed out"
10
18
  end
11
19
  @timeout.start(5000)
12
- @scheduler = @loop.scheduler
20
+ @scheduler = @reactor.scheduler
13
21
  end
14
22
 
15
23
  it "should be able to schedule a one shot event using 'in'" do
16
- @loop.run { |logger|
17
- logger.progress do |level, errorid, error|
18
- begin
19
- @general_failure << "Log called: #{level}: #{errorid}\n#{error.message}\n#{error.backtrace.join("\n")}\n"
20
- rescue Exception
21
- @general_failure << 'error in logger'
22
- end
23
- end
24
-
24
+ @reactor.run { |reactor|
25
25
  @event = @scheduler.in('0.5s') do |triggered, event|
26
26
  @triggered_at = triggered
27
27
  @result = event
28
- @loop.stop
28
+ @reactor.stop
29
29
  end
30
30
  }
31
31
 
@@ -37,19 +37,11 @@ describe UV::Scheduler do
37
37
  end
38
38
 
39
39
  it "should be able to schedule a one shot event using 'at'" do
40
- @loop.run { |logger|
41
- logger.progress do |level, errorid, error|
42
- begin
43
- @general_failure << "Log called: #{level}: #{errorid}\n#{error.message}\n#{error.backtrace.join("\n")}\n"
44
- rescue Exception
45
- @general_failure << 'error in logger'
46
- end
47
- end
48
-
40
+ @reactor.run { |reactor|
49
41
  @event = @scheduler.at(Time.now + 1) do |triggered, event|
50
42
  @triggered_at = triggered
51
43
  @result = event
52
- @loop.stop
44
+ @reactor.stop
53
45
  end
54
46
  }
55
47
 
@@ -61,15 +53,7 @@ describe UV::Scheduler do
61
53
  end
62
54
 
63
55
  it "should be able to schedule a repeat event" do
64
- @loop.run { |logger|
65
- logger.progress do |level, errorid, error|
66
- begin
67
- @general_failure << "Log called: #{level}: #{errorid}\n#{error.message}\n#{error.backtrace.join("\n")}\n"
68
- rescue Exception
69
- @general_failure << 'error in logger'
70
- end
71
- end
72
-
56
+ @reactor.run { |reactor|
73
57
  @run = 0
74
58
  @event = @scheduler.every('0.25s') do |triggered, event|
75
59
  @triggered_at = triggered
@@ -82,7 +66,7 @@ describe UV::Scheduler do
82
66
  @run += 1
83
67
  if @run == 2
84
68
  @event.pause
85
- @loop.stop
69
+ @reactor.stop
86
70
  end
87
71
  end
88
72
  }
@@ -95,15 +79,7 @@ describe UV::Scheduler do
95
79
  it "should be able to cancel an event" do
96
80
  # Also tests events run in order of scheduled
97
81
  # Also tests events are not inadvertently canceled by other test
98
- @loop.run { |logger|
99
- logger.progress do |level, errorid, error|
100
- begin
101
- @general_failure << "Log called: #{level}: #{errorid}\n#{error.message}\n#{error.backtrace.join("\n")}\n"
102
- rescue Exception
103
- @general_failure << 'error in logger'
104
- end
105
- end
106
-
82
+ @reactor.run { |reactor|
107
83
  @triggered = []
108
84
 
109
85
  @event1 = @scheduler.in('0.5s') do |triggered, event|
@@ -116,7 +92,7 @@ describe UV::Scheduler do
116
92
 
117
93
  @event3 = @scheduler.in('0.5s') do |triggered, event|
118
94
  @triggered << 3
119
- @loop.stop
95
+ @reactor.stop
120
96
  end
121
97
 
122
98
  @scheduled, @schedules = @scheduler.instance_eval {
@@ -128,7 +104,7 @@ describe UV::Scheduler do
128
104
 
129
105
  @event2.cancel
130
106
 
131
- @loop.next_tick do
107
+ @reactor.next_tick do
132
108
  expect(@scheduled.size).to eq(2)
133
109
  expect(@schedules.size).to eq(2)
134
110
  end
data/uv-rays.gemspec CHANGED
@@ -10,22 +10,24 @@ Gem::Specification.new do |gem|
10
10
  gem.summary = "Abstractions for working with Libuv"
11
11
  gem.description = "Opinionated abstractions for Libuv"
12
12
 
13
- gem.required_ruby_version = '>= 1.9.2'
13
+ gem.required_ruby_version = '>= 2.0.0'
14
14
  gem.require_paths = ["lib"]
15
15
 
16
- gem.add_runtime_dependency 'libuv', '>= 2.0.0'
17
- gem.add_runtime_dependency 'bisect'
18
- gem.add_runtime_dependency 'tzinfo'
19
- gem.add_runtime_dependency 'cookiejar'
20
- gem.add_runtime_dependency 'ipaddress'
21
- gem.add_runtime_dependency 'addressable'
22
- gem.add_runtime_dependency 'http-parser', '>= 1.0.4'
23
- gem.add_runtime_dependency 'rubyntlm'
24
- gem.add_runtime_dependency 'net-http-digest_auth'
16
+ gem.add_runtime_dependency 'libuv', '~> 3.0' # Evented IO
17
+ gem.add_runtime_dependency 'bisect', '~> 0.1' # Sorted insertion
18
+ gem.add_runtime_dependency 'tzinfo', '~> 1.2' # Ruby timezones info
19
+ gem.add_runtime_dependency 'cookiejar', '~> 0.3' # HTTP cookies
20
+ gem.add_runtime_dependency 'ipaddress', '~> 0.8' # IP address validation
21
+ gem.add_runtime_dependency 'addressable', '~> 2.4' # URI parser
22
+ gem.add_runtime_dependency 'http-parser', '~> 1.2' # HTTP tokeniser
25
23
 
26
- gem.add_development_dependency 'rspec', '>= 2.14'
27
- gem.add_development_dependency 'rake', '>= 10.1'
28
- gem.add_development_dependency 'yard'
24
+ # HTTP authentication helpers
25
+ gem.add_runtime_dependency 'rubyntlm', '~> 0.6'
26
+ gem.add_runtime_dependency 'net-http-digest_auth', '~> 1.4'
27
+
28
+ gem.add_development_dependency 'rspec', '~> 3.5'
29
+ gem.add_development_dependency 'rake', '~> 11.2'
30
+ gem.add_development_dependency 'yard', '~> 0.9'
29
31
 
30
32
  gem.files = Dir["{lib}/**/*"] + %w(Rakefile uv-rays.gemspec README.md LICENSE)
31
33
  gem.test_files = Dir["spec/**/*"]
metadata CHANGED
@@ -1,183 +1,183 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uv-rays
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.8
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen von Takach
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-11 00:00:00.000000000 Z
11
+ date: 2016-10-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: libuv
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 2.0.0
19
+ version: '3.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: 2.0.0
26
+ version: '3.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bisect
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: '0.1'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '0'
40
+ version: '0.1'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: tzinfo
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '0'
47
+ version: '1.2'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '0'
54
+ version: '1.2'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: cookiejar
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ">="
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '0'
61
+ version: '0.3'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ">="
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '0'
68
+ version: '0.3'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: ipaddress
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ">="
73
+ - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '0'
75
+ version: '0.8'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ">="
80
+ - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '0'
82
+ version: '0.8'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: addressable
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ">="
87
+ - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '0'
89
+ version: '2.4'
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ">="
94
+ - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '0'
96
+ version: '2.4'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: http-parser
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ">="
101
+ - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: 1.0.4
103
+ version: '1.2'
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - ">="
108
+ - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: 1.0.4
110
+ version: '1.2'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: rubyntlm
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - ">="
115
+ - - "~>"
116
116
  - !ruby/object:Gem::Version
117
- version: '0'
117
+ version: '0.6'
118
118
  type: :runtime
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - ">="
122
+ - - "~>"
123
123
  - !ruby/object:Gem::Version
124
- version: '0'
124
+ version: '0.6'
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: net-http-digest_auth
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - ">="
129
+ - - "~>"
130
130
  - !ruby/object:Gem::Version
131
- version: '0'
131
+ version: '1.4'
132
132
  type: :runtime
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
- - - ">="
136
+ - - "~>"
137
137
  - !ruby/object:Gem::Version
138
- version: '0'
138
+ version: '1.4'
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: rspec
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
- - - ">="
143
+ - - "~>"
144
144
  - !ruby/object:Gem::Version
145
- version: '2.14'
145
+ version: '3.5'
146
146
  type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
- - - ">="
150
+ - - "~>"
151
151
  - !ruby/object:Gem::Version
152
- version: '2.14'
152
+ version: '3.5'
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: rake
155
155
  requirement: !ruby/object:Gem::Requirement
156
156
  requirements:
157
- - - ">="
157
+ - - "~>"
158
158
  - !ruby/object:Gem::Version
159
- version: '10.1'
159
+ version: '11.2'
160
160
  type: :development
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
- - - ">="
164
+ - - "~>"
165
165
  - !ruby/object:Gem::Version
166
- version: '10.1'
166
+ version: '11.2'
167
167
  - !ruby/object:Gem::Dependency
168
168
  name: yard
169
169
  requirement: !ruby/object:Gem::Requirement
170
170
  requirements:
171
- - - ">="
171
+ - - "~>"
172
172
  - !ruby/object:Gem::Version
173
- version: '0'
173
+ version: '0.9'
174
174
  type: :development
175
175
  prerelease: false
176
176
  version_requirements: !ruby/object:Gem::Requirement
177
177
  requirements:
178
- - - ">="
178
+ - - "~>"
179
179
  - !ruby/object:Gem::Version
180
- version: '0'
180
+ version: '0.9'
181
181
  description: Opinionated abstractions for Libuv
182
182
  email:
183
183
  - steve@cotag.me
@@ -189,6 +189,7 @@ files:
189
189
  - LICENSE
190
190
  - README.md
191
191
  - Rakefile
192
+ - lib/faraday/adapter/libuv.rb
192
193
  - lib/uv-rays.rb
193
194
  - lib/uv-rays/abstract_tokenizer.rb
194
195
  - lib/uv-rays/buffered_tokenizer.rb
@@ -222,7 +223,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
222
223
  requirements:
223
224
  - - ">="
224
225
  - !ruby/object:Gem::Version
225
- version: 1.9.2
226
+ version: 2.0.0
226
227
  required_rubygems_version: !ruby/object:Gem::Requirement
227
228
  requirements:
228
229
  - - ">="
@@ -242,4 +243,3 @@ test_files:
242
243
  - spec/scheduler_cron_spec.rb
243
244
  - spec/scheduler_spec.rb
244
245
  - spec/scheduler_time_spec.rb
245
- has_rdoc: