who-broke-my-app 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5ab43bc644efafabded38883c7af08ad47b9c87b
4
- data.tar.gz: cfb335cfaa7f126485099b01ad979aebcf88b2d8
3
+ metadata.gz: 0960fade4eaa7aa1e6178c7d01c475c19e32be71
4
+ data.tar.gz: 46b5d5660c13d5cfb7a308dabaec90ee13037f26
5
5
  SHA512:
6
- metadata.gz: f956c033752d42bfa63d778b0d49a6860c1ae6715b1b74c134a5cf938e1dbcb8fd72c678de38d47be2370aaa4dcfce8a177a81a63fad3f58ed7804535967bd3f
7
- data.tar.gz: 442f1d1daa34dd537c64b4db3215e3e9f280d542fa20b5492ab2d4ad4008954e6954308fca2352dfc750a2ed7b0ad6457118767f33aae03ceaab4d9c110ae069
6
+ metadata.gz: bd0770126ca1d196ede91961ee4fd43d2e262bf71020c8221e2ab6d223c15676e2245be57c50e0c5fb71557b361ca74df45a6d9f8fef676ae0861e9670a79ea7
7
+ data.tar.gz: 1a5d5d0b59a46fd7d5a945b42bde4f5d5c981d5ea51e0127ca012d53387c05e8eb5600d2887750aaf399869247b1ae52eab6b374d725eff2e0f25a72c043b450
data/.gitignore ADDED
@@ -0,0 +1,14 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ *.bundle
11
+ *.so
12
+ *.o
13
+ *.a
14
+ mkmf.log
data/Gemfile.lock CHANGED
@@ -1,30 +1,17 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- who-broke-my-app (0.0.1)
5
- activesupport
4
+ who-broke-my-app (0.0.2)
6
5
  bundler (~> 1.7)
7
6
  faraday
8
7
 
9
8
  GEM
10
9
  remote: https://rubygems.org/
11
10
  specs:
12
- activesupport (4.2.0)
13
- i18n (~> 0.7)
14
- json (~> 1.7, >= 1.7.7)
15
- minitest (~> 5.1)
16
- thread_safe (~> 0.3, >= 0.3.4)
17
- tzinfo (~> 1.1)
18
11
  faraday (0.9.1)
19
12
  multipart-post (>= 1.2, < 3)
20
- i18n (0.7.0)
21
- json (1.8.2)
22
- minitest (5.5.1)
23
13
  multipart-post (2.0.0)
24
14
  rake (10.4.2)
25
- thread_safe (0.3.4)
26
- tzinfo (1.2.2)
27
- thread_safe (~> 0.1)
28
15
 
29
16
  PLATFORMS
30
17
  ruby
data/bin/who-broke-my-app CHANGED
@@ -1,6 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require 'active_support/all'
4
3
  require 'json'
5
4
  require 'bundler'
6
5
  require 'faraday'
@@ -8,7 +7,7 @@ require 'optparse'
8
7
 
9
8
  options = {days: 1}
10
9
  OptionParser.new do |opts|
11
- opts.banner = "Usage: who-broke-my-app.rb [options]"
10
+ opts.banner = "Usage: who-broke-my-app [options]"
12
11
 
13
12
  opts.on("-p [PATH]", "--path [PATH]", String, "Path to the Gemfile.lock") do |path|
14
13
  options[:path] = path
@@ -26,9 +25,13 @@ lockfile = Bundler::LockfileParser.new(Bundler.read_file(options[:path]))
26
25
  date = Time.now - options[:days].to_i * 24*60*60
27
26
 
28
27
  lockfile.specs.map do |gem|
29
- versions = Faraday.get("#{version_api}/#{gem.name}.json").body
30
- version = JSON.parse(versions).find do |v|
31
- v['number'] == gem.version.to_s && Time.parse(v['built_at']) > date
28
+ response = Faraday.get("#{version_api}/#{gem.name}.json")
29
+ if response.status == 200
30
+ version = JSON.parse(response.body).find do |v|
31
+ v['number'] == gem.version.to_s && Time.parse(v['built_at']) > date
32
+ end
33
+ puts "#{gem.name} #{version['number']} was released on #{version['built_at']}" if version
34
+ else
35
+ puts "#{gem.name} returned error \"#{response.body}\""
32
36
  end
33
- puts "#{gem.name} #{version['number']} was released on #{version['built_at']}" if version
34
37
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "who-broke-my-app"
5
- spec.version = "0.0.1"
5
+ spec.version = "0.0.2"
6
6
  spec.authors = ["Jessie Keck"]
7
7
  spec.email = ["jkeck@stanford.edu"]
8
8
  spec.summary = %q{Simple ruby script to take a Gemfile.lock file and determine which dependencies have been recently updated.}
@@ -13,7 +13,6 @@ Gem::Specification.new do |spec|
13
13
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
14
14
  spec.require_paths = ["lib"]
15
15
 
16
- spec.add_dependency 'activesupport'
17
16
  spec.add_dependency 'faraday'
18
17
 
19
18
  spec.add_dependency "bundler", "~> 1.7"
metadata CHANGED
@@ -1,29 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: who-broke-my-app
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jessie Keck
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-17 00:00:00.000000000 Z
11
+ date: 2015-01-20 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: activesupport
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ">="
18
- - !ruby/object:Gem::Version
19
- version: '0'
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - ">="
25
- - !ruby/object:Gem::Version
26
- version: '0'
27
13
  - !ruby/object:Gem::Dependency
28
14
  name: faraday
29
15
  requirement: !ruby/object:Gem::Requirement
@@ -74,6 +60,7 @@ executables:
74
60
  extensions: []
75
61
  extra_rdoc_files: []
76
62
  files:
63
+ - ".gitignore"
77
64
  - Gemfile
78
65
  - Gemfile.lock
79
66
  - README.md