mygegegems 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mygegegems/cli.rb +38 -11
- data/lib/mygegegems/client.rb +7 -2
- data/lib/mygegegems/stat.rb +4 -4
- data/lib/mygegegems/version.rb +1 -1
- data/lib/mygegegems.rb +4 -0
- data/mygegegems.gemspec +2 -0
- data/spec/cassettes/mojombo.yml +246 -0
- data/spec/cli_spec.rb +46 -16
- data/spec/spec_helper.rb +8 -0
- metadata +32 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f952c5f24e2e7c759605e3b9bc916bd75a4c734f
|
4
|
+
data.tar.gz: 3476a80a2482ab5ebffd4c2438a87c8ce58fa39e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 33be3563e85e799cde4ad9c76118daf23513f247e2bd5b8521305750d9d5be5ab3eff5c28382acfdf842a37726cf30a00d9d79c762851387e963150456fb1a47
|
7
|
+
data.tar.gz: 9301ea6ba055e2917c6131332e91c819b8bf6b24e3a08a944e95ff171c11fb62e7ac63ce07e185098fe8deeddc03f97df2c028411326644bdcc3332610ac68e8
|
data/lib/mygegegems/cli.rb
CHANGED
@@ -16,19 +16,42 @@ module Mygegegems
|
|
16
16
|
aliases:'-t',
|
17
17
|
default:'last',
|
18
18
|
desc:"Target to compare. any of 'last', 'last_month' or 'last_year'"
|
19
|
+
option :update,
|
20
|
+
aliases:'-u',
|
21
|
+
default:false,
|
22
|
+
type: :boolean,
|
23
|
+
desc:"Update local data before showing stat"
|
24
|
+
option :handle,
|
25
|
+
aliases:'-h',
|
26
|
+
desc:"Show stat of gems of a user with given handle"
|
19
27
|
def stat
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
28
|
+
if handle = options[:handle]
|
29
|
+
gems = Mygegegems.gems(handle)
|
30
|
+
header = "#{handle}'s gems"
|
31
|
+
border_line = "-" * 30
|
32
|
+
total = gems.inject(0) { |sum, (_, dl)| sum + dl }
|
33
|
+
num_of_gems = gems.size
|
34
|
+
body = body(gems, {}, total.to_s.size, 3)
|
35
|
+
footer = footer(total, nil, gems.size)
|
36
|
+
else
|
37
|
+
invoke(:update, [], {}) if options[:update]
|
38
|
+
|
39
|
+
target = options[:target].intern
|
40
|
+
date, gems = Stat.latest
|
41
|
+
(_, t_date), diffs = Stat.diff(target)
|
42
|
+
total, diff_total, num_of_gems = Stat.total(target)
|
43
|
+
space1, space2 = [total, diff_total].map { |t| t.to_s.size }
|
44
|
+
header = header(date, t_date, target)
|
45
|
+
border_line = "-" * real_size(header)
|
46
|
+
body = body(gems, diffs, space1, space2)
|
47
|
+
footer = footer(total, diff_total, num_of_gems, space1, space2)
|
48
|
+
end
|
26
49
|
|
27
50
|
puts header
|
28
|
-
puts
|
29
|
-
puts body
|
30
|
-
puts
|
31
|
-
puts footer
|
51
|
+
puts border_line
|
52
|
+
puts body
|
53
|
+
puts border_line
|
54
|
+
puts footer
|
32
55
|
end
|
33
56
|
|
34
57
|
no_tasks do
|
@@ -48,13 +71,17 @@ module Mygegegems
|
|
48
71
|
end
|
49
72
|
end
|
50
73
|
|
51
|
-
def footer(total, diff_total, num_of_gems, space1, space2)
|
74
|
+
def footer(total, diff_total, num_of_gems, space1=0, space2=0)
|
52
75
|
if diff_total
|
53
76
|
"%#{space1}d \e[33m+%#{space2}d \e[32m%s gems\e[0m" % [total, diff_total, num_of_gems]
|
54
77
|
else
|
55
78
|
"%#{space1}d %s gems" % [total, num_of_gems]
|
56
79
|
end
|
57
80
|
end
|
81
|
+
|
82
|
+
def real_size(str)
|
83
|
+
str.gsub(/\e\[\d+m/, '').size
|
84
|
+
end
|
58
85
|
end
|
59
86
|
end
|
60
87
|
end
|
data/lib/mygegegems/client.rb
CHANGED
@@ -9,13 +9,18 @@ module Mygegegems
|
|
9
9
|
save(data, @path)
|
10
10
|
end
|
11
11
|
|
12
|
+
def gems(user_handle)
|
13
|
+
get(user_handle)
|
14
|
+
end
|
15
|
+
|
12
16
|
private
|
13
17
|
def data
|
14
18
|
@data ||= load(@path)
|
15
19
|
end
|
16
20
|
|
17
|
-
def get
|
18
|
-
Gems.gems
|
21
|
+
def get(user_handle=nil)
|
22
|
+
Gems.gems(user_handle)
|
23
|
+
.inject({}) { |h, gem| h[gem['name']] = gem['downloads']; h }
|
19
24
|
end
|
20
25
|
|
21
26
|
def load(path)
|
data/lib/mygegegems/stat.rb
CHANGED
@@ -48,10 +48,10 @@ module Mygegegems
|
|
48
48
|
total = gems.inject(0) { |sum, (_, dl)| sum + dl }
|
49
49
|
diff_total =
|
50
50
|
if diffs
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
51
|
+
diffs.inject(0) do |sum, (_, dl)|
|
52
|
+
dl = 0 if dl.nil?
|
53
|
+
sum + dl
|
54
|
+
end
|
55
55
|
else
|
56
56
|
nil
|
57
57
|
end
|
data/lib/mygegegems/version.rb
CHANGED
data/lib/mygegegems.rb
CHANGED
data/mygegegems.gemspec
CHANGED
@@ -0,0 +1,246 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://rubygems.org/api/v1/owners/mojombo/gems.yaml
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Accept-Encoding:
|
11
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
12
|
+
Accept:
|
13
|
+
- "*/*"
|
14
|
+
User-Agent:
|
15
|
+
- Gems 0.8.3
|
16
|
+
- Ruby
|
17
|
+
Authorization:
|
18
|
+
- 62170126500026ba4521a4aaf9dcb275
|
19
|
+
Connection:
|
20
|
+
- keep-alive
|
21
|
+
Keep-Alive:
|
22
|
+
- '30'
|
23
|
+
Content-Type:
|
24
|
+
- application/x-www-form-urlencoded
|
25
|
+
response:
|
26
|
+
status:
|
27
|
+
code: 200
|
28
|
+
message: OK
|
29
|
+
headers:
|
30
|
+
Server:
|
31
|
+
- nginx
|
32
|
+
Date:
|
33
|
+
- Sun, 13 Jul 2014 02:37:17 GMT
|
34
|
+
Content-Type:
|
35
|
+
- text/yaml
|
36
|
+
Transfer-Encoding:
|
37
|
+
- chunked
|
38
|
+
Connection:
|
39
|
+
- keep-alive
|
40
|
+
Status:
|
41
|
+
- 200 OK
|
42
|
+
Content-Disposition:
|
43
|
+
- attachment
|
44
|
+
Content-Transfer-Encoding:
|
45
|
+
- binary
|
46
|
+
Cache-Control:
|
47
|
+
- private
|
48
|
+
X-Content-Type-Options:
|
49
|
+
- nosniff
|
50
|
+
X-Ua-Compatible:
|
51
|
+
- IE=Edge,chrome=1
|
52
|
+
- IE=Edge,chrome=1
|
53
|
+
Etag:
|
54
|
+
- '"8efd4ab32175934163c9082872e55eff"'
|
55
|
+
Set-Cookie:
|
56
|
+
- remember_token=; path=/; expires=Mon, 13-Jul-2015 02:37:17 GMT; secure
|
57
|
+
X-Request-Id:
|
58
|
+
- ce20acc3d66b61a59ffd287324a81a20
|
59
|
+
X-Runtime:
|
60
|
+
- '0.355643'
|
61
|
+
X-Rack-Cache:
|
62
|
+
- miss
|
63
|
+
body:
|
64
|
+
encoding: UTF-8
|
65
|
+
string: "---\n- name: mercenary\n downloads: 71844\n version: 0.3.4\n version_downloads:
|
66
|
+
1028\n platform: ruby\n authors: Tom Preston-Werner, Parker Moore\n info:
|
67
|
+
Lightweight and flexible library for writing command-line apps in Ruby.\n
|
68
|
+
\ licenses:\n - MIT\n project_uri: http://rubygems.org/gems/mercenary\n
|
69
|
+
\ gem_uri: http://rubygems.org/gems/mercenary-0.3.4.gem\n homepage_uri: https://github.com/jekyll/mercenary\n
|
70
|
+
\ wiki_uri: \n documentation_uri: \n mailing_list_uri: \n source_code_uri:
|
71
|
+
\n bug_tracker_uri: \n dependencies:\n development:\n - name: bundler\n
|
72
|
+
\ requirements: ~> 1.3\n - name: rake\n requirements: ! '>= 0'\n
|
73
|
+
\ - name: rspec\n requirements: ~> 2.14\n runtime: []\n- name: jekyll-import\n
|
74
|
+
\ downloads: 6766\n version: 0.4.0\n version_downloads: 271\n platform:
|
75
|
+
ruby\n authors: Tom Preston-Werner\n info: Provides the Import command for
|
76
|
+
Jekyll.\n licenses:\n - MIT\n project_uri: http://rubygems.org/gems/jekyll-import\n
|
77
|
+
\ gem_uri: http://rubygems.org/gems/jekyll-import-0.4.0.gem\n homepage_uri:
|
78
|
+
http://github.com/jekyll/jekyll-import\n wiki_uri: \n documentation_uri:
|
79
|
+
\n mailing_list_uri: \n source_code_uri: \n bug_tracker_uri: \n dependencies:\n
|
80
|
+
\ development:\n - name: activesupport\n requirements: ~> 3.2\n
|
81
|
+
\ - name: behance\n requirements: ~> 0.3\n - name: hpricot\n requirements:
|
82
|
+
~> 0.8\n - name: htmlentities\n requirements: ~> 4.3\n - name:
|
83
|
+
launchy\n requirements: ~> 2.4\n - name: mysql\n requirements:
|
84
|
+
~> 2.8\n - name: mysql2\n requirements: ~> 0.3\n - name: pg\n requirements:
|
85
|
+
~> 0.12\n - name: rake\n requirements: ~> 10.1.0\n - name: rdoc\n
|
86
|
+
\ requirements: ~> 4.0.0\n - name: redgreen\n requirements: ~>
|
87
|
+
1.2\n - name: rr\n requirements: ~> 1.0\n - name: sequel\n requirements:
|
88
|
+
~> 3.42\n - name: shoulda\n requirements: ~> 3.5\n - name: simplecov\n
|
89
|
+
\ requirements: ~> 0.7\n - name: simplecov-gem-adapter\n requirements:
|
90
|
+
~> 1.0.1\n - name: unidecode\n requirements: ! '>= 0'\n runtime:\n
|
91
|
+
\ - name: fastercsv\n requirements: ! '>= 0'\n - name: jekyll\n
|
92
|
+
\ requirements: ! '>= 1.4'\n - name: nokogiri\n requirements:
|
93
|
+
! '>= 0'\n- name: github\n downloads: 60694\n version: 0.7.2\n version_downloads:
|
94
|
+
14630\n platform: ruby\n authors: Chris Wanstrath, Kevin Ballard, Scott
|
95
|
+
Chacon, Dr Nic Williams\n info: The official `github` command line helper
|
96
|
+
for simplifying your GitHub experience.\n licenses: \n project_uri: http://rubygems.org/gems/github\n
|
97
|
+
\ gem_uri: http://rubygems.org/gems/github-0.7.2.gem\n homepage_uri: https://github.com/defunkt/github-gem\n
|
98
|
+
\ wiki_uri: \n documentation_uri: \n mailing_list_uri: \n source_code_uri:
|
99
|
+
\n bug_tracker_uri: \n dependencies:\n development:\n - name: activerecord\n
|
100
|
+
\ requirements: ~> 3.0.0\n - name: rake\n requirements: ! '>=
|
101
|
+
0'\n - name: rspec\n requirements: ~> 1.3.1\n runtime:\n - name:
|
102
|
+
highline\n requirements: ~> 1.6\n - name: json_pure\n requirements:
|
103
|
+
~> 1.5.1\n - name: launchy\n requirements: ~> 2.0.2\n - name: text-format\n
|
104
|
+
\ requirements: = 1.0.0\n - name: text-hyphen\n requirements:
|
105
|
+
= 1.0.0\n- name: god\n downloads: 809290\n version: 0.13.4\n version_downloads:
|
106
|
+
102914\n platform: ruby\n authors: Tom Preston-Werner, Kevin Clark, Eric
|
107
|
+
Lindvall\n info: An easy to configure, easy to extend monitoring framework
|
108
|
+
written in Ruby.\n licenses: []\n project_uri: http://rubygems.org/gems/god\n
|
109
|
+
\ gem_uri: http://rubygems.org/gems/god-0.13.4.gem\n homepage_uri: http://god.rubyforge.org/\n
|
110
|
+
\ wiki_uri: \n documentation_uri: \n mailing_list_uri: \n source_code_uri:
|
111
|
+
\n bug_tracker_uri: \n dependencies:\n development:\n - name: activesupport\n
|
112
|
+
\ requirements: < 4.0.0, >= 2.3.10\n - name: airbrake\n requirements:
|
113
|
+
~> 3.1.7\n - name: daemons\n requirements: ~> 1.1\n - name: dike\n
|
114
|
+
\ requirements: ~> 0.0.3\n - name: gollum\n requirements: ~> 1.3.1\n
|
115
|
+
\ - name: json\n requirements: ~> 1.6\n - name: mocha\n requirements:
|
116
|
+
~> 0.10\n - name: nokogiri\n requirements: ~> 1.5.0\n - name: prowly\n
|
117
|
+
\ requirements: ~> 0.3\n - name: rake\n requirements: ! '>= 0'\n
|
118
|
+
\ - name: rcov\n requirements: ~> 0.9\n - name: rdoc\n requirements:
|
119
|
+
~> 3.10\n - name: twitter\n requirements: ~> 4.0\n - name: xmpp4r\n
|
120
|
+
\ requirements: ~> 0.5\n runtime: []\n- name: bertrpc\n downloads:
|
121
|
+
51629\n version: 1.3.1\n version_downloads: 13345\n platform: ruby\n authors:
|
122
|
+
Tom Preston-Werner\n info: BERTRPC is a Ruby BERT-RPC client library.\n licenses:
|
123
|
+
\n project_uri: http://rubygems.org/gems/bertrpc\n gem_uri: http://rubygems.org/gems/bertrpc-1.3.1.gem\n
|
124
|
+
\ homepage_uri: http://github.com/mojombo/bertrpc\n wiki_uri: \n documentation_uri:
|
125
|
+
\n mailing_list_uri: \n source_code_uri: \n bug_tracker_uri: \n dependencies:\n
|
126
|
+
\ development: []\n runtime:\n - name: bert\n requirements: <
|
127
|
+
2.0.0, >= 1.1.0\n- name: ernie\n downloads: 33418\n version: 2.5.2\n version_downloads:
|
128
|
+
4470\n platform: ruby\n authors: Tom Preston-Werner\n info: Ernie is an
|
129
|
+
Erlang/Ruby hybrid BERT-RPC server implementation packaged as\n a gem.\n
|
130
|
+
\ licenses: \n project_uri: http://rubygems.org/gems/ernie\n gem_uri: http://rubygems.org/gems/ernie-2.5.2.gem\n
|
131
|
+
\ homepage_uri: http://github.com/mojombo/ernie\n wiki_uri: \n documentation_uri:
|
132
|
+
\n mailing_list_uri: \n source_code_uri: \n bug_tracker_uri: \n dependencies:\n
|
133
|
+
\ development:\n - name: shoulda\n requirements: ! '>= 2.11.3, <
|
134
|
+
3.0.0'\n runtime:\n - name: bert\n requirements: ! '>= 1.1.0'\n
|
135
|
+
\ - name: bertrpc\n requirements: ! '>= 1.0.0'\n- name: erlectricity\n
|
136
|
+
\ downloads: 12490\n version: 1.1.1\n version_downloads: 3292\n platform:
|
137
|
+
ruby\n authors: Scott Fleckenstein, Tom Preston-Werner\n info: A library
|
138
|
+
to interface erlang and ruby through the erlang port system\n licenses: \n
|
139
|
+
\ project_uri: http://rubygems.org/gems/erlectricity\n gem_uri: http://rubygems.org/gems/erlectricity-1.1.1.gem\n
|
140
|
+
\ homepage_uri: http://github.com/mojombo/erlectricity\n wiki_uri: \n documentation_uri:
|
141
|
+
\n mailing_list_uri: \n source_code_uri: \n bug_tracker_uri: \n dependencies:\n
|
142
|
+
\ development: []\n runtime: []\n- name: jekyll\n downloads: 809463\n
|
143
|
+
\ version: 2.1.1\n version_downloads: 2389\n platform: ruby\n authors:
|
144
|
+
Tom Preston-Werner\n info: Jekyll is a simple, blog aware, static site generator.\n
|
145
|
+
\ licenses:\n - MIT\n project_uri: http://rubygems.org/gems/jekyll\n gem_uri:
|
146
|
+
http://rubygems.org/gems/jekyll-2.1.1.gem\n homepage_uri: https://github.com/jekyll/jekyll\n
|
147
|
+
\ wiki_uri: ''\n documentation_uri: http://jekyllrb.com\n mailing_list_uri:
|
148
|
+
''\n source_code_uri: https://github.com/mojombo/jekyll\n bug_tracker_uri:
|
149
|
+
https://github.com/mojombo/jekyll/issues\n dependencies:\n development:\n
|
150
|
+
\ - name: activesupport\n requirements: ~> 3.2.13\n - name: cucumber\n
|
151
|
+
\ requirements: = 1.3.11\n - name: jekyll_test_plugin\n requirements:
|
152
|
+
! '>= 0'\n - name: jekyll_test_plugin_malicious\n requirements: !
|
153
|
+
'>= 0'\n - name: launchy\n requirements: ~> 2.3\n - name: maruku\n
|
154
|
+
\ requirements: ~> 0.7.0\n - name: mime-types\n requirements:
|
155
|
+
~> 1.5\n - name: rake\n requirements: ~> 10.1\n - name: rdiscount\n
|
156
|
+
\ requirements: ~> 1.6\n - name: rdoc\n requirements: ~> 3.11\n
|
157
|
+
\ - name: RedCloth\n requirements: ~> 4.2\n - name: redgreen\n requirements:
|
158
|
+
~> 1.2\n - name: rouge\n requirements: ~> 1.3\n - name: rr\n requirements:
|
159
|
+
~> 1.1\n - name: shoulda\n requirements: ~> 3.5\n - name: simplecov\n
|
160
|
+
\ requirements: ~> 0.7\n - name: simplecov-gem-adapter\n requirements:
|
161
|
+
~> 1.0.1\n runtime:\n - name: classifier\n requirements: ~> 1.3\n
|
162
|
+
\ - name: colorator\n requirements: ~> 0.1\n - name: jekyll-coffeescript\n
|
163
|
+
\ requirements: ~> 1.0\n - name: jekyll-gist\n requirements: ~>
|
164
|
+
1.0\n - name: jekyll-paginate\n requirements: ~> 1.0\n - name:
|
165
|
+
jekyll-sass-converter\n requirements: ~> 1.0\n - name: jekyll-watch\n
|
166
|
+
\ requirements: ~> 1.0\n - name: kramdown\n requirements: ~> 1.3\n
|
167
|
+
\ - name: liquid\n requirements: ~> 2.6.1\n - name: mercenary\n
|
168
|
+
\ requirements: ~> 0.3.3\n - name: pygments.rb\n requirements:
|
169
|
+
~> 0.6.0\n - name: redcarpet\n requirements: ~> 3.1\n - name: safe_yaml\n
|
170
|
+
\ requirements: ~> 1.0\n - name: toml\n requirements: ~> 0.1.0\n-
|
171
|
+
name: proxymachine\n downloads: 45534\n version: 1.2.4\n version_downloads:
|
172
|
+
31941\n platform: ruby\n authors: Tom Preston-Werner\n info: ProxyMachine
|
173
|
+
is a simple content aware (layer 7) TCP routing proxy written\n in Ruby
|
174
|
+
with EventMachine.\n licenses: \n project_uri: http://rubygems.org/gems/proxymachine\n
|
175
|
+
\ gem_uri: http://rubygems.org/gems/proxymachine-1.2.4.gem\n homepage_uri:
|
176
|
+
http://github.com/mojombo/proxymachine\n wiki_uri: \n documentation_uri:
|
177
|
+
\n mailing_list_uri: \n source_code_uri: \n bug_tracker_uri: \n dependencies:\n
|
178
|
+
\ development:\n - name: jeweler\n requirements: ~> 1.5.2\n -
|
179
|
+
name: rake\n requirements: ~> 0.8.7\n - name: shoulda\n requirements:
|
180
|
+
~> 2.11.3\n runtime:\n - name: eventmachine\n requirements: ! '>=
|
181
|
+
0.12.10'\n- name: bert\n downloads: 72016\n version: 1.1.6\n version_downloads:
|
182
|
+
37893\n platform: ruby\n authors: Tom Preston-Werner\n info: BERT Serializiation
|
183
|
+
for Ruby\n licenses: \n project_uri: http://rubygems.org/gems/bert\n gem_uri:
|
184
|
+
http://rubygems.org/gems/bert-1.1.6.gem\n homepage_uri: http://github.com/mojombo/bert\n
|
185
|
+
\ wiki_uri: \n documentation_uri: \n mailing_list_uri: \n source_code_uri:
|
186
|
+
\n bug_tracker_uri: \n dependencies:\n development:\n - name: thoughtbot-shoulda\n
|
187
|
+
\ requirements: ! '>= 0'\n runtime: []\n- name: grit\n downloads:
|
188
|
+
614999\n version: 2.5.0\n version_downloads: 394640\n platform: ruby\n
|
189
|
+
\ authors: Tom Preston-Werner, Scott Chacon\n info: Grit is a Ruby library
|
190
|
+
for extracting information from a git repository in\n an object oriented
|
191
|
+
manner.\n licenses: \n project_uri: http://rubygems.org/gems/grit\n gem_uri:
|
192
|
+
http://rubygems.org/gems/grit-2.5.0.gem\n homepage_uri: http://github.com/mojombo/grit\n
|
193
|
+
\ wiki_uri: \n documentation_uri: \n mailing_list_uri: \n source_code_uri:
|
194
|
+
\n bug_tracker_uri: \n dependencies:\n development:\n - name: mocha\n
|
195
|
+
\ requirements: ! '>= 0'\n runtime:\n - name: diff-lcs\n requirements:
|
196
|
+
~> 1.1\n - name: mime-types\n requirements: ~> 1.15\n - name: posix-spawn\n
|
197
|
+
\ requirements: ~> 0.3.6\n- name: chronic\n downloads: 4275480\n version:
|
198
|
+
0.10.2\n version_downloads: 889801\n platform: ruby\n authors: Tom Preston-Werner,
|
199
|
+
Lee Jarvis\n info: Chronic is a natural language date/time parser written
|
200
|
+
in pure Ruby.\n licenses:\n - MIT\n project_uri: http://rubygems.org/gems/chronic\n
|
201
|
+
\ gem_uri: http://rubygems.org/gems/chronic-0.10.2.gem\n homepage_uri: http://github.com/mojombo/chronic\n
|
202
|
+
\ wiki_uri: \n documentation_uri: \n mailing_list_uri: \n source_code_uri:
|
203
|
+
\n bug_tracker_uri: \n dependencies:\n development:\n - name: activesupport\n
|
204
|
+
\ requirements: ! '>= 0'\n - name: minitest\n requirements: ~>
|
205
|
+
5.0\n - name: rake\n requirements: ! '>= 0'\n - name: simplecov\n
|
206
|
+
\ requirements: ! '>= 0'\n runtime: []\n- name: fuzed\n downloads:
|
207
|
+
1636\n version: 0.1.0\n version_downloads: 1635\n platform: ruby\n authors:
|
208
|
+
Dave Fayram, Tom Preston-Werner\n info: The author was too lazy to write
|
209
|
+
a description\n licenses: \n project_uri: http://rubygems.org/gems/fuzed\n
|
210
|
+
\ gem_uri: http://rubygems.org/gems/fuzed-0.1.0.gem\n homepage_uri: fuzed.rubyforge.org\n
|
211
|
+
\ wiki_uri: \n documentation_uri: \n mailing_list_uri: \n source_code_uri:
|
212
|
+
\n bug_tracker_uri: \n dependencies:\n development: []\n runtime:\n
|
213
|
+
\ - name: erlectricity\n requirements: ! '>= 0.1.0'\n - name: hoe\n
|
214
|
+
\ requirements: ! '>= 1.2.1'\n- name: syntaxi\n downloads: 3209\n version:
|
215
|
+
0.5.0\n version_downloads: 3207\n platform: ruby\n authors: Tom Werner\n
|
216
|
+
\ info: Syntaxi formats code blocks in text (line number, line wrap, syntax
|
217
|
+
color)\n licenses: \n project_uri: http://rubygems.org/gems/syntaxi\n gem_uri:
|
218
|
+
http://rubygems.org/gems/syntaxi-0.5.0.gem\n homepage_uri: http://syntaxi.rubyforge.org\n
|
219
|
+
\ wiki_uri: \n documentation_uri: \n mailing_list_uri: \n source_code_uri:
|
220
|
+
\n bug_tracker_uri: \n dependencies:\n development: []\n runtime:\n
|
221
|
+
\ - name: syntax\n requirements: = 1.0.0\n- name: jungle\n downloads:
|
222
|
+
1465\n version: 0.1.0\n version_downloads: 1464\n platform: ruby\n authors:
|
223
|
+
Ryan Davis\n info: Jungle is a client library for the Amazon SQS (Simple
|
224
|
+
Queue Service). It provides\n an intuitive, well documented API and a fully
|
225
|
+
tested codebase.\n licenses: \n project_uri: http://rubygems.org/gems/jungle\n
|
226
|
+
\ gem_uri: http://rubygems.org/gems/jungle-0.1.0.gem\n homepage_uri: ! \"\\thttp://jungle.rubyforge.org/\"\n
|
227
|
+
\ wiki_uri: \n documentation_uri: \n mailing_list_uri: \n source_code_uri:
|
228
|
+
\n bug_tracker_uri: \n dependencies:\n development: []\n runtime:
|
229
|
+
[]\n- name: gollum\n downloads: 104061\n version: 3.0.0\n version_downloads:
|
230
|
+
4150\n platform: ruby\n authors: Tom Preston-Werner, Rick Olson\n info:
|
231
|
+
A simple, Git-powered wiki with a sweet API and local frontend.\n licenses:\n
|
232
|
+
\ - MIT\n project_uri: http://rubygems.org/gems/gollum\n gem_uri: http://rubygems.org/gems/gollum-3.0.0.gem\n
|
233
|
+
\ homepage_uri: http://github.com/gollum/gollum\n wiki_uri: ''\n documentation_uri:
|
234
|
+
https://github.com/gollum/gollum\n mailing_list_uri: ''\n source_code_uri:
|
235
|
+
https://github.com/gollum/gollum\n bug_tracker_uri: https://github.com/gollum/gollum/issues\n
|
236
|
+
\ dependencies:\n development:\n - name: minitest-reporters\n requirements:
|
237
|
+
~> 0.14.16\n - name: mocha\n requirements: ~> 1.0.0\n - name: rack-test\n
|
238
|
+
\ requirements: ~> 0.6.2\n - name: shoulda\n requirements: ~>
|
239
|
+
3.5.0\n - name: twitter_cldr\n requirements: ~> 2.4.2\n runtime:\n
|
240
|
+
\ - name: github-markdown\n requirements: ~> 0.6.5\n - name: gollum-lib\n
|
241
|
+
\ requirements: ~> 3.0\n - name: mustache\n requirements: < 1.0.0,
|
242
|
+
>= 0.99.5\n - name: sinatra\n requirements: ! '>= 1.4.4, ~> 1.4'\n
|
243
|
+
\ - name: useragent\n requirements: ~> 0.10.0\n"
|
244
|
+
http_version:
|
245
|
+
recorded_at: Sun, 13 Jul 2014 02:37:17 GMT
|
246
|
+
recorded_with: VCR 2.9.2
|
data/spec/cli_spec.rb
CHANGED
@@ -17,16 +17,16 @@ describe Mygegegems::CLI do
|
|
17
17
|
it "returns statics of your gems" do
|
18
18
|
described_class.start(['stat'])
|
19
19
|
expect($stdout.string).to eq ~<<-EOS
|
20
|
-
As of 2014-07-11 (last:
|
20
|
+
As of 2014-07-11 (last: \e[33m2014-07-10\e[0m)
|
21
21
|
-----------------------------------
|
22
|
-
3345 + 0
|
23
|
-
2225 +100
|
24
|
-
762 + 2
|
25
|
-
354 + 14
|
26
|
-
299 + 18
|
27
|
-
297 + 30
|
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
|
28
28
|
-----------------------------------
|
29
|
-
7282 +164
|
29
|
+
7282 \e[33m+164 \e[32m6 gems\e[0m
|
30
30
|
EOS
|
31
31
|
end
|
32
32
|
|
@@ -34,18 +34,48 @@ describe Mygegegems::CLI do
|
|
34
34
|
it "returns statics of your gems" do
|
35
35
|
described_class.start(['stat', '--target', 'last_month'])
|
36
36
|
expect($stdout.string).to eq ~<<-EOS
|
37
|
-
As of 2014-07-11 (last_month:
|
37
|
+
As of 2014-07-11 (last_month: \e[33m2014-06-30\e[0m)
|
38
38
|
-----------------------------------------
|
39
|
-
3345 +123
|
40
|
-
2225 +225
|
41
|
-
762 +162
|
42
|
-
354
|
43
|
-
299 + 21
|
44
|
-
297
|
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
|
45
45
|
-----------------------------------------
|
46
|
-
7282 +531
|
46
|
+
7282 \e[33m+531 \e[32m6 gems\e[0m
|
47
47
|
EOS
|
48
48
|
end
|
49
49
|
end
|
50
|
+
|
51
|
+
context "with handle option" do
|
52
|
+
it "returns statics of other's gems" do
|
53
|
+
VCR.use_cassette('mojombo') do
|
54
|
+
described_class.start(['stat', '--handle', 'mojombo'])
|
55
|
+
expect($stdout.string).to eq ~<<-EOS
|
56
|
+
mojombo's gems
|
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
|
74
|
+
------------------------------
|
75
|
+
6973994 16 gems
|
76
|
+
EOS
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
50
80
|
end
|
51
81
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
|
2
2
|
require 'mygegegems'
|
3
3
|
require "tildoc"
|
4
|
+
require "webmock"
|
5
|
+
require "vcr"
|
4
6
|
|
5
7
|
module Helpers
|
6
8
|
def source_root
|
@@ -11,3 +13,9 @@ end
|
|
11
13
|
RSpec.configure do |c|
|
12
14
|
c.include Helpers
|
13
15
|
end
|
16
|
+
|
17
|
+
VCR.configure do |c|
|
18
|
+
c.cassette_library_dir = 'spec/cassettes'
|
19
|
+
c.hook_into :webmock
|
20
|
+
c.allow_http_connections_when_no_cassette = true
|
21
|
+
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.
|
4
|
+
version: 0.0.2
|
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-
|
11
|
+
date: 2014-07-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gems
|
@@ -94,6 +94,34 @@ dependencies:
|
|
94
94
|
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: vcr
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: webmock
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
97
125
|
description:
|
98
126
|
email:
|
99
127
|
- postagie@gmail.com
|
@@ -116,6 +144,7 @@ files:
|
|
116
144
|
- lib/mygegegems/stat.rb
|
117
145
|
- lib/mygegegems/version.rb
|
118
146
|
- mygegegems.gemspec
|
147
|
+
- spec/cassettes/mojombo.yml
|
119
148
|
- spec/cli_spec.rb
|
120
149
|
- spec/fixtures/mygegegems.yaml
|
121
150
|
- spec/mygegegems_spec.rb
|
@@ -146,6 +175,7 @@ signing_key:
|
|
146
175
|
specification_version: 4
|
147
176
|
summary: Report download numbers of you gems.
|
148
177
|
test_files:
|
178
|
+
- spec/cassettes/mojombo.yml
|
149
179
|
- spec/cli_spec.rb
|
150
180
|
- spec/fixtures/mygegegems.yaml
|
151
181
|
- spec/mygegegems_spec.rb
|