should-i-update 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +5 -0
- data/Gemfile +10 -0
- data/Gemfile.lock +39 -0
- data/README.md +37 -0
- data/Rakefile +3 -0
- data/bin/should-i-update +6 -0
- data/lib/shouldiupdate/version.rb +3 -0
- data/lib/shouldiupdate.rb +49 -0
- data/shouldiupdate.gemspec +23 -0
- metadata +82 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 6a212d2b02dbb9e66e3733bfa1ccac7f10241651
|
4
|
+
data.tar.gz: 91fd50c59329ce6284b887dc2b69d070c6b91297
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 82649f1f55293ab549cae202d449f19fc74e7f2868d6d93f302ac6c21a57351b433afc6bf00b09e173a1b1d193215b48d0791c2f38e23977c23bf0fc5fe14872
|
7
|
+
data.tar.gz: fcfcb1309a10d03b8f507360641be6f521617bd416ccb3e0ebfd93ab8f77326ce51554b13e070e936a5e21767c04d3b6666669a784334e7f8947802084ddc724
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
should-i-update (0.0.1)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: https://rubygems.org/
|
8
|
+
specs:
|
9
|
+
diff-lcs (1.2.5)
|
10
|
+
hitimes (1.2.2)
|
11
|
+
rake (10.4.2)
|
12
|
+
rspec (3.3.0)
|
13
|
+
rspec-core (~> 3.3.0)
|
14
|
+
rspec-expectations (~> 3.3.0)
|
15
|
+
rspec-mocks (~> 3.3.0)
|
16
|
+
rspec-core (3.3.2)
|
17
|
+
rspec-support (~> 3.3.0)
|
18
|
+
rspec-expectations (3.3.1)
|
19
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
20
|
+
rspec-support (~> 3.3.0)
|
21
|
+
rspec-mocks (3.3.2)
|
22
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
23
|
+
rspec-support (~> 3.3.0)
|
24
|
+
rspec-support (3.3.0)
|
25
|
+
timers (4.0.1)
|
26
|
+
hitimes
|
27
|
+
|
28
|
+
PLATFORMS
|
29
|
+
ruby
|
30
|
+
|
31
|
+
DEPENDENCIES
|
32
|
+
bundler (~> 1.10)
|
33
|
+
rake (~> 10.0)
|
34
|
+
rspec
|
35
|
+
should-i-update!
|
36
|
+
timers (= 4.0.1)
|
37
|
+
|
38
|
+
BUNDLED WITH
|
39
|
+
1.10.5
|
data/README.md
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
#should-i-update
|
2
|
+
Takes a friendly look your Gemfile and reports any out of date gems.
|
3
|
+
|
4
|
+
$ should-i-update
|
5
|
+
|
6
|
+
Your Gemfile could do with some updating :(
|
7
|
+
timers (newest 4.1.1, installed 4.0.1)
|
8
|
+
|
9
|
+
|
10
|
+
## How does it work ?
|
11
|
+
|
12
|
+
Under the covers, it's using `bundle outdated`, but then looking at the newest and installed versions to work out if there is a big enough difference to prompt for an update.
|
13
|
+
|
14
|
+
|
15
|
+
## Installation
|
16
|
+
|
17
|
+
Add this line to your application's Gemfile:
|
18
|
+
|
19
|
+
gem 'should-i-update'
|
20
|
+
|
21
|
+
|
22
|
+
And then execute:
|
23
|
+
|
24
|
+
$ bundle
|
25
|
+
|
26
|
+
Or install it yourself as:
|
27
|
+
|
28
|
+
$ gem install should-i-update
|
29
|
+
|
30
|
+
## Usage
|
31
|
+
|
32
|
+
$ should-i-update
|
33
|
+
|
34
|
+
## Contributing
|
35
|
+
|
36
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/coder36/should-i-update.
|
37
|
+
|
data/Rakefile
ADDED
data/bin/should-i-update
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
def bundle_outdated
|
2
|
+
|
3
|
+
`bundle outdated`.lines.reduce([]) do |out, line|
|
4
|
+
res = line.match /\* (.*) \(newest (.*), installed (.*), requested = (.*)\) in group/
|
5
|
+
res ||= line.match /\* (.*) \(newest (.*), installed (.*), requested = (.*)\)/
|
6
|
+
res ||= line.match /\* (.*) \(newest (.*), installed (.*)\) in group/
|
7
|
+
res ||= line.match /\* (.*) \(newest (.*), installed (.*)\)/
|
8
|
+
|
9
|
+
if res
|
10
|
+
name,newest,installed, requested = res[1], res[2], res[3], res[4]
|
11
|
+
gem = { name: name, newest: newest, installed: installed }
|
12
|
+
gem[:requested] = requested if requested
|
13
|
+
out << gem
|
14
|
+
end
|
15
|
+
|
16
|
+
out
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def filter_outdated_gems
|
21
|
+
bundle_outdated.select do |gem|
|
22
|
+
yield Gem::Version.new(gem[:newest]), Gem::Version.new(gem[:installed])
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
def should_i_update
|
27
|
+
gems = filter_outdated_gems { |newest, installed| installed.bump < newest }
|
28
|
+
|
29
|
+
if gems.empty?
|
30
|
+
puts green "Your Gemfile looks good :)"
|
31
|
+
else
|
32
|
+
puts red "Your Gemfile could do with some updating :("
|
33
|
+
gems.each do |gem|
|
34
|
+
puts " #{gem[:name]} (newest #{gem[:newest]}, installed #{gem[:installed]})"
|
35
|
+
end
|
36
|
+
end
|
37
|
+
puts ""
|
38
|
+
|
39
|
+
!gems.empty?
|
40
|
+
end
|
41
|
+
|
42
|
+
def red str
|
43
|
+
"\e[31m#{str}\e[0m"
|
44
|
+
end
|
45
|
+
|
46
|
+
def green str
|
47
|
+
"\e[32m#{str}\e[0m"
|
48
|
+
end
|
49
|
+
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'shouldiupdate/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "should-i-update"
|
8
|
+
spec.version = ShouldIUpdate::VERSION
|
9
|
+
spec.authors = ["coder36"]
|
10
|
+
spec.email = ["markymiddleton@gmail.com"]
|
11
|
+
|
12
|
+
spec.summary = %q{Should I update my gem's ?}
|
13
|
+
spec.description = %q{should-i-update takes a friendly look your Gemfile and reports any out of date gems}
|
14
|
+
spec.homepage = "https://github.com/coder36/should-i-update"
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
17
|
+
spec.bindir = "bin"
|
18
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_development_dependency "bundler", "~> 1.10"
|
22
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
23
|
+
end
|
metadata
ADDED
@@ -0,0 +1,82 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: should-i-update
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- coder36
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-09-08 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.10'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.10'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
description: should-i-update takes a friendly look your Gemfile and reports any out
|
42
|
+
of date gems
|
43
|
+
email:
|
44
|
+
- markymiddleton@gmail.com
|
45
|
+
executables:
|
46
|
+
- should-i-update
|
47
|
+
extensions: []
|
48
|
+
extra_rdoc_files: []
|
49
|
+
files:
|
50
|
+
- ".gitignore"
|
51
|
+
- Gemfile
|
52
|
+
- Gemfile.lock
|
53
|
+
- README.md
|
54
|
+
- Rakefile
|
55
|
+
- bin/should-i-update
|
56
|
+
- lib/shouldiupdate.rb
|
57
|
+
- lib/shouldiupdate/version.rb
|
58
|
+
- shouldiupdate.gemspec
|
59
|
+
homepage: https://github.com/coder36/should-i-update
|
60
|
+
licenses: []
|
61
|
+
metadata: {}
|
62
|
+
post_install_message:
|
63
|
+
rdoc_options: []
|
64
|
+
require_paths:
|
65
|
+
- lib
|
66
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
67
|
+
requirements:
|
68
|
+
- - ">="
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: '0'
|
71
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
requirements: []
|
77
|
+
rubyforge_project:
|
78
|
+
rubygems_version: 2.4.8
|
79
|
+
signing_key:
|
80
|
+
specification_version: 4
|
81
|
+
summary: Should I update my gem's ?
|
82
|
+
test_files: []
|