who-broke-my-app 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 5ab43bc644efafabded38883c7af08ad47b9c87b
4
+ data.tar.gz: cfb335cfaa7f126485099b01ad979aebcf88b2d8
5
+ SHA512:
6
+ metadata.gz: f956c033752d42bfa63d778b0d49a6860c1ae6715b1b74c134a5cf938e1dbcb8fd72c678de38d47be2370aaa4dcfce8a177a81a63fad3f58ed7804535967bd3f
7
+ data.tar.gz: 442f1d1daa34dd537c64b4db3215e3e9f280d542fa20b5492ab2d4ad4008954e6954308fca2352dfc750a2ed7b0ad6457118767f33aae03ceaab4d9c110ae069
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source "https://rubygems.org"
2
+
3
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,34 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ who-broke-my-app (0.0.1)
5
+ activesupport
6
+ bundler (~> 1.7)
7
+ faraday
8
+
9
+ GEM
10
+ remote: https://rubygems.org/
11
+ 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
+ faraday (0.9.1)
19
+ multipart-post (>= 1.2, < 3)
20
+ i18n (0.7.0)
21
+ json (1.8.2)
22
+ minitest (5.5.1)
23
+ multipart-post (2.0.0)
24
+ rake (10.4.2)
25
+ thread_safe (0.3.4)
26
+ tzinfo (1.2.2)
27
+ thread_safe (~> 0.1)
28
+
29
+ PLATFORMS
30
+ ruby
31
+
32
+ DEPENDENCIES
33
+ rake (~> 10.0)
34
+ who-broke-my-app!
data/README.md ADDED
@@ -0,0 +1,10 @@
1
+ # Who Broke My App?
2
+
3
+ A small ruby script that will look up all of the release dates of the gem versions in a given Gemfile.lock and print out which gems were released in a given number of days.
4
+
5
+ The main purpose of this script is to track down which dependencies had recently released versions that potentially introduced an issue into your application or gem.
6
+
7
+ Usage: who-broke-my-app.rb [options]
8
+ -p, --path [PATH] Path to the Gemfile.lock
9
+ -d, --days [DAYS] Number of days to to search (default is 1)
10
+
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require 'bundler/gem_tasks'
@@ -0,0 +1,34 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'active_support/all'
4
+ require 'json'
5
+ require 'bundler'
6
+ require 'faraday'
7
+ require 'optparse'
8
+
9
+ options = {days: 1}
10
+ OptionParser.new do |opts|
11
+ opts.banner = "Usage: who-broke-my-app.rb [options]"
12
+
13
+ opts.on("-p [PATH]", "--path [PATH]", String, "Path to the Gemfile.lock") do |path|
14
+ options[:path] = path
15
+ end
16
+
17
+ opts.on("-d [DAYS]", "--days [DAYS]", "Number of days to to search (default is 1)") do |days|
18
+ options[:days] = days
19
+ end
20
+
21
+ end.parse!
22
+
23
+
24
+ version_api = "https://rubygems.org/api/v1/versions"
25
+ lockfile = Bundler::LockfileParser.new(Bundler.read_file(options[:path]))
26
+ date = Time.now - options[:days].to_i * 24*60*60
27
+
28
+ 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
32
+ end
33
+ puts "#{gem.name} #{version['number']} was released on #{version['built_at']}" if version
34
+ end
@@ -0,0 +1,21 @@
1
+ # coding: utf-8
2
+
3
+ Gem::Specification.new do |spec|
4
+ spec.name = "who-broke-my-app"
5
+ spec.version = "0.0.1"
6
+ spec.authors = ["Jessie Keck"]
7
+ spec.email = ["jkeck@stanford.edu"]
8
+ spec.summary = %q{Simple ruby script to take a Gemfile.lock file and determine which dependencies have been recently updated.}
9
+ spec.homepage = ""
10
+
11
+ spec.files = `git ls-files -z`.split("\x0")
12
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
13
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
14
+ spec.require_paths = ["lib"]
15
+
16
+ spec.add_dependency 'activesupport'
17
+ spec.add_dependency 'faraday'
18
+
19
+ spec.add_dependency "bundler", "~> 1.7"
20
+ spec.add_development_dependency "rake", "~> 10.0"
21
+ end
metadata ADDED
@@ -0,0 +1,107 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: who-broke-my-app
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Jessie Keck
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-01-17 00:00:00.000000000 Z
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
+ - !ruby/object:Gem::Dependency
28
+ name: faraday
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: bundler
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.7'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '1.7'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rake
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '10.0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '10.0'
69
+ description:
70
+ email:
71
+ - jkeck@stanford.edu
72
+ executables:
73
+ - who-broke-my-app
74
+ extensions: []
75
+ extra_rdoc_files: []
76
+ files:
77
+ - Gemfile
78
+ - Gemfile.lock
79
+ - README.md
80
+ - Rakefile
81
+ - bin/who-broke-my-app
82
+ - who-broke-my-app.gemspec
83
+ homepage: ''
84
+ licenses: []
85
+ metadata: {}
86
+ post_install_message:
87
+ rdoc_options: []
88
+ require_paths:
89
+ - lib
90
+ required_ruby_version: !ruby/object:Gem::Requirement
91
+ requirements:
92
+ - - ">="
93
+ - !ruby/object:Gem::Version
94
+ version: '0'
95
+ required_rubygems_version: !ruby/object:Gem::Requirement
96
+ requirements:
97
+ - - ">="
98
+ - !ruby/object:Gem::Version
99
+ version: '0'
100
+ requirements: []
101
+ rubyforge_project:
102
+ rubygems_version: 2.2.2
103
+ signing_key:
104
+ specification_version: 4
105
+ summary: Simple ruby script to take a Gemfile.lock file and determine which dependencies
106
+ have been recently updated.
107
+ test_files: []