gemlock 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -2,3 +2,5 @@
2
2
  .bundle
3
3
  Gemfile.lock
4
4
  pkg/*
5
+ *.swp
6
+ .DS_Store
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --color --format=doc
data/Rakefile CHANGED
@@ -1,6 +1,6 @@
1
1
  require 'bundler/gem_tasks'
2
2
  require 'rspec/core/rake_task'
3
- load File.join(File.dirname(__FILE__), 'tasks', 'gemlock.rake')
3
+ require 'lib/rake_tasks'
4
4
 
5
5
  RSpec::Core::RakeTask.new(:spec)
6
6
  task :default => :spec
@@ -19,8 +19,14 @@ Gem::Specification.new do |s|
19
19
  s.require_paths = ["lib"]
20
20
 
21
21
  s.add_dependency('rake', '>= 0.8.7')
22
+ s.add_dependency('bundler', '~> 1.0.0')
23
+ s.add_dependency('rest-client')
24
+ s.add_dependency('json')
22
25
 
26
+ s.add_development_dependency('autotest')
23
27
  s.add_development_dependency('rspec' , '~> 2.6.0')
24
28
  s.add_development_dependency('mocha' , '~> 0.10.0')
25
29
  s.add_development_dependency('pry' , '>= 0.9.5')
30
+ s.add_development_dependency('vcr' , '>= 1.11.0')
31
+ s.add_development_dependency('fakeweb', '>= 1.3.0')
26
32
  end
@@ -1,3 +1,7 @@
1
+ require "bundler"
2
+ require "rest_client"
3
+ require "json"
4
+
1
5
  require "gemlock/version"
2
6
 
3
7
  module Gemlock
@@ -5,11 +9,11 @@ module Gemlock
5
9
 
6
10
  class << self
7
11
  def lockfile
8
- @lockfile = if defined?(Rails)
9
- Rails.root.join('Gemfile.lock')
10
- else
11
- Bundler::SharedHelpers.default_lockfile
12
- end
12
+ @lockfile ||= if defined?(Rails)
13
+ Rails.root.join('Gemfile.lock')
14
+ else
15
+ Bundler::SharedHelpers.default_lockfile
16
+ end
13
17
  end
14
18
 
15
19
  def locked_gemfile_specs
@@ -20,5 +24,35 @@ module Gemlock
20
24
  locked_gemfile_specs = locked.specs.clone
21
25
  locked_gemfile_specs.delete_if { |spec| !gemfile_names.include?(spec.name) }
22
26
  end
27
+
28
+ def lookup_version(name)
29
+ json_hash = JSON.parse(RestClient.get("https://rubygems.org/api/v1/gems/#{name}.json"))
30
+
31
+ return json_hash["version"]
32
+ end
33
+
34
+ def outdated
35
+ specs = {}
36
+ locked_gemfile_specs.each do |spec|
37
+ specs[spec.name] = spec.version.to_s
38
+ end
39
+
40
+ oudated = {}
41
+ locked_gemfile_specs.each do |spec|
42
+ latest_version = lookup_version(spec.name)
43
+ if Gem::Version.new(latest_version) > Gem::Version.new(spec.version)
44
+ oudated[spec.name] = latest_version
45
+ end
46
+ hash
47
+ end
48
+
49
+ return_hash = {}
50
+ oudated.each_pair do |name, latest_version|
51
+ return_hash[name] = { :latest => latest_version,
52
+ :current => specs[name] }
53
+ end
54
+
55
+ return_hash
56
+ end
23
57
  end
24
58
  end
@@ -1,3 +1,3 @@
1
1
  module Gemlock
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -5,4 +5,17 @@ namespace :gemlock do
5
5
  puts "#{spec.name}, version = #{spec.version.to_s}"
6
6
  end
7
7
  end
8
+
9
+ desc 'lists out of date gems'
10
+ task :outdated => :environment do
11
+ oudated = Gemlock.outdated
12
+ if oudated.empty?
13
+ puts "All gems up to date!"
14
+ else
15
+ oudated.each_pair do |name, versions|
16
+ puts "#{name} is out of date!"
17
+ puts "Installed version: #{versions[:current]}. Latest version: #{versions[:latest]}"
18
+ end
19
+ end
20
+ end
8
21
  end
@@ -0,0 +1,334 @@
1
+ ---
2
+ - !ruby/struct:VCR::HTTPInteraction
3
+ request: !ruby/struct:VCR::Request
4
+ method: :get
5
+ uri: https://rubygems.org:443/api/v1/gems/coffee-rails.json
6
+ body:
7
+ headers:
8
+ accept:
9
+ - "*/*; q=0.5, application/xml"
10
+ accept-encoding:
11
+ - gzip, deflate
12
+ response: !ruby/struct:VCR::Response
13
+ status: !ruby/struct:VCR::ResponseStatus
14
+ code: 200
15
+ message: OK
16
+ headers:
17
+ x-ua-compatible:
18
+ - IE=Edge,chrome=1
19
+ etag:
20
+ - "\"8d7bc50c01b6d796704c36b69d8732ab\""
21
+ x-powered-by:
22
+ - Phusion Passenger (mod_rails/mod_rack) 3.0.0
23
+ content-type:
24
+ - application/json; charset=utf-8
25
+ x-runtime:
26
+ - "0.019747"
27
+ server:
28
+ - Apache/2.2.3 (Red Hat) mod_ssl/2.2.3 OpenSSL/0.9.8e-fips-rhel5 Phusion_Passenger/3.0.0
29
+ date:
30
+ - Fri, 23 Sep 2011 03:47:53 GMT
31
+ status:
32
+ - "200"
33
+ cache-control:
34
+ - max-age=0, private, must-revalidate
35
+ transfer-encoding:
36
+ - chunked
37
+ body: "{\"dependencies\":{\"runtime\":[{\"name\":\"coffee-script\",\"requirements\":\">= 2.2.0\"},{\"name\":\"railties\",\"requirements\":\"~> 3.1.0\"}],\"development\":[]},\"name\":\"coffee-rails\",\"downloads\":140147,\"info\":\"Coffee Script adapter for the Rails asset pipeline.\",\"version_downloads\":43646,\"version\":\"3.1.1\",\"homepage_uri\":\"\",\"bug_tracker_uri\":\"\",\"source_code_uri\":\"https://github.com/rails/coffee-rails\",\"gem_uri\":\"http://rubygems.org/gems/coffee-rails-3.1.1.gem\",\"project_uri\":\"http://rubygems.org/gems/coffee-rails\",\"authors\":\"Santiago Pastorino\",\"mailing_list_uri\":\"\",\"documentation_uri\":\"\",\"wiki_uri\":\"\"}"
38
+ http_version: "1.1"
39
+ - !ruby/struct:VCR::HTTPInteraction
40
+ request: !ruby/struct:VCR::Request
41
+ method: :get
42
+ uri: https://rubygems.org:443/api/v1/gems/jquery-rails.json
43
+ body:
44
+ headers:
45
+ accept:
46
+ - "*/*; q=0.5, application/xml"
47
+ accept-encoding:
48
+ - gzip, deflate
49
+ response: !ruby/struct:VCR::Response
50
+ status: !ruby/struct:VCR::ResponseStatus
51
+ code: 200
52
+ message: OK
53
+ headers:
54
+ x-ua-compatible:
55
+ - IE=Edge,chrome=1
56
+ etag:
57
+ - "\"7b8f4b4f11f43511919ace9e2d8be129\""
58
+ x-powered-by:
59
+ - Phusion Passenger (mod_rails/mod_rack) 3.0.0
60
+ content-type:
61
+ - application/json; charset=utf-8
62
+ x-runtime:
63
+ - "0.028728"
64
+ server:
65
+ - Apache/2.2.3 (Red Hat) mod_ssl/2.2.3 OpenSSL/0.9.8e-fips-rhel5 Phusion_Passenger/3.0.0
66
+ date:
67
+ - Fri, 23 Sep 2011 03:47:53 GMT
68
+ status:
69
+ - "200"
70
+ cache-control:
71
+ - max-age=0, private, must-revalidate
72
+ transfer-encoding:
73
+ - chunked
74
+ body: "{\"dependencies\":{\"runtime\":[{\"name\":\"railties\",\"requirements\":\"~> 3.0\"},{\"name\":\"thor\",\"requirements\":\"~> 0.14\"}],\"development\":[{\"name\":\"bundler\",\"requirements\":\"~> 1.0.0\"},{\"name\":\"rails\",\"requirements\":\"~> 3.0\"}]},\"name\":\"jquery-rails\",\"downloads\":795877,\"info\":\"This gem provides jQuery and the jQuery-ujs driver for your Rails 3 application.\",\"version_downloads\":80728,\"version\":\"1.0.14\",\"homepage_uri\":\"http://rubygems.org/gems/jquery-rails\",\"bug_tracker_uri\":\"https://github.com/rails/jquery-rails/issues\",\"source_code_uri\":\"https://github.com/rails/jquery-rails\",\"gem_uri\":\"http://rubygems.org/gems/jquery-rails-1.0.14.gem\",\"project_uri\":\"http://rubygems.org/gems/jquery-rails\",\"authors\":\"Andr\\u00e9 Arko\",\"mailing_list_uri\":\"\",\"documentation_uri\":\"\",\"wiki_uri\":\"\"}"
75
+ http_version: "1.1"
76
+ - !ruby/struct:VCR::HTTPInteraction
77
+ request: !ruby/struct:VCR::Request
78
+ method: :get
79
+ uri: https://rubygems.org:443/api/v1/gems/json.json
80
+ body:
81
+ headers:
82
+ accept:
83
+ - "*/*; q=0.5, application/xml"
84
+ accept-encoding:
85
+ - gzip, deflate
86
+ response: !ruby/struct:VCR::Response
87
+ status: !ruby/struct:VCR::ResponseStatus
88
+ code: 200
89
+ message: OK
90
+ headers:
91
+ x-ua-compatible:
92
+ - IE=Edge,chrome=1
93
+ etag:
94
+ - "\"ce9e53c2c841d4b332d07e6055a65b81\""
95
+ x-powered-by:
96
+ - Phusion Passenger (mod_rails/mod_rack) 3.0.0
97
+ content-type:
98
+ - application/json; charset=utf-8
99
+ x-runtime:
100
+ - "0.018971"
101
+ server:
102
+ - Apache/2.2.3 (Red Hat) mod_ssl/2.2.3 OpenSSL/0.9.8e-fips-rhel5 Phusion_Passenger/3.0.0
103
+ date:
104
+ - Fri, 23 Sep 2011 03:47:54 GMT
105
+ status:
106
+ - "200"
107
+ cache-control:
108
+ - max-age=0, private, must-revalidate
109
+ transfer-encoding:
110
+ - chunked
111
+ body: "{\"dependencies\":{\"runtime\":[],\"development\":[{\"name\":\"bullshit\",\"requirements\":\">= 0\"},{\"name\":\"permutation\",\"requirements\":\">= 0\"},{\"name\":\"sdoc\",\"requirements\":\">= 0\"}]},\"name\":\"json\",\"downloads\":2556085,\"info\":\"This is a JSON implementation as a Ruby extension in C.\",\"version_downloads\":26819,\"version\":\"1.6.1\",\"homepage_uri\":\"http://flori.github.com/json\",\"bug_tracker_uri\":\"http://github.com/flori/json/issues\",\"source_code_uri\":\"http://flori.github.com/json/\",\"gem_uri\":\"http://rubygems.org/gems/json-1.6.1.gem\",\"project_uri\":\"http://rubygems.org/gems/json\",\"authors\":\"Florian Frank\",\"mailing_list_uri\":\"\",\"documentation_uri\":\"http://flori.github.com/json/doc/index.html\",\"wiki_uri\":\"\"}"
112
+ http_version: "1.1"
113
+ - !ruby/struct:VCR::HTTPInteraction
114
+ request: !ruby/struct:VCR::Request
115
+ method: :get
116
+ uri: https://rubygems.org:443/api/v1/gems/rails.json
117
+ body:
118
+ headers:
119
+ accept:
120
+ - "*/*; q=0.5, application/xml"
121
+ accept-encoding:
122
+ - gzip, deflate
123
+ response: !ruby/struct:VCR::Response
124
+ status: !ruby/struct:VCR::ResponseStatus
125
+ code: 200
126
+ message: OK
127
+ headers:
128
+ x-ua-compatible:
129
+ - IE=Edge,chrome=1
130
+ etag:
131
+ - "\"72aec0bfd385b2b8ceee3d1ed74b8bfd\""
132
+ x-powered-by:
133
+ - Phusion Passenger (mod_rails/mod_rack) 3.0.0
134
+ content-type:
135
+ - application/json; charset=utf-8
136
+ x-runtime:
137
+ - "0.022513"
138
+ server:
139
+ - Apache/2.2.3 (Red Hat) mod_ssl/2.2.3 OpenSSL/0.9.8e-fips-rhel5 Phusion_Passenger/3.0.0
140
+ date:
141
+ - Fri, 23 Sep 2011 03:47:54 GMT
142
+ status:
143
+ - "200"
144
+ cache-control:
145
+ - max-age=0, private, must-revalidate
146
+ transfer-encoding:
147
+ - chunked
148
+ body: "{\"dependencies\":{\"runtime\":[{\"name\":\"actionmailer\",\"requirements\":\"= 3.1.0\"},{\"name\":\"actionpack\",\"requirements\":\"= 3.1.0\"},{\"name\":\"activerecord\",\"requirements\":\"= 3.1.0\"},{\"name\":\"activeresource\",\"requirements\":\"= 3.1.0\"},{\"name\":\"activesupport\",\"requirements\":\"= 3.1.0\"},{\"name\":\"bundler\",\"requirements\":\"~> 1.0\"},{\"name\":\"railties\",\"requirements\":\"= 3.1.0\"}],\"development\":[]},\"name\":\"rails\",\"downloads\":5539753,\"info\":\"Ruby on Rails is a full-stack web framework optimized for programmer happiness and sustainable productivity. It encourages beautiful code by favoring convention over configuration.\",\"version_downloads\":157488,\"version\":\"3.1.0\",\"homepage_uri\":\"http://www.rubyonrails.org\",\"bug_tracker_uri\":\"http://rails.lighthouseapp.com/projects/8994-ruby-on-rails\",\"source_code_uri\":\"http://github.com/rails/rails\",\"gem_uri\":\"http://rubygems.org/gems/rails-3.1.0.gem\",\"project_uri\":\"http://rubygems.org/gems/rails\",\"authors\":\"David Heinemeier Hansson\",\"mailing_list_uri\":\"http://groups.google.com/group/rubyonrails-talk\",\"documentation_uri\":\"http://api.rubyonrails.org\",\"wiki_uri\":\"http://wiki.rubyonrails.org\"}"
149
+ http_version: "1.1"
150
+ - !ruby/struct:VCR::HTTPInteraction
151
+ request: !ruby/struct:VCR::Request
152
+ method: :get
153
+ uri: https://rubygems.org:443/api/v1/gems/ruby-debug.json
154
+ body:
155
+ headers:
156
+ accept:
157
+ - "*/*; q=0.5, application/xml"
158
+ accept-encoding:
159
+ - gzip, deflate
160
+ response: !ruby/struct:VCR::Response
161
+ status: !ruby/struct:VCR::ResponseStatus
162
+ code: 200
163
+ message: OK
164
+ headers:
165
+ x-ua-compatible:
166
+ - IE=Edge,chrome=1
167
+ etag:
168
+ - "\"d4e2e9928d166507caf5c173dc7ca341\""
169
+ x-powered-by:
170
+ - Phusion Passenger (mod_rails/mod_rack) 3.0.0
171
+ content-type:
172
+ - application/json; charset=utf-8
173
+ x-runtime:
174
+ - "0.017977"
175
+ server:
176
+ - Apache/2.2.3 (Red Hat) mod_ssl/2.2.3 OpenSSL/0.9.8e-fips-rhel5 Phusion_Passenger/3.0.0
177
+ date:
178
+ - Fri, 23 Sep 2011 03:47:55 GMT
179
+ status:
180
+ - "200"
181
+ cache-control:
182
+ - max-age=0, private, must-revalidate
183
+ transfer-encoding:
184
+ - chunked
185
+ body: "{\"dependencies\":{\"runtime\":[{\"name\":\"columnize\",\"requirements\":\">= 0.1\"},{\"name\":\"ruby-debug-base\",\"requirements\":\"~> 0.10.4.0\"}],\"development\":[]},\"name\":\"ruby-debug\",\"downloads\":525147,\"info\":\"A generic command line interface for ruby-debug.\\n\",\"version_downloads\":298586,\"version\":\"0.10.4\",\"homepage_uri\":\"http://rubyforge.org/projects/ruby-debug/\",\"bug_tracker_uri\":null,\"source_code_uri\":null,\"gem_uri\":\"http://rubygems.org/gems/ruby-debug-0.10.4.gem\",\"project_uri\":\"http://rubygems.org/gems/ruby-debug\",\"authors\":\"Kent Sibilev\",\"mailing_list_uri\":null,\"documentation_uri\":null,\"wiki_uri\":null}"
186
+ http_version: "1.1"
187
+ - !ruby/struct:VCR::HTTPInteraction
188
+ request: !ruby/struct:VCR::Request
189
+ method: :get
190
+ uri: https://rubygems.org:443/api/v1/gems/sass-rails.json
191
+ body:
192
+ headers:
193
+ accept:
194
+ - "*/*; q=0.5, application/xml"
195
+ accept-encoding:
196
+ - gzip, deflate
197
+ response: !ruby/struct:VCR::Response
198
+ status: !ruby/struct:VCR::ResponseStatus
199
+ code: 200
200
+ message: OK
201
+ headers:
202
+ x-ua-compatible:
203
+ - IE=Edge,chrome=1
204
+ etag:
205
+ - "\"c233274dea541f53bf6d815106885c04\""
206
+ x-powered-by:
207
+ - Phusion Passenger (mod_rails/mod_rack) 3.0.0
208
+ content-type:
209
+ - application/json; charset=utf-8
210
+ x-runtime:
211
+ - "0.019487"
212
+ server:
213
+ - Apache/2.2.3 (Red Hat) mod_ssl/2.2.3 OpenSSL/0.9.8e-fips-rhel5 Phusion_Passenger/3.0.0
214
+ date:
215
+ - Fri, 23 Sep 2011 03:47:55 GMT
216
+ status:
217
+ - "200"
218
+ cache-control:
219
+ - max-age=0, private, must-revalidate
220
+ transfer-encoding:
221
+ - chunked
222
+ body: "{\"dependencies\":{\"runtime\":[{\"name\":\"actionpack\",\"requirements\":\"~> 3.1.0\"},{\"name\":\"railties\",\"requirements\":\"~> 3.1.0\"},{\"name\":\"sass\",\"requirements\":\">= 3.1.4\"},{\"name\":\"sprockets\",\"requirements\":\"~> 2.0.0\"},{\"name\":\"tilt\",\"requirements\":\"~> 1.3.2\"}],\"development\":[]},\"name\":\"sass-rails\",\"downloads\":207381,\"info\":\"Sass adapter for the Rails asset pipeline.\",\"version_downloads\":31931,\"version\":\"3.1.2\",\"homepage_uri\":\"\",\"bug_tracker_uri\":\"https://github.com/rails/sass-rails/issues\",\"source_code_uri\":\"https://github.com/rails/sass-rails\",\"gem_uri\":\"http://rubygems.org/gems/sass-rails-3.1.2.gem\",\"project_uri\":\"http://rubygems.org/gems/sass-rails\",\"authors\":\"wycats, chriseppstein\",\"mailing_list_uri\":\"\",\"documentation_uri\":\"https://github.com/rails/sass-rails/blob/master/README.markdown\",\"wiki_uri\":\"\"}"
223
+ http_version: "1.1"
224
+ - !ruby/struct:VCR::HTTPInteraction
225
+ request: !ruby/struct:VCR::Request
226
+ method: :get
227
+ uri: https://rubygems.org:443/api/v1/gems/sqlite3.json
228
+ body:
229
+ headers:
230
+ accept:
231
+ - "*/*; q=0.5, application/xml"
232
+ accept-encoding:
233
+ - gzip, deflate
234
+ response: !ruby/struct:VCR::Response
235
+ status: !ruby/struct:VCR::ResponseStatus
236
+ code: 200
237
+ message: OK
238
+ headers:
239
+ x-ua-compatible:
240
+ - IE=Edge,chrome=1
241
+ etag:
242
+ - "\"794925f2bbe1f05ecd9e46f61621d810\""
243
+ x-powered-by:
244
+ - Phusion Passenger (mod_rails/mod_rack) 3.0.0
245
+ content-type:
246
+ - application/json; charset=utf-8
247
+ x-runtime:
248
+ - "0.017820"
249
+ server:
250
+ - Apache/2.2.3 (Red Hat) mod_ssl/2.2.3 OpenSSL/0.9.8e-fips-rhel5 Phusion_Passenger/3.0.0
251
+ date:
252
+ - Fri, 23 Sep 2011 03:47:55 GMT
253
+ status:
254
+ - "200"
255
+ cache-control:
256
+ - max-age=0, private, must-revalidate
257
+ transfer-encoding:
258
+ - chunked
259
+ body: "{\"dependencies\":{\"runtime\":[],\"development\":[{\"name\":\"hoe\",\"requirements\":\"~> 2.10\"},{\"name\":\"mini_portile\",\"requirements\":\"~> 0.2.2\"},{\"name\":\"rake-compiler\",\"requirements\":\"~> 0.7.0\"}]},\"name\":\"sqlite3\",\"downloads\":1085992,\"info\":\"This module allows Ruby programs to interface with the SQLite3\\ndatabase engine (http://www.sqlite.org). You must have the\\nSQLite engine installed in order to build this module.\\n\\nNote that this module is NOT compatible with SQLite 2.x.\",\"version_downloads\":250346,\"version\":\"1.3.4\",\"homepage_uri\":\"http://github.com/luislavena/sqlite3-ruby\",\"bug_tracker_uri\":null,\"source_code_uri\":null,\"gem_uri\":\"http://rubygems.org/gems/sqlite3-1.3.4.gem\",\"project_uri\":\"http://rubygems.org/gems/sqlite3\",\"authors\":\"Jamis Buck, Luis Lavena, Aaron Patterson\",\"mailing_list_uri\":null,\"documentation_uri\":null,\"wiki_uri\":null}"
260
+ http_version: "1.1"
261
+ - !ruby/struct:VCR::HTTPInteraction
262
+ request: !ruby/struct:VCR::Request
263
+ method: :get
264
+ uri: https://rubygems.org:443/api/v1/gems/uglifier.json
265
+ body:
266
+ headers:
267
+ accept:
268
+ - "*/*; q=0.5, application/xml"
269
+ accept-encoding:
270
+ - gzip, deflate
271
+ response: !ruby/struct:VCR::Response
272
+ status: !ruby/struct:VCR::ResponseStatus
273
+ code: 200
274
+ message: OK
275
+ headers:
276
+ x-ua-compatible:
277
+ - IE=Edge,chrome=1
278
+ etag:
279
+ - "\"ffbd0a2c81a19bf6971441187104aada\""
280
+ x-powered-by:
281
+ - Phusion Passenger (mod_rails/mod_rack) 3.0.0
282
+ content-type:
283
+ - application/json; charset=utf-8
284
+ x-runtime:
285
+ - "0.019840"
286
+ server:
287
+ - Apache/2.2.3 (Red Hat) mod_ssl/2.2.3 OpenSSL/0.9.8e-fips-rhel5 Phusion_Passenger/3.0.0
288
+ date:
289
+ - Fri, 23 Sep 2011 03:47:56 GMT
290
+ status:
291
+ - "200"
292
+ cache-control:
293
+ - max-age=0, private, must-revalidate
294
+ transfer-encoding:
295
+ - chunked
296
+ body: "{\"dependencies\":{\"runtime\":[{\"name\":\"execjs\",\"requirements\":\">= 0.3.0\"},{\"name\":\"multi_json\",\"requirements\":\">= 1.0.2\"}],\"development\":[{\"name\":\"bundler\",\"requirements\":\"~> 1.0.0\"},{\"name\":\"jeweler\",\"requirements\":\"~> 1.6.0\"},{\"name\":\"rcov\",\"requirements\":\">= 0\"},{\"name\":\"rspec\",\"requirements\":\"~> 2.6.0\"}]},\"name\":\"uglifier\",\"downloads\":248641,\"info\":\"Ruby wrapper for UglifyJS JavaScript compressor\",\"version_downloads\":80771,\"version\":\"1.0.3\",\"homepage_uri\":\"http://github.com/lautis/uglifier\",\"bug_tracker_uri\":\"https://github.com/lautis/uglifier/issues\",\"source_code_uri\":\"https://github.com/lautis/uglifier\",\"gem_uri\":\"http://rubygems.org/gems/uglifier-1.0.3.gem\",\"project_uri\":\"http://rubygems.org/gems/uglifier\",\"authors\":\"Ville Lautanala\",\"mailing_list_uri\":\"\",\"documentation_uri\":\"\",\"wiki_uri\":\"\"}"
297
+ http_version: "1.1"
298
+ - !ruby/struct:VCR::HTTPInteraction
299
+ request: !ruby/struct:VCR::Request
300
+ method: :get
301
+ uri: https://rubygems.org:443/api/v1/gems/unicorn.json
302
+ body:
303
+ headers:
304
+ accept:
305
+ - "*/*; q=0.5, application/xml"
306
+ accept-encoding:
307
+ - gzip, deflate
308
+ response: !ruby/struct:VCR::Response
309
+ status: !ruby/struct:VCR::ResponseStatus
310
+ code: 200
311
+ message: OK
312
+ headers:
313
+ x-ua-compatible:
314
+ - IE=Edge,chrome=1
315
+ etag:
316
+ - "\"99d2582038e2b4a7f938e0f088463238\""
317
+ x-powered-by:
318
+ - Phusion Passenger (mod_rails/mod_rack) 3.0.0
319
+ content-type:
320
+ - application/json; charset=utf-8
321
+ x-runtime:
322
+ - "0.019507"
323
+ server:
324
+ - Apache/2.2.3 (Red Hat) mod_ssl/2.2.3 OpenSSL/0.9.8e-fips-rhel5 Phusion_Passenger/3.0.0
325
+ date:
326
+ - Fri, 23 Sep 2011 03:47:56 GMT
327
+ status:
328
+ - "200"
329
+ cache-control:
330
+ - max-age=0, private, must-revalidate
331
+ transfer-encoding:
332
+ - chunked
333
+ body: "{\"dependencies\":{\"runtime\":[{\"name\":\"kgio\",\"requirements\":\"~> 2.4\"},{\"name\":\"rack\",\"requirements\":\">= 0\"},{\"name\":\"raindrops\",\"requirements\":\"~> 0.6\"}],\"development\":[{\"name\":\"isolate\",\"requirements\":\"~> 3.1\"},{\"name\":\"wrongdoc\",\"requirements\":\"~> 1.6\"}]},\"name\":\"unicorn\",\"downloads\":403522,\"info\":\"\\\\Unicorn is an HTTP server for Rack applications designed to only serve\\nfast clients on low-latency, high-bandwidth connections and take\\nadvantage of features in Unix/Unix-like kernels. Slow clients should\\nonly be served by placing a reverse proxy capable of fully buffering\\nboth the the request and response in between \\\\Unicorn and slow clients.\",\"version_downloads\":21219,\"version\":\"4.1.1\",\"homepage_uri\":\"http://unicorn.bogomips.org/\",\"bug_tracker_uri\":\"http://rubyforge.org/mailman/listinfo/mongrel-unicorn\",\"source_code_uri\":\"http://git.bogomips.org/cgit/unicorn.git\",\"gem_uri\":\"http://rubygems.org/gems/unicorn-4.1.1.gem\",\"project_uri\":\"http://rubygems.org/gems/unicorn\",\"authors\":\"Unicorn hackers\",\"mailing_list_uri\":\"http://rubyforge.org/mailman/listinfo/mongrel-unicorn\",\"documentation_uri\":\"http://unicorn.bogomips.org/\",\"wiki_uri\":\"\"}"
334
+ http_version: "1.1"
@@ -0,0 +1,38 @@
1
+ ---
2
+ - !ruby/struct:VCR::HTTPInteraction
3
+ request: !ruby/struct:VCR::Request
4
+ method: :get
5
+ uri: https://rubygems.org:443/api/v1/gems/rails.json
6
+ body:
7
+ headers:
8
+ accept:
9
+ - "*/*; q=0.5, application/xml"
10
+ accept-encoding:
11
+ - gzip, deflate
12
+ response: !ruby/struct:VCR::Response
13
+ status: !ruby/struct:VCR::ResponseStatus
14
+ code: 200
15
+ message: OK
16
+ headers:
17
+ x-ua-compatible:
18
+ - IE=Edge,chrome=1
19
+ etag:
20
+ - "\"2b7292ff1e188ecc0aae1f50591a9064\""
21
+ x-powered-by:
22
+ - Phusion Passenger (mod_rails/mod_rack) 3.0.0
23
+ content-type:
24
+ - application/json; charset=utf-8
25
+ x-runtime:
26
+ - "0.021268"
27
+ server:
28
+ - Apache/2.2.3 (Red Hat) mod_ssl/2.2.3 OpenSSL/0.9.8e-fips-rhel5 Phusion_Passenger/3.0.0
29
+ date:
30
+ - Fri, 23 Sep 2011 03:35:39 GMT
31
+ status:
32
+ - "200"
33
+ cache-control:
34
+ - max-age=0, private, must-revalidate
35
+ transfer-encoding:
36
+ - chunked
37
+ body: "{\"dependencies\":{\"runtime\":[{\"name\":\"actionmailer\",\"requirements\":\"= 3.1.0\"},{\"name\":\"actionpack\",\"requirements\":\"= 3.1.0\"},{\"name\":\"activerecord\",\"requirements\":\"= 3.1.0\"},{\"name\":\"activeresource\",\"requirements\":\"= 3.1.0\"},{\"name\":\"activesupport\",\"requirements\":\"= 3.1.0\"},{\"name\":\"bundler\",\"requirements\":\"~> 1.0\"},{\"name\":\"railties\",\"requirements\":\"= 3.1.0\"}],\"development\":[]},\"name\":\"rails\",\"downloads\":5539660,\"info\":\"Ruby on Rails is a full-stack web framework optimized for programmer happiness and sustainable productivity. It encourages beautiful code by favoring convention over configuration.\",\"version_downloads\":157442,\"version\":\"3.1.0\",\"homepage_uri\":\"http://www.rubyonrails.org\",\"bug_tracker_uri\":\"http://rails.lighthouseapp.com/projects/8994-ruby-on-rails\",\"source_code_uri\":\"http://github.com/rails/rails\",\"gem_uri\":\"http://rubygems.org/gems/rails-3.1.0.gem\",\"project_uri\":\"http://rubygems.org/gems/rails\",\"authors\":\"David Heinemeier Hansson\",\"mailing_list_uri\":\"http://groups.google.com/group/rubyonrails-talk\",\"documentation_uri\":\"http://api.rubyonrails.org\",\"wiki_uri\":\"http://wiki.rubyonrails.org\"}"
38
+ http_version: "1.1"
@@ -0,0 +1,65 @@
1
+ require 'spec_helper'
2
+
3
+ describe Gemlock do
4
+ describe "#locked_gemfile_specs" do
5
+ it "should output the list of gems & version requirements" do
6
+ Gemlock.stubs(:lockfile).returns((File.join(File.dirname(__FILE__), 'fixtures', 'Gemfile.lock')))
7
+
8
+ specs = Gemlock.locked_gemfile_specs
9
+ expected = [["coffee-rails", "3.1.0"], ["jquery-rails", "1.0.14"],
10
+ ["json", "1.5.0"], ["rails", "3.1.0"],
11
+ ["ruby-debug", "0.10.4"], ["sass-rails", "3.1.0"],
12
+ ["sqlite3", "1.3.4"], ["uglifier", "1.0.3"],
13
+ ["unicorn", "4.1.0"]]
14
+
15
+ specs.should match_name_and_versions_of expected
16
+ end
17
+ end
18
+
19
+ describe "#lockfile" do
20
+ it "should load Gemfile.lock from the Rails root if Rails is defined" do
21
+ module Rails
22
+ def self.root
23
+ Pathname.new(File.dirname(__FILE__))
24
+ end
25
+ end
26
+
27
+ expected_path = Pathname.new(File.dirname(__FILE__)).join('Gemfile.lock')
28
+ Gemlock.lockfile.should eql expected_path
29
+ end
30
+
31
+ it "should load Gemfile.lock from the default Bundler location if Rails is not defined" do
32
+ expected_path = Pathname.new(File.expand_path(File.join(File.dirname(__FILE__), 'Gemfile.lock')))
33
+
34
+ Gemlock.lockfile.should eql expected_path
35
+ end
36
+ end
37
+
38
+ describe "#lookup_version" do
39
+ it "should look up and return the latest version of a given gem" do
40
+ VCR.use_cassette('rails_cassette') do
41
+ version = Gemlock.lookup_version("rails")
42
+ version.should eql "3.1.0"
43
+ end
44
+ end
45
+ end
46
+
47
+ describe "#outdated" do
48
+ it "should return an array of outdated gem specifications" do
49
+ Gemlock.stubs(:lockfile).returns((File.join(File.dirname(__FILE__), 'fixtures', 'Gemfile.lock')))
50
+
51
+ VCR.use_cassette('outdated_cassette') do
52
+ expected = {'coffee-rails' => { :current => '3.1.0',
53
+ :latest => '3.1.1' },
54
+ 'sass-rails' => { :current => '3.1.0',
55
+ :latest => '3.1.2' },
56
+ 'unicorn' => { :current => '4.1.0',
57
+ :latest => '4.1.1' },
58
+ 'json' => { :current => '1.5.0',
59
+ :latest => '1.6.1' } }
60
+
61
+ Gemlock.oudated.should eql expected
62
+ end
63
+ end
64
+ end
65
+ end
@@ -1,5 +1,6 @@
1
1
  require 'rubygems'
2
2
  require 'bundler'
3
+
3
4
  begin
4
5
  Bundler.require(:default, :development)
5
6
  rescue Bundler::BundlerError => e
@@ -11,3 +12,15 @@ end
11
12
  RSpec.configure do |config|
12
13
  config.mock_with :mocha
13
14
  end
15
+
16
+ VCR.config do |c|
17
+ c.cassette_library_dir = File.expand_path(File.join('fixtures', 'vcr_cassettes'), File.dirname(__FILE__))
18
+ c.stub_with :fakeweb
19
+ c.default_cassette_options = { :record => :once }
20
+ end
21
+
22
+ RSpec::Matchers.define :match_name_and_versions_of do |expected|
23
+ match do |actual|
24
+ expected == actual.inject([]) { |a, spec| a << [spec.name, spec.version.to_s] }
25
+ end
26
+ end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gemlock
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 2
10
- version: 0.0.2
9
+ - 3
10
+ version: 0.0.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Mike Skalnik
@@ -18,8 +18,7 @@ autorequire:
18
18
  bindir: bin
19
19
  cert_chain: []
20
20
 
21
- date: 2011-09-19 00:00:00 -04:00
22
- default_executable:
21
+ date: 2011-09-23 00:00:00 Z
23
22
  dependencies:
24
23
  - !ruby/object:Gem::Dependency
25
24
  name: rake
@@ -38,9 +37,67 @@ dependencies:
38
37
  type: :runtime
39
38
  version_requirements: *id001
40
39
  - !ruby/object:Gem::Dependency
41
- name: rspec
40
+ name: bundler
42
41
  prerelease: false
43
42
  requirement: &id002 !ruby/object:Gem::Requirement
43
+ none: false
44
+ requirements:
45
+ - - ~>
46
+ - !ruby/object:Gem::Version
47
+ hash: 23
48
+ segments:
49
+ - 1
50
+ - 0
51
+ - 0
52
+ version: 1.0.0
53
+ type: :runtime
54
+ version_requirements: *id002
55
+ - !ruby/object:Gem::Dependency
56
+ name: rest-client
57
+ prerelease: false
58
+ requirement: &id003 !ruby/object:Gem::Requirement
59
+ none: false
60
+ requirements:
61
+ - - ">="
62
+ - !ruby/object:Gem::Version
63
+ hash: 3
64
+ segments:
65
+ - 0
66
+ version: "0"
67
+ type: :runtime
68
+ version_requirements: *id003
69
+ - !ruby/object:Gem::Dependency
70
+ name: json
71
+ prerelease: false
72
+ requirement: &id004 !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ">="
76
+ - !ruby/object:Gem::Version
77
+ hash: 3
78
+ segments:
79
+ - 0
80
+ version: "0"
81
+ type: :runtime
82
+ version_requirements: *id004
83
+ - !ruby/object:Gem::Dependency
84
+ name: autotest
85
+ prerelease: false
86
+ requirement: &id005 !ruby/object:Gem::Requirement
87
+ none: false
88
+ requirements:
89
+ - - ">="
90
+ - !ruby/object:Gem::Version
91
+ hash: 3
92
+ segments:
93
+ - 0
94
+ version: "0"
95
+ type: :development
96
+ version_requirements: *id005
97
+ - !ruby/object:Gem::Dependency
98
+ name: rspec
99
+ prerelease: false
100
+ requirement: &id006 !ruby/object:Gem::Requirement
44
101
  none: false
45
102
  requirements:
46
103
  - - ~>
@@ -52,11 +109,11 @@ dependencies:
52
109
  - 0
53
110
  version: 2.6.0
54
111
  type: :development
55
- version_requirements: *id002
112
+ version_requirements: *id006
56
113
  - !ruby/object:Gem::Dependency
57
114
  name: mocha
58
115
  prerelease: false
59
- requirement: &id003 !ruby/object:Gem::Requirement
116
+ requirement: &id007 !ruby/object:Gem::Requirement
60
117
  none: false
61
118
  requirements:
62
119
  - - ~>
@@ -68,11 +125,11 @@ dependencies:
68
125
  - 0
69
126
  version: 0.10.0
70
127
  type: :development
71
- version_requirements: *id003
128
+ version_requirements: *id007
72
129
  - !ruby/object:Gem::Dependency
73
130
  name: pry
74
131
  prerelease: false
75
- requirement: &id004 !ruby/object:Gem::Requirement
132
+ requirement: &id008 !ruby/object:Gem::Requirement
76
133
  none: false
77
134
  requirements:
78
135
  - - ">="
@@ -84,7 +141,39 @@ dependencies:
84
141
  - 5
85
142
  version: 0.9.5
86
143
  type: :development
87
- version_requirements: *id004
144
+ version_requirements: *id008
145
+ - !ruby/object:Gem::Dependency
146
+ name: vcr
147
+ prerelease: false
148
+ requirement: &id009 !ruby/object:Gem::Requirement
149
+ none: false
150
+ requirements:
151
+ - - ">="
152
+ - !ruby/object:Gem::Version
153
+ hash: 59
154
+ segments:
155
+ - 1
156
+ - 11
157
+ - 0
158
+ version: 1.11.0
159
+ type: :development
160
+ version_requirements: *id009
161
+ - !ruby/object:Gem::Dependency
162
+ name: fakeweb
163
+ prerelease: false
164
+ requirement: &id010 !ruby/object:Gem::Requirement
165
+ none: false
166
+ requirements:
167
+ - - ">="
168
+ - !ruby/object:Gem::Version
169
+ hash: 27
170
+ segments:
171
+ - 1
172
+ - 3
173
+ - 0
174
+ version: 1.3.0
175
+ type: :development
176
+ version_requirements: *id010
88
177
  description: When installed, allows a user to check for updates in their Rails application
89
178
  email:
90
179
  - mskalnik@gatech.edu
@@ -96,7 +185,9 @@ extra_rdoc_files: []
96
185
 
97
186
  files:
98
187
  - .gitignore
188
+ - .rspec
99
189
  - Gemfile
190
+ - Gemfile.lock
100
191
  - Rakefile
101
192
  - gemlock.gemspec
102
193
  - lib/gemlock.rb
@@ -104,9 +195,11 @@ files:
104
195
  - lib/gemlock/version.rb
105
196
  - lib/tasks/gemlock.rake
106
197
  - spec/fixtures/Gemfile
107
- - spec/rake_tasks_spec.rb
198
+ - spec/fixtures/Gemfile.lock
199
+ - spec/fixtures/vcr_cassettes/outdated_cassette.yml
200
+ - spec/fixtures/vcr_cassettes/rails_cassette.yml
201
+ - spec/gemlock_spec.rb
108
202
  - spec/spec_helper.rb
109
- has_rdoc: true
110
203
  homepage: ""
111
204
  licenses: []
112
205
 
@@ -136,11 +229,14 @@ required_rubygems_version: !ruby/object:Gem::Requirement
136
229
  requirements: []
137
230
 
138
231
  rubyforge_project: gemlock
139
- rubygems_version: 1.5.3
232
+ rubygems_version: 1.8.10
140
233
  signing_key:
141
234
  specification_version: 3
142
235
  summary: Get notified when there are updates for gems in your Rails application
143
236
  test_files:
144
237
  - spec/fixtures/Gemfile
145
- - spec/rake_tasks_spec.rb
238
+ - spec/fixtures/Gemfile.lock
239
+ - spec/fixtures/vcr_cassettes/outdated_cassette.yml
240
+ - spec/fixtures/vcr_cassettes/rails_cassette.yml
241
+ - spec/gemlock_spec.rb
146
242
  - spec/spec_helper.rb
@@ -1,33 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe "rake tasks" do
4
- it "output the list of gems & version requirements" do
5
- Gemlock.stubs(:lockfile).returns((File.join(File.dirname(__FILE__), 'fixtures', 'Gemfile.lock')))
6
-
7
- specs = Gemlock.locked_gemfile_specs.inject([]) { |a, spec| a << [spec.name, spec.version.to_s]}
8
- expected = [["coffee-rails", "3.1.1"], ["jquery-rails", "1.0.14"],
9
- ["json", "1.6.1"], ["rails", "3.1.0"],
10
- ["ruby-debug", "0.10.4"], ["sass-rails", "3.1.2"],
11
- ["sqlite3", "1.3.4"], ["uglifier", "1.0.3"],
12
- ["unicorn", "4.1.1"]]
13
-
14
- specs.should eql expected
15
- end
16
-
17
- it "should load Gemfile.lock from the Rails root if Rails is defined" do
18
- module Rails
19
- def self.root
20
- Pathname.new(File.dirname(__FILE__))
21
- end
22
- end
23
-
24
- expected_path = Pathname.new(File.dirname(__FILE__)).join('Gemfile.lock')
25
- Gemlock.lockfile.should eql expected_path
26
- end
27
-
28
- it "should load Gemfile.lock from the default Bundler location if Rails is not defined" do
29
- expected_path = Pathname.new(File.expand_path(File.join(File.dirname(__FILE__), 'Gemfile.lock')))
30
-
31
- Gemlock.lockfile.should eql expected_path
32
- end
33
- end