mygegegems 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: deda87a5957026286a659350a24c2bc19a38599e
4
- data.tar.gz: 396693b54e065d040e45b39783723334a6707622
3
+ metadata.gz: 88baa7d4a88c16a0c501eab1e8a7b355b11793a6
4
+ data.tar.gz: a9c1423fdcaf7b39834f8a077f9cfafd25dd8807
5
5
  SHA512:
6
- metadata.gz: 48d56fd754e23f7baeb419fc1006da98fa0c552d5f64fdd958786c0bbf031a598501cea08a8537f4c2228d99a9fe507441c1f682bb6da7c713e5f61739de67a3
7
- data.tar.gz: 9e94366406bf857b57ec914a5f25c96dcf72d67ebd126ac0fb12eb9e7b23300fddabb96f1a708f7df7565bbc8decfab8514c40c75b491a72bfae43a84ffb2f31
6
+ metadata.gz: ba6a7afff78ffb73b2d9965c2b2555c5197809398c2526b42a703fabc923792f71ca5ffac07e57c0c77cb523b00876827bf499b6df8209b2eef415465065099a
7
+ data.tar.gz: b4cc5072f9d58820ac99a1c8de22dee32adabebfb0b9c7eb50ea73389ff6a7d648632cc35a60a9f01bf0bc5e2e3ad6db1e12dd9d4649fa0d510258b8db0a3762
data/README.ja.md ADDED
@@ -0,0 +1,224 @@
1
+ #Mygegegems
2
+
3
+ <!--original
4
+ # Mygegegems
5
+ -->
6
+
7
+ あなたのgemsのダウンロード数をリポートします。
8
+
9
+ <!--original
10
+ Report download numbers of you gems.
11
+ -->
12
+
13
+ ## インストール
14
+
15
+ <!--original
16
+ ## Installation
17
+ -->
18
+
19
+ アプリケーションのGemfileに次の行を追加して、
20
+
21
+ <!--original
22
+ Add this line to your application's Gemfile:
23
+ -->
24
+
25
+ gem 'mygegegems'
26
+
27
+
28
+ <!--original
29
+ gem 'mygegegems'
30
+ -->
31
+
32
+ 以下を実行するか、
33
+
34
+ <!--original
35
+ And then execute:
36
+ -->
37
+
38
+ $ bundle
39
+
40
+
41
+ <!--original
42
+ $ bundle
43
+ -->
44
+
45
+ ご自身で次のようにインストールします。
46
+
47
+ <!--original
48
+ Or install it yourself as:
49
+ -->
50
+
51
+ $ gem install mygegegems
52
+
53
+
54
+ <!--original
55
+ $ gem install mygegegems
56
+ -->
57
+
58
+ ## 使い方
59
+
60
+ <!--original
61
+ ## Usage
62
+ -->
63
+
64
+ Mygegegemsは、`mygegegems`ターミナルコマンドを持っています。
65
+
66
+ <!--original
67
+ Mygegegems has `mygegegems` terminal command.
68
+ -->
69
+
70
+ % mygegegems help
71
+ Commands:
72
+ mygegegems help [COMMAND] # Describe available commands or one specific command
73
+ mygegegems stat # Show stat of your gems
74
+ mygegegems update # Get latest stat from rubygems.org and update local database
75
+ mygegegems version # Show Mygegegems version
76
+
77
+
78
+ <!--original
79
+ % mygegegems help
80
+ Commands:
81
+ mygegegems help [COMMAND] # Describe available commands or one specific command
82
+ mygegegems stat # Show stat of your gems
83
+ mygegegems update # Get latest stat from rubygems.org and update local database
84
+ mygegegems version # Show Mygegegems version
85
+ -->
86
+
87
+ ### updateタスク
88
+
89
+ <!--original
90
+ ### update task
91
+ -->
92
+
93
+ `mygegegems update`は rubygems.orgからあなたのgemのダウンロードデータを取得し、ローカルデータベース( `~.mygegegems.yaml`)を更新します。
94
+
95
+ <!--original
96
+ `mygegegems update` gets download data of your gems from rubygems.org and update local database(`~/.mygegegems.yaml`).
97
+ -->
98
+
99
+ ### statタスク
100
+
101
+ <!--original
102
+ ### stat task
103
+ -->
104
+
105
+ `mygegegems stat`はローカルデータベースからのダウンロードデータをプリントします。
106
+
107
+ <!--original
108
+ `mygegegems stat` prints download data from the local database:
109
+ -->
110
+
111
+ % mygegegems stat
112
+ As of 2014-07-13 (last: 2014-07-12)
113
+ -----------------------------------
114
+ 14061 +1 gviz
115
+ 9349 +0 colorable
116
+ 7175 +0 flippy
117
+ 6173 +0 maliq
118
+ 4505 +0 hateda2md
119
+ 3345 +0 let_it_fall
120
+ 2784 +0 dir_friend
121
+ 2357 +0 yampla
122
+ 2225 +0 togglate
123
+ 1656 +0 ctoD
124
+ 1072 +0 gsub_filter
125
+ 977 +0 hatebu_entry
126
+ 762 +0 emot
127
+ 401 +0 money_exchange
128
+ 370 +0 itunes_track
129
+ 369 +3 gh-diff
130
+ 349 +0 sinatra_websocket_template
131
+ 301 +0 tildoc
132
+ 299 +0 matreska
133
+ 83 - mygegegems
134
+ -----------------------------------
135
+ 58613 +4 20 gems
136
+
137
+
138
+ <!--original
139
+ % mygegegems stat
140
+ As of 2014-07-13 (last: 2014-07-12)
141
+ -----------------------------------
142
+ 14061 +1 gviz
143
+ 9349 +0 colorable
144
+ 7175 +0 flippy
145
+ 6173 +0 maliq
146
+ 4505 +0 hateda2md
147
+ 3345 +0 let_it_fall
148
+ 2784 +0 dir_friend
149
+ 2357 +0 yampla
150
+ 2225 +0 togglate
151
+ 1656 +0 ctoD
152
+ 1072 +0 gsub_filter
153
+ 977 +0 hatebu_entry
154
+ 762 +0 emot
155
+ 401 +0 money_exchange
156
+ 370 +0 itunes_track
157
+ 369 +3 gh-diff
158
+ 349 +0 sinatra_websocket_template
159
+ 301 +0 tildoc
160
+ 299 +0 matreska
161
+ 83 - mygegegems
162
+ -----------------------------------
163
+ 58613 +4 20 gems
164
+ -->
165
+
166
+ `stat`にはいくつかのオプションがあります。
167
+
168
+ <!--original
169
+ `stat` has some options:
170
+ -->
171
+
172
+ %mygegegems help stat
173
+ Usage:
174
+ mygegegems stat
175
+
176
+ Options:
177
+ -t, [--target=TARGET] # Target to compare. any of 'last', 'last_month' or 'last_year'
178
+ # Default: last
179
+ -u, [--update], [--no-update] # Update local data before showing stat
180
+ -h, [--handle=HANDLE] # Show stat of gems of a user with given handle
181
+ -s, [--sort=SORT] # Sort a list by given title. any of 'name', 'diff' or 'download'
182
+ # Default: download
183
+
184
+ Show stat of your gems
185
+
186
+
187
+
188
+ <!--original
189
+ %mygegegems help stat
190
+ Usage:
191
+ mygegegems stat
192
+
193
+ Options:
194
+ -t, [--target=TARGET] # Target to compare. any of 'last', 'last_month' or 'last_year'
195
+ # Default: last
196
+ -u, [--update], [--no-update] # Update local data before showing stat
197
+ -h, [--handle=HANDLE] # Show stat of gems of a user with given handle
198
+ -s, [--sort=SORT] # Sort a list by given title. any of 'name', 'diff' or 'download'
199
+ # Default: download
200
+
201
+ Show stat of your gems
202
+
203
+ -->
204
+
205
+ ## Contributing
206
+
207
+ <!--original
208
+ ## Contributing
209
+ -->
210
+
211
+ 1. Fork it ( https://github.com/[my-github-username]/mygegegems/fork )
212
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
213
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
214
+ 4. Push to the branch (`git push origin my-new-feature`)
215
+ 5. Create a new Pull Request
216
+
217
+ <!--original
218
+ 1. Fork it ( https://github.com/[my-github-username]/mygegegems/fork )
219
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
220
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
221
+ 4. Push to the branch (`git push origin my-new-feature`)
222
+ 5. Create a new Pull Request
223
+ -->
224
+
data/README.md CHANGED
@@ -18,7 +18,65 @@ Or install it yourself as:
18
18
 
19
19
  ## Usage
20
20
 
21
- `mygegegems help` command helps you.
21
+ Mygegegems has `mygegegems` terminal command.
22
+
23
+ % mygegegems help
24
+ Commands:
25
+ mygegegems help [COMMAND] # Describe available commands or one specific command
26
+ mygegegems stat # Show stat of your gems
27
+ mygegegems update # Get latest stat from rubygems.org and update local database
28
+ mygegegems version # Show Mygegegems version
29
+
30
+ ### update task
31
+
32
+ `mygegegems update` gets download data of your gems from rubygems.org and update local database(`~/.mygegegems.yaml`).
33
+
34
+ ### stat task
35
+
36
+ `mygegegems stat` prints download data from the local database:
37
+
38
+ % mygegegems stat
39
+ As of 2014-07-13 (last: 2014-07-12)
40
+ -----------------------------------
41
+ 14061 +1 gviz
42
+ 9349 +0 colorable
43
+ 7175 +0 flippy
44
+ 6173 +0 maliq
45
+ 4505 +0 hateda2md
46
+ 3345 +0 let_it_fall
47
+ 2784 +0 dir_friend
48
+ 2357 +0 yampla
49
+ 2225 +0 togglate
50
+ 1656 +0 ctoD
51
+ 1072 +0 gsub_filter
52
+ 977 +0 hatebu_entry
53
+ 762 +0 emot
54
+ 401 +0 money_exchange
55
+ 370 +0 itunes_track
56
+ 369 +3 gh-diff
57
+ 349 +0 sinatra_websocket_template
58
+ 301 +0 tildoc
59
+ 299 +0 matreska
60
+ 83 - mygegegems
61
+ -----------------------------------
62
+ 58613 +4 20 gems
63
+
64
+ `stat` has some options:
65
+
66
+ %mygegegems help stat
67
+ Usage:
68
+ mygegegems stat
69
+
70
+ Options:
71
+ -t, [--target=TARGET] # Target to compare. any of 'last', 'last_month' or 'last_year'
72
+ # Default: last
73
+ -u, [--update], [--no-update] # Update local data before showing stat
74
+ -h, [--handle=HANDLE] # Show stat of gems of a user with given handle
75
+ -s, [--sort=SORT] # Sort a list by given title. any of 'name', 'diff' or 'download'
76
+ # Default: download
77
+
78
+ Show stat of your gems
79
+
22
80
 
23
81
  ## Contributing
24
82
 
data/lib/mygegegems.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  require "yaml"
2
2
  require "gems"
3
+ require "colcolor"
3
4
 
4
5
  require "mygegegems/version"
5
6
  require "mygegegems/client"
@@ -66,7 +66,8 @@ module Mygegegems
66
66
 
67
67
  no_tasks do
68
68
  def header(date1, date2, label)
69
- "As of #{date1} (#{label}: \e[33m#{date2}\e[0m)"
69
+ line = "As of #{date1} (#{label}: #{date2})"
70
+ line.colco(:yellow, regexp:/(?<=\s)\S+(?=\)$)/)
70
71
  end
71
72
 
72
73
  def body(gems, diffs, space1, space2, sort)
@@ -82,17 +83,21 @@ module Mygegegems
82
83
  end
83
84
  }.map { |dl, diff, name|
84
85
  if diff >= 0
85
- "%#{space1}d \e[33m+%#{space2}d \e[32m%s\e[0m" % [dl, diff, name]
86
+ line = "%#{space1}d +%#{space2}d %s" % [dl, diff, name]
87
+ re = /\+\s*\d+|\S+/
88
+ line.colco(nil, :yellow, :green, regexp:re)
86
89
  else
87
90
  none = "-".center(space2)
88
- "%#{space1}d \e[33m#{none} \e[32m%s\e[0m" % [dl, name]
91
+ line = "%#{space1}d #{none} %s" % [dl, name]
92
+ line.colco(nil, :yellow, :green)
89
93
  end
90
94
  }
91
95
  end
92
96
 
93
97
  def footer(total, diff_total, num_of_gems, space1=0, space2=0)
94
98
  if diff_total
95
- "%#{space1}d \e[33m+%#{space2}d \e[32m%s gems\e[0m" % [total, diff_total, num_of_gems]
99
+ line = "%#{space1}d +%#{space2}d %s gems" % [total, diff_total, num_of_gems]
100
+ line.colco(nil, :yellow, :green, :green)
96
101
  else
97
102
  "%#{space1}d %s gems" % [total, num_of_gems]
98
103
  end
@@ -1,3 +1,3 @@
1
1
  module Mygegegems
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
data/mygegegems.gemspec CHANGED
@@ -19,6 +19,7 @@ Gem::Specification.new do |spec|
19
19
 
20
20
  spec.add_dependency 'gems'
21
21
  spec.add_dependency 'thor'
22
+ spec.add_dependency 'colcolor', ">= 0.0.3"
22
23
  spec.add_development_dependency "bundler", "~> 1.6"
23
24
  spec.add_development_dependency "rake"
24
25
  spec.add_development_dependency "rspec"
data/spec/cli_spec.rb CHANGED
@@ -19,14 +19,14 @@ describe Mygegegems::CLI do
19
19
  expect($stdout.string).to eq ~<<-EOS
20
20
  As of 2014-07-11 (last: \e[33m2014-07-10\e[0m)
21
21
  -----------------------------------
22
- 3345 \e[33m+ 0 \e[32mlet_it_fall\e[0m
23
- 2225 \e[33m+100 \e[32mtogglate\e[0m
24
- 762 \e[33m+ 2 \e[32memot\e[0m
25
- 354 \e[33m+ 14 \e[32mgh-diff\e[0m
26
- 299 \e[33m+ 18 \e[32mmatreska\e[0m
27
- 297 \e[33m+ 30 \e[32mtildoc\e[0m
22
+ 3345 \e[33m+ 0\e[0m \e[32mlet_it_fall\e[0m
23
+ 2225 \e[33m+100\e[0m \e[32mtogglate\e[0m
24
+ 762 \e[33m+ 2\e[0m \e[32memot\e[0m
25
+ 354 \e[33m+ 14\e[0m \e[32mgh-diff\e[0m
26
+ 299 \e[33m+ 18\e[0m \e[32mmatreska\e[0m
27
+ 297 \e[33m+ 30\e[0m \e[32mtildoc\e[0m
28
28
  -----------------------------------
29
- 7282 \e[33m+164 \e[32m6 gems\e[0m
29
+ 7282 \e[33m+164\e[0m \e[32m6\e[0m \e[32mgems\e[0m
30
30
  EOS
31
31
  end
32
32
 
@@ -36,14 +36,14 @@ describe Mygegegems::CLI do
36
36
  expect($stdout.string).to eq ~<<-EOS
37
37
  As of 2014-07-11 (last_month: \e[33m2014-06-30\e[0m)
38
38
  -----------------------------------------
39
- 3345 \e[33m+123 \e[32mlet_it_fall\e[0m
40
- 2225 \e[33m+225 \e[32mtogglate\e[0m
41
- 762 \e[33m+162 \e[32memot\e[0m
42
- 354 \e[33m - \e[32mgh-diff\e[0m
43
- 299 \e[33m+ 21 \e[32mmatreska\e[0m
44
- 297 \e[33m - \e[32mtildoc\e[0m
39
+ 3345 \e[33m+123\e[0m \e[32mlet_it_fall\e[0m
40
+ 2225 \e[33m+225\e[0m \e[32mtogglate\e[0m
41
+ 762 \e[33m+162\e[0m \e[32memot\e[0m
42
+ 354 \e[33m-\e[0m \e[32mgh-diff\e[0m
43
+ 299 \e[33m+ 21\e[0m \e[32mmatreska\e[0m
44
+ 297 \e[33m-\e[0m \e[32mtildoc\e[0m
45
45
  -----------------------------------------
46
- 7282 \e[33m+531 \e[32m6 gems\e[0m
46
+ 7282 \e[33m+531\e[0m \e[32m6\e[0m \e[32mgems\e[0m
47
47
  EOS
48
48
  end
49
49
  end
@@ -55,22 +55,22 @@ describe Mygegegems::CLI do
55
55
  expect($stdout.string).to eq ~<<-EOS
56
56
  mojombo's gems
57
57
  ------------------------------
58
- 4275480 \e[33m - \e[32mchronic\e[0m
59
- 809463 \e[33m - \e[32mjekyll\e[0m
60
- 809290 \e[33m - \e[32mgod\e[0m
61
- 614999 \e[33m - \e[32mgrit\e[0m
62
- 104061 \e[33m - \e[32mgollum\e[0m
63
- 72016 \e[33m - \e[32mbert\e[0m
64
- 71844 \e[33m - \e[32mmercenary\e[0m
65
- 60694 \e[33m - \e[32mgithub\e[0m
66
- 51629 \e[33m - \e[32mbertrpc\e[0m
67
- 45534 \e[33m - \e[32mproxymachine\e[0m
68
- 33418 \e[33m - \e[32mernie\e[0m
69
- 12490 \e[33m - \e[32merlectricity\e[0m
70
- 6766 \e[33m - \e[32mjekyll-import\e[0m
71
- 3209 \e[33m - \e[32msyntaxi\e[0m
72
- 1636 \e[33m - \e[32mfuzed\e[0m
73
- 1465 \e[33m - \e[32mjungle\e[0m
58
+ 4275480 \e[33m-\e[0m \e[32mchronic\e[0m
59
+ 809463 \e[33m-\e[0m \e[32mjekyll\e[0m
60
+ 809290 \e[33m-\e[0m \e[32mgod\e[0m
61
+ 614999 \e[33m-\e[0m \e[32mgrit\e[0m
62
+ 104061 \e[33m-\e[0m \e[32mgollum\e[0m
63
+ 72016 \e[33m-\e[0m \e[32mbert\e[0m
64
+ 71844 \e[33m-\e[0m \e[32mmercenary\e[0m
65
+ 60694 \e[33m-\e[0m \e[32mgithub\e[0m
66
+ 51629 \e[33m-\e[0m \e[32mbertrpc\e[0m
67
+ 45534 \e[33m-\e[0m \e[32mproxymachine\e[0m
68
+ 33418 \e[33m-\e[0m \e[32mernie\e[0m
69
+ 12490 \e[33m-\e[0m \e[32merlectricity\e[0m
70
+ 6766 \e[33m-\e[0m \e[32mjekyll-import\e[0m
71
+ 3209 \e[33m-\e[0m \e[32msyntaxi\e[0m
72
+ 1636 \e[33m-\e[0m \e[32mfuzed\e[0m
73
+ 1465 \e[33m-\e[0m \e[32mjungle\e[0m
74
74
  ------------------------------
75
75
  6973994 16 gems
76
76
  EOS
@@ -84,14 +84,14 @@ describe Mygegegems::CLI do
84
84
  expect($stdout.string).to eq ~<<-EOS
85
85
  As of 2014-07-11 (last: \e[33m2014-07-10\e[0m)
86
86
  -----------------------------------
87
- 762 \e[33m+ 2 \e[32memot\e[0m
88
- 354 \e[33m+ 14 \e[32mgh-diff\e[0m
89
- 3345 \e[33m+ 0 \e[32mlet_it_fall\e[0m
90
- 299 \e[33m+ 18 \e[32mmatreska\e[0m
91
- 297 \e[33m+ 30 \e[32mtildoc\e[0m
92
- 2225 \e[33m+100 \e[32mtogglate\e[0m
87
+ 762 \e[33m+ 2\e[0m \e[32memot\e[0m
88
+ 354 \e[33m+ 14\e[0m \e[32mgh-diff\e[0m
89
+ 3345 \e[33m+ 0\e[0m \e[32mlet_it_fall\e[0m
90
+ 299 \e[33m+ 18\e[0m \e[32mmatreska\e[0m
91
+ 297 \e[33m+ 30\e[0m \e[32mtildoc\e[0m
92
+ 2225 \e[33m+100\e[0m \e[32mtogglate\e[0m
93
93
  -----------------------------------
94
- 7282 \e[33m+164 \e[32m6 gems\e[0m
94
+ 7282 \e[33m+164\e[0m \e[32m6\e[0m \e[32mgems\e[0m
95
95
  EOS
96
96
  end
97
97
 
@@ -100,14 +100,14 @@ describe Mygegegems::CLI do
100
100
  expect($stdout.string).to eq ~<<-EOS
101
101
  As of 2014-07-11 (last: \e[33m2014-07-10\e[0m)
102
102
  -----------------------------------
103
- 2225 \e[33m+100 \e[32mtogglate\e[0m
104
- 297 \e[33m+ 30 \e[32mtildoc\e[0m
105
- 299 \e[33m+ 18 \e[32mmatreska\e[0m
106
- 354 \e[33m+ 14 \e[32mgh-diff\e[0m
107
- 762 \e[33m+ 2 \e[32memot\e[0m
108
- 3345 \e[33m+ 0 \e[32mlet_it_fall\e[0m
103
+ 2225 \e[33m+100\e[0m \e[32mtogglate\e[0m
104
+ 297 \e[33m+ 30\e[0m \e[32mtildoc\e[0m
105
+ 299 \e[33m+ 18\e[0m \e[32mmatreska\e[0m
106
+ 354 \e[33m+ 14\e[0m \e[32mgh-diff\e[0m
107
+ 762 \e[33m+ 2\e[0m \e[32memot\e[0m
108
+ 3345 \e[33m+ 0\e[0m \e[32mlet_it_fall\e[0m
109
109
  -----------------------------------
110
- 7282 \e[33m+164 \e[32m6 gems\e[0m
110
+ 7282 \e[33m+164\e[0m \e[32m6\e[0m \e[32mgems\e[0m
111
111
  EOS
112
112
  end
113
113
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mygegegems
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - kyoendo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-13 00:00:00.000000000 Z
11
+ date: 2014-07-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gems
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: colcolor
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: 0.0.3
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: 0.0.3
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: bundler
43
57
  requirement: !ruby/object:Gem::Requirement
@@ -135,6 +149,7 @@ files:
135
149
  - ".travis.yml"
136
150
  - Gemfile
137
151
  - LICENSE.txt
152
+ - README.ja.md
138
153
  - README.md
139
154
  - Rakefile
140
155
  - bin/mygegegems