cline 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +3 -0
- data/README.md +1 -2
- data/lib/cline/command.rb +17 -5
- data/lib/cline/fetchers.rb +6 -1
- data/lib/cline/version.rb +1 -1
- data/spec/tmp/.gitkeep +0 -0
- metadata +31 -28
data/.travis.yml
ADDED
data/README.md
CHANGED
data/lib/cline/command.rb
CHANGED
@@ -7,13 +7,20 @@ module Cline
|
|
7
7
|
super
|
8
8
|
end
|
9
9
|
|
10
|
-
|
10
|
+
map '-s' => :show,
|
11
|
+
'-t' => :tick,
|
12
|
+
'-s' => :status,
|
13
|
+
'-f' => :fetch,
|
14
|
+
'-i' => :init,
|
15
|
+
'-v' => :version
|
16
|
+
|
17
|
+
desc 'show', 'Show a latest message'
|
11
18
|
method_options offset: :integer
|
12
19
|
def show(offset = options[:offset] || 0)
|
13
20
|
Notification.display offset
|
14
21
|
end
|
15
22
|
|
16
|
-
desc 'tick', '
|
23
|
+
desc 'tick', 'Rotate message'
|
17
24
|
method_options offset: :integer, interval: :integer
|
18
25
|
def tick(offset = options[:offset] || 0, interval = options[:interval] || 60)
|
19
26
|
loop do
|
@@ -22,18 +29,18 @@ module Cline
|
|
22
29
|
end
|
23
30
|
end
|
24
31
|
|
25
|
-
desc 'status', '
|
32
|
+
desc 'status', 'Show status'
|
26
33
|
def status
|
27
34
|
say "displayed : #{Notification.displayed.count}", :green
|
28
35
|
say "total : #{Notification.count}", :cyan
|
29
36
|
end
|
30
37
|
|
31
|
-
desc 'fetch', '
|
38
|
+
desc 'fetch', 'Fetch sources'
|
32
39
|
def fetch
|
33
40
|
Cline.fetchers.each &:fetch
|
34
41
|
end
|
35
42
|
|
36
|
-
desc 'init', '
|
43
|
+
desc 'init', 'Init database'
|
37
44
|
def init
|
38
45
|
ActiveRecord::Base.connection.create_table(:notifications) do |t|
|
39
46
|
t.text :message, null: false, default: ''
|
@@ -41,5 +48,10 @@ module Cline
|
|
41
48
|
t.datetime :time, null: false
|
42
49
|
end
|
43
50
|
end
|
51
|
+
|
52
|
+
desc 'version', 'Show version.'
|
53
|
+
def version
|
54
|
+
say "cline version #{Cline::VERSION}"
|
55
|
+
end
|
44
56
|
end
|
45
57
|
end
|
data/lib/cline/fetchers.rb
CHANGED
@@ -8,7 +8,12 @@ module Cline::Fetchers
|
|
8
8
|
|
9
9
|
entries.each do |entry|
|
10
10
|
message = "#{entry.title} #{entry.url}"
|
11
|
-
|
11
|
+
|
12
|
+
begin
|
13
|
+
Cline::Notification.tap {|n| n.find_by_message(message) || n.create(message: message, time: entry.published) }
|
14
|
+
rescue ActiveRecord::StatementInvalid => e
|
15
|
+
puts e.class, e.message
|
16
|
+
end
|
12
17
|
end
|
13
18
|
end
|
14
19
|
|
data/lib/cline/version.rb
CHANGED
data/spec/tmp/.gitkeep
ADDED
File without changes
|
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.1.
|
4
|
+
version: 0.1.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-11-
|
12
|
+
date: 2011-11-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: thor
|
16
|
-
requirement: &
|
16
|
+
requirement: &70162540537320 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 0.14.6
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70162540537320
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: activerecord
|
27
|
-
requirement: &
|
27
|
+
requirement: &70162540536780 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 3.1.1
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70162540536780
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: sqlite3
|
38
|
-
requirement: &
|
38
|
+
requirement: &70162540536240 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: 1.3.4
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70162540536240
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: feedzirra
|
49
|
-
requirement: &
|
49
|
+
requirement: &70162540535740 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: 0.0.31
|
55
55
|
type: :runtime
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70162540535740
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: rake
|
60
|
-
requirement: &
|
60
|
+
requirement: &70162540535160 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: 0.9.2
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *70162540535160
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: ir_b
|
71
|
-
requirement: &
|
71
|
+
requirement: &70162540534560 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ! '>='
|
@@ -76,10 +76,10 @@ dependencies:
|
|
76
76
|
version: 1.4.0
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *70162540534560
|
80
80
|
- !ruby/object:Gem::Dependency
|
81
81
|
name: tapp
|
82
|
-
requirement: &
|
82
|
+
requirement: &70162540533880 !ruby/object:Gem::Requirement
|
83
83
|
none: false
|
84
84
|
requirements:
|
85
85
|
- - ! '>='
|
@@ -87,10 +87,10 @@ dependencies:
|
|
87
87
|
version: 1.1.0
|
88
88
|
type: :development
|
89
89
|
prerelease: false
|
90
|
-
version_requirements: *
|
90
|
+
version_requirements: *70162540533880
|
91
91
|
- !ruby/object:Gem::Dependency
|
92
92
|
name: rspec
|
93
|
-
requirement: &
|
93
|
+
requirement: &70162540532500 !ruby/object:Gem::Requirement
|
94
94
|
none: false
|
95
95
|
requirements:
|
96
96
|
- - ! '>='
|
@@ -98,10 +98,10 @@ dependencies:
|
|
98
98
|
version: 2.6.0
|
99
99
|
type: :development
|
100
100
|
prerelease: false
|
101
|
-
version_requirements: *
|
101
|
+
version_requirements: *70162540532500
|
102
102
|
- !ruby/object:Gem::Dependency
|
103
103
|
name: rr
|
104
|
-
requirement: &
|
104
|
+
requirement: &70162540532020 !ruby/object:Gem::Requirement
|
105
105
|
none: false
|
106
106
|
requirements:
|
107
107
|
- - ! '>='
|
@@ -109,10 +109,10 @@ dependencies:
|
|
109
109
|
version: 1.0.4
|
110
110
|
type: :development
|
111
111
|
prerelease: false
|
112
|
-
version_requirements: *
|
112
|
+
version_requirements: *70162540532020
|
113
113
|
- !ruby/object:Gem::Dependency
|
114
114
|
name: fabrication
|
115
|
-
requirement: &
|
115
|
+
requirement: &70162540531480 !ruby/object:Gem::Requirement
|
116
116
|
none: false
|
117
117
|
requirements:
|
118
118
|
- - ! '>='
|
@@ -120,10 +120,10 @@ dependencies:
|
|
120
120
|
version: 1.2.0
|
121
121
|
type: :development
|
122
122
|
prerelease: false
|
123
|
-
version_requirements: *
|
123
|
+
version_requirements: *70162540531480
|
124
124
|
- !ruby/object:Gem::Dependency
|
125
125
|
name: fuubar
|
126
|
-
requirement: &
|
126
|
+
requirement: &70162540530720 !ruby/object:Gem::Requirement
|
127
127
|
none: false
|
128
128
|
requirements:
|
129
129
|
- - ! '>='
|
@@ -131,10 +131,10 @@ dependencies:
|
|
131
131
|
version: 0.0.6
|
132
132
|
type: :development
|
133
133
|
prerelease: false
|
134
|
-
version_requirements: *
|
134
|
+
version_requirements: *70162540530720
|
135
135
|
- !ruby/object:Gem::Dependency
|
136
136
|
name: simplecov
|
137
|
-
requirement: &
|
137
|
+
requirement: &70162540529960 !ruby/object:Gem::Requirement
|
138
138
|
none: false
|
139
139
|
requirements:
|
140
140
|
- - ! '>='
|
@@ -142,10 +142,10 @@ dependencies:
|
|
142
142
|
version: 0.5.3
|
143
143
|
type: :development
|
144
144
|
prerelease: false
|
145
|
-
version_requirements: *
|
145
|
+
version_requirements: *70162540529960
|
146
146
|
- !ruby/object:Gem::Dependency
|
147
147
|
name: activesupport
|
148
|
-
requirement: &
|
148
|
+
requirement: &70162540529440 !ruby/object:Gem::Requirement
|
149
149
|
none: false
|
150
150
|
requirements:
|
151
151
|
- - ! '>='
|
@@ -153,7 +153,7 @@ dependencies:
|
|
153
153
|
version: 3.1.1
|
154
154
|
type: :development
|
155
155
|
prerelease: false
|
156
|
-
version_requirements: *
|
156
|
+
version_requirements: *70162540529440
|
157
157
|
description: Cline - CLI Line Notifier
|
158
158
|
email:
|
159
159
|
- celluloid.key@gmail.com
|
@@ -164,6 +164,7 @@ extra_rdoc_files: []
|
|
164
164
|
files:
|
165
165
|
- .gitignore
|
166
166
|
- .rspec
|
167
|
+
- .travis.yml
|
167
168
|
- Gemfile
|
168
169
|
- README.md
|
169
170
|
- Rakefile
|
@@ -180,6 +181,7 @@ files:
|
|
180
181
|
- spec/lib/notification_spec.rb
|
181
182
|
- spec/spec_helper.rb
|
182
183
|
- spec/support/.gitkeep
|
184
|
+
- spec/tmp/.gitkeep
|
183
185
|
homepage: https://github.com/hibariya/cline
|
184
186
|
licenses: []
|
185
187
|
post_install_message:
|
@@ -210,3 +212,4 @@ test_files:
|
|
210
212
|
- spec/lib/notification_spec.rb
|
211
213
|
- spec/spec_helper.rb
|
212
214
|
- spec/support/.gitkeep
|
215
|
+
- spec/tmp/.gitkeep
|