cline 0.3.2 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,3 @@
1
1
  module Cline
2
- VERSION = '0.3.2'
2
+ VERSION = '1.0.0'
3
3
  end
@@ -35,7 +35,7 @@ describe Cline::Notification do
35
35
  let!(:notification2) { Fabricate(:notification, notified_at: 3.days.ago.beginning_of_day, display_count: 2) }
36
36
  let!(:notification3) { Fabricate(:notification, notified_at: 2.days.ago.beginning_of_day, display_count: 2) }
37
37
 
38
- context 'pool_size 2' do
38
+ context 'limit 2' do
39
39
  before do
40
40
  Cline::Notification.clean 2
41
41
  end
@@ -47,7 +47,7 @@ describe Cline::Notification do
47
47
  it { should include notification3 }
48
48
  end
49
49
 
50
- context 'pool_size 1' do
50
+ context 'limit 1' do
51
51
  before do
52
52
  Cline::Notification.clean 1
53
53
  end
@@ -64,7 +64,7 @@ describe Cline::Notification do
64
64
  let!(:notification2) { Fabricate(:notification, notified_at: 2.days.ago.beginning_of_day, display_count: 0) }
65
65
 
66
66
  before do
67
- Cline::Notification.display 0
67
+ Cline::Notification.display! 0
68
68
  end
69
69
 
70
70
  subject { Cline::Notification.recent_notified(1).all }
@@ -87,25 +87,17 @@ describe Cline::Notification do
87
87
  its(:message) { should_not match /\n/ }
88
88
  end
89
89
 
90
- describe '.display' do
90
+ describe '.display!' do
91
91
  let!(:notification) { Fabricate(:notification, message: 'hi', notified_at: '2011-01-01 00:00:00', display_count: 0) }
92
92
 
93
- before do
94
- Cline::Notification.display
95
-
96
- Cline.out_stream.rewind
97
- end
93
+ subject { Cline::Notification.display! }
98
94
 
99
95
  describe 'stdout' do
100
- subject { Cline.out_stream.read.strip }
101
-
102
96
  it { should == '[2011/01/01 00:00][0][0] hi' }
103
97
  end
104
98
 
105
- describe 'display_count' do
106
- subject { notification.reload }
107
-
108
- its(:display_count) { should == 1 }
99
+ specify 'display_count should incremented' do
100
+ notification.display_count.should == 0
109
101
  end
110
102
  end
111
103
  end
@@ -0,0 +1,22 @@
1
+ # coding: utf-8
2
+
3
+ require 'spec_helper'
4
+
5
+ describe 'Server' do
6
+ describe 'request from client' do
7
+ before do
8
+ Process.fork { Cline::Command.start(%w(server start)) }
9
+ wait_for_server
10
+
11
+ #Cline::Command.any_instance.should_not_receive(:status)
12
+ end
13
+
14
+ after do
15
+ Cline::Command.start(%w(server stop))
16
+ end
17
+
18
+ subject { capture(:stdout) { Cline::Command.start(%w(server status)) } }
19
+
20
+ it { should =~ /Socket file exists/ }
21
+ end
22
+ end
@@ -7,7 +7,7 @@ require 'fabrication'
7
7
  SimpleCov.start
8
8
 
9
9
  CLINE_ROOT = Pathname.new(File.dirname(__FILE__) + '/../').realpath
10
- require_relative '../lib/cline'
10
+ require 'cline'
11
11
 
12
12
  Dir[File.dirname(__FILE__) + '/support/*'].each {|f| require f }
13
13
  require_relative 'fabricators'
@@ -15,7 +15,7 @@ require_relative 'fabricators'
15
15
  RSpec.configure do |config|
16
16
  config.filter_run focus: true
17
17
  config.run_all_when_everything_filtered = true
18
- config.mock_with :rr
18
+ config.mock_with :rspec
19
19
 
20
20
  config.before(:suite) do
21
21
  home = CLINE_ROOT.join('spec', 'tmp')
@@ -30,7 +30,7 @@ RSpec.configure do |config|
30
30
 
31
31
  config.before(:each) do
32
32
  Cline::Notification.delete_all
33
- Cline.out_stream = StringIO.new
33
+ Cline.notify_io = StringIO.new
34
34
 
35
35
  Cline.boot
36
36
  end
@@ -13,4 +13,12 @@ module ExampleGroupHelper
13
13
 
14
14
  result
15
15
  end
16
+
17
+ def wait_for_server(limit = 3)
18
+ limit.times do
19
+ sleep 2
20
+
21
+ return if Cline::Server.running?
22
+ end
23
+ end
16
24
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cline
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 1.0.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,56 +9,56 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-05-08 00:00:00.000000000 Z
12
+ date: 2013-01-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: thor
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
- - - ! '>='
19
+ - - ~>
20
20
  - !ruby/object:Gem::Version
21
- version: 0.14.6
21
+ version: 0.16.0
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  none: false
26
26
  requirements:
27
- - - ! '>='
27
+ - - ~>
28
28
  - !ruby/object:Gem::Version
29
- version: 0.14.6
29
+ version: 0.16.0
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: activerecord
32
32
  requirement: !ruby/object:Gem::Requirement
33
33
  none: false
34
34
  requirements:
35
- - - ! '>='
35
+ - - ~>
36
36
  - !ruby/object:Gem::Version
37
- version: 3.1.1
37
+ version: 3.1.8
38
38
  type: :runtime
39
39
  prerelease: false
40
40
  version_requirements: !ruby/object:Gem::Requirement
41
41
  none: false
42
42
  requirements:
43
- - - ! '>='
43
+ - - ~>
44
44
  - !ruby/object:Gem::Version
45
- version: 3.1.1
45
+ version: 3.1.8
46
46
  - !ruby/object:Gem::Dependency
47
47
  name: sqlite3
48
48
  requirement: !ruby/object:Gem::Requirement
49
49
  none: false
50
50
  requirements:
51
- - - ! '>='
51
+ - - ~>
52
52
  - !ruby/object:Gem::Version
53
- version: 1.3.4
53
+ version: 1.3.6
54
54
  type: :runtime
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  none: false
58
58
  requirements:
59
- - - ! '>='
59
+ - - ~>
60
60
  - !ruby/object:Gem::Version
61
- version: 1.3.4
61
+ version: 1.3.6
62
62
  - !ruby/object:Gem::Dependency
63
63
  name: feedzirra
64
64
  requirement: !ruby/object:Gem::Requirement
@@ -66,7 +66,7 @@ dependencies:
66
66
  requirements:
67
67
  - - ~>
68
68
  - !ruby/object:Gem::Version
69
- version: 0.0.31
69
+ version: 0.1.3
70
70
  type: :runtime
71
71
  prerelease: false
72
72
  version_requirements: !ruby/object:Gem::Requirement
@@ -74,61 +74,61 @@ dependencies:
74
74
  requirements:
75
75
  - - ~>
76
76
  - !ruby/object:Gem::Version
77
- version: 0.0.31
77
+ version: 0.1.3
78
78
  - !ruby/object:Gem::Dependency
79
79
  name: notify
80
80
  requirement: !ruby/object:Gem::Requirement
81
81
  none: false
82
82
  requirements:
83
- - - ! '>='
83
+ - - ~>
84
84
  - !ruby/object:Gem::Version
85
- version: 0.3.0
85
+ version: 0.4.0
86
86
  type: :runtime
87
87
  prerelease: false
88
88
  version_requirements: !ruby/object:Gem::Requirement
89
89
  none: false
90
90
  requirements:
91
- - - ! '>='
91
+ - - ~>
92
92
  - !ruby/object:Gem::Version
93
- version: 0.3.0
93
+ version: 0.4.0
94
94
  - !ruby/object:Gem::Dependency
95
95
  name: launchy
96
96
  requirement: !ruby/object:Gem::Requirement
97
97
  none: false
98
98
  requirements:
99
- - - ! '>='
99
+ - - ~>
100
100
  - !ruby/object:Gem::Version
101
- version: 2.1.0
101
+ version: 2.1.2
102
102
  type: :runtime
103
103
  prerelease: false
104
104
  version_requirements: !ruby/object:Gem::Requirement
105
105
  none: false
106
106
  requirements:
107
- - - ! '>='
107
+ - - ~>
108
108
  - !ruby/object:Gem::Version
109
- version: 2.1.0
109
+ version: 2.1.2
110
110
  - !ruby/object:Gem::Dependency
111
111
  name: rake
112
112
  requirement: !ruby/object:Gem::Requirement
113
113
  none: false
114
114
  requirements:
115
- - - ! '>='
115
+ - - ~>
116
116
  - !ruby/object:Gem::Version
117
- version: 0.9.2
117
+ version: 10.0.2
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  none: false
122
122
  requirements:
123
- - - ! '>='
123
+ - - ~>
124
124
  - !ruby/object:Gem::Version
125
- version: 0.9.2
125
+ version: 10.0.2
126
126
  - !ruby/object:Gem::Dependency
127
- name: ir_b
127
+ name: tapp
128
128
  requirement: !ruby/object:Gem::Requirement
129
129
  none: false
130
130
  requirements:
131
- - - ! '>='
131
+ - - ~>
132
132
  - !ruby/object:Gem::Version
133
133
  version: 1.4.0
134
134
  type: :development
@@ -136,122 +136,90 @@ dependencies:
136
136
  version_requirements: !ruby/object:Gem::Requirement
137
137
  none: false
138
138
  requirements:
139
- - - ! '>='
139
+ - - ~>
140
140
  - !ruby/object:Gem::Version
141
141
  version: 1.4.0
142
- - !ruby/object:Gem::Dependency
143
- name: tapp
144
- requirement: !ruby/object:Gem::Requirement
145
- none: false
146
- requirements:
147
- - - ! '>='
148
- - !ruby/object:Gem::Version
149
- version: 1.1.0
150
- type: :development
151
- prerelease: false
152
- version_requirements: !ruby/object:Gem::Requirement
153
- none: false
154
- requirements:
155
- - - ! '>='
156
- - !ruby/object:Gem::Version
157
- version: 1.1.0
158
142
  - !ruby/object:Gem::Dependency
159
143
  name: rspec
160
144
  requirement: !ruby/object:Gem::Requirement
161
145
  none: false
162
146
  requirements:
163
- - - ! '>='
164
- - !ruby/object:Gem::Version
165
- version: 2.6.0
166
- type: :development
167
- prerelease: false
168
- version_requirements: !ruby/object:Gem::Requirement
169
- none: false
170
- requirements:
171
- - - ! '>='
172
- - !ruby/object:Gem::Version
173
- version: 2.6.0
174
- - !ruby/object:Gem::Dependency
175
- name: rr
176
- requirement: !ruby/object:Gem::Requirement
177
- none: false
178
- requirements:
179
- - - ! '>='
147
+ - - ~>
180
148
  - !ruby/object:Gem::Version
181
- version: 1.0.4
149
+ version: 2.12.0
182
150
  type: :development
183
151
  prerelease: false
184
152
  version_requirements: !ruby/object:Gem::Requirement
185
153
  none: false
186
154
  requirements:
187
- - - ! '>='
155
+ - - ~>
188
156
  - !ruby/object:Gem::Version
189
- version: 1.0.4
157
+ version: 2.12.0
190
158
  - !ruby/object:Gem::Dependency
191
159
  name: fabrication
192
160
  requirement: !ruby/object:Gem::Requirement
193
161
  none: false
194
162
  requirements:
195
- - - ! '>='
163
+ - - ~>
196
164
  - !ruby/object:Gem::Version
197
- version: 1.2.0
165
+ version: 2.5.0
198
166
  type: :development
199
167
  prerelease: false
200
168
  version_requirements: !ruby/object:Gem::Requirement
201
169
  none: false
202
170
  requirements:
203
- - - ! '>='
171
+ - - ~>
204
172
  - !ruby/object:Gem::Version
205
- version: 1.2.0
173
+ version: 2.5.0
206
174
  - !ruby/object:Gem::Dependency
207
175
  name: fuubar
208
176
  requirement: !ruby/object:Gem::Requirement
209
177
  none: false
210
178
  requirements:
211
- - - ! '>='
179
+ - - ~>
212
180
  - !ruby/object:Gem::Version
213
- version: 0.0.6
181
+ version: 1.1.0
214
182
  type: :development
215
183
  prerelease: false
216
184
  version_requirements: !ruby/object:Gem::Requirement
217
185
  none: false
218
186
  requirements:
219
- - - ! '>='
187
+ - - ~>
220
188
  - !ruby/object:Gem::Version
221
- version: 0.0.6
189
+ version: 1.1.0
222
190
  - !ruby/object:Gem::Dependency
223
191
  name: simplecov
224
192
  requirement: !ruby/object:Gem::Requirement
225
193
  none: false
226
194
  requirements:
227
- - - ! '>='
195
+ - - ~>
228
196
  - !ruby/object:Gem::Version
229
- version: 0.5.3
197
+ version: 0.7.1
230
198
  type: :development
231
199
  prerelease: false
232
200
  version_requirements: !ruby/object:Gem::Requirement
233
201
  none: false
234
202
  requirements:
235
- - - ! '>='
203
+ - - ~>
236
204
  - !ruby/object:Gem::Version
237
- version: 0.5.3
205
+ version: 0.7.1
238
206
  - !ruby/object:Gem::Dependency
239
207
  name: activesupport
240
208
  requirement: !ruby/object:Gem::Requirement
241
209
  none: false
242
210
  requirements:
243
- - - ! '>='
211
+ - - ~>
244
212
  - !ruby/object:Gem::Version
245
- version: 3.1.1
213
+ version: 3.1.8
246
214
  type: :development
247
215
  prerelease: false
248
216
  version_requirements: !ruby/object:Gem::Requirement
249
217
  none: false
250
218
  requirements:
251
- - - ! '>='
219
+ - - ~>
252
220
  - !ruby/object:Gem::Version
253
- version: 3.1.1
254
- description: Cline - CLI Line Notifier
221
+ version: 3.1.8
222
+ description: Show recently news on the terminal.
255
223
  email:
256
224
  - celluloid.key@gmail.com
257
225
  executables:
@@ -268,13 +236,17 @@ files:
268
236
  - bin/cline
269
237
  - cline.gemspec
270
238
  - lib/cline.rb
239
+ - lib/cline/client.rb
271
240
  - lib/cline/collectors.rb
272
241
  - lib/cline/collectors/feed.rb
273
242
  - lib/cline/collectors/github.rb
274
243
  - lib/cline/command.rb
275
244
  - lib/cline/configure.rb
245
+ - lib/cline/monkey.rb
276
246
  - lib/cline/notification.rb
277
- - lib/cline/out_streams.rb
247
+ - lib/cline/notify_io.rb
248
+ - lib/cline/scheduled_job.rb
249
+ - lib/cline/server.rb
278
250
  - lib/cline/version.rb
279
251
  - spec/fabricators.rb
280
252
  - spec/fixtures/github/commit_comment_event.json
@@ -293,13 +265,18 @@ files:
293
265
  - spec/lib/cline_spec.rb
294
266
  - spec/lib/collectors_spec.rb
295
267
  - spec/lib/notification_spec.rb
268
+ - spec/lib/server_spec.rb
296
269
  - spec/spec_helper.rb
297
270
  - spec/support/.gitkeep
298
271
  - spec/support/example_group_helper.rb
299
272
  - spec/tmp/.gitkeep
300
273
  homepage: https://github.com/hibariya/cline
301
274
  licenses: []
302
- post_install_message:
275
+ post_install_message: ! " **Important changes**\n\n `tick` command usage has
276
+ changed.\n\n `cline tick OFFSET INTERVAL' -> `cline tick INTERVAL OFFSET'\n\n
277
+ \ **Cline server is available**\n\n Cline uses daemon process if it's running.\n\n
278
+ \ $ cline server start # start server\n $ cline server stop # stop server\n
279
+ \ $ cline server reload # reload config file\n"
303
280
  rdoc_options: []
304
281
  require_paths:
305
282
  - lib
@@ -309,24 +286,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
309
286
  - - ! '>='
310
287
  - !ruby/object:Gem::Version
311
288
  version: '0'
312
- segments:
313
- - 0
314
- hash: 1106592691410534694
315
289
  required_rubygems_version: !ruby/object:Gem::Requirement
316
290
  none: false
317
291
  requirements:
318
292
  - - ! '>='
319
293
  - !ruby/object:Gem::Version
320
294
  version: '0'
321
- segments:
322
- - 0
323
- hash: 1106592691410534694
324
295
  requirements: []
325
296
  rubyforge_project:
326
297
  rubygems_version: 1.8.23
327
298
  signing_key:
328
299
  specification_version: 3
329
- summary: CLI Line Notifier
300
+ summary: Show recently news on the terminal
330
301
  test_files:
331
302
  - spec/fabricators.rb
332
303
  - spec/fixtures/github/commit_comment_event.json
@@ -345,6 +316,7 @@ test_files:
345
316
  - spec/lib/cline_spec.rb
346
317
  - spec/lib/collectors_spec.rb
347
318
  - spec/lib/notification_spec.rb
319
+ - spec/lib/server_spec.rb
348
320
  - spec/spec_helper.rb
349
321
  - spec/support/.gitkeep
350
322
  - spec/support/example_group_helper.rb