bundle-diff 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +18 -0
- data/README.md +1 -1
- data/bundle-diff.gemspec +2 -2
- data/lib/bundler/diff/cli.rb +27 -2
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4ed4c76ee646c06c88b5bde31765fa22f76addd88db752b1dd7decfed3488658
|
4
|
+
data.tar.gz: 2137ebd6d32389f7359bf9866b1b5e172443d8d351c91fa91f1ed40b11de7e7d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: adb81ab85d860f01b9d0b6d930343d0c619142d32c93e1b89ade252d49c05a4a223ef5d5f46aa840c13b499f7dc5afd958164b675337d736408e01a9d8cdb4d3
|
7
|
+
data.tar.gz: 589a6ebdd77a1922a2d130143c5f45bb275528c75189c55d621418e645556a9abf6870bf3552d5c7daa725937786cff3965e589c7104e0128b4a141b27c2e55e
|
data/CHANGES.md
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
# 1.1.0
|
2
|
+
|
3
|
+
* Added version option
|
4
|
+
|
5
|
+
Use the version option to diff against a specific gem version. For example:
|
6
|
+
|
7
|
+
$ bundle diff GEMNAME --version 1.2.3
|
8
|
+
|
9
|
+
The option accepts RubyGem version requirements. For example:
|
10
|
+
|
11
|
+
$ bundle diff GEMNAME --version '~> 2'
|
12
|
+
|
13
|
+
* Added help option
|
14
|
+
|
15
|
+
|
16
|
+
# 1.0.0
|
17
|
+
|
18
|
+
* First version!
|
data/README.md
CHANGED
data/bundle-diff.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'bundle-diff'
|
3
|
-
s.version = '1.
|
3
|
+
s.version = '1.1.0'
|
4
4
|
s.license = 'GPL-3.0'
|
5
5
|
s.platform = Gem::Platform::RUBY
|
6
6
|
s.authors = ['Tim Craft']
|
@@ -8,7 +8,7 @@ Gem::Specification.new do |s|
|
|
8
8
|
s.homepage = 'https://github.com/readysteady/bundle-diff'
|
9
9
|
s.description = 'Bundler plugin for showing diffs of bundled gems against latest versions'
|
10
10
|
s.summary = 'See description'
|
11
|
-
s.files = Dir.glob('lib/**/*.rb') + %w[LICENSE.txt README.md bundle-diff.gemspec]
|
11
|
+
s.files = Dir.glob('lib/**/*.rb') + %w[CHANGES.md LICENSE.txt README.md bundle-diff.gemspec]
|
12
12
|
s.required_ruby_version = '>= 2.3.0'
|
13
13
|
s.add_dependency('bundler', '>= 1.0', '< 3.0')
|
14
14
|
s.require_path = 'lib'
|
data/lib/bundler/diff/cli.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'bundler'
|
2
2
|
require 'rubygems'
|
3
3
|
require 'rubygems/package'
|
4
|
+
require 'optparse'
|
4
5
|
require 'pathname'
|
5
6
|
require 'tmpdir'
|
6
7
|
|
@@ -10,6 +11,8 @@ module Bundler::Diff::CLI
|
|
10
11
|
def run(args=ARGV)
|
11
12
|
Bundler.ui = Bundler::UI::Shell.new
|
12
13
|
|
14
|
+
args = option_parser.parse(args) unless args.empty?
|
15
|
+
|
13
16
|
gem_name = args.first
|
14
17
|
|
15
18
|
error('gem name required') unless gem_name
|
@@ -34,6 +37,28 @@ module Bundler::Diff::CLI
|
|
34
37
|
|
35
38
|
private
|
36
39
|
|
40
|
+
def options
|
41
|
+
@options ||= {
|
42
|
+
version: Gem::Requirement.default
|
43
|
+
}
|
44
|
+
end
|
45
|
+
|
46
|
+
def option_parser
|
47
|
+
OptionParser.new do |opts|
|
48
|
+
opts.banner = 'Usage: bundle diff GEMNAME [options]'
|
49
|
+
|
50
|
+
opts.on '-h', '--help' do
|
51
|
+
puts "#{opts}\n"
|
52
|
+
|
53
|
+
Kernel::exit
|
54
|
+
end
|
55
|
+
|
56
|
+
opts.on '-v', '--version VERSION', 'Specify version of gem to diff against' do |value|
|
57
|
+
options[:version] = Gem::Requirement.new(value)
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
37
62
|
def installed_specs
|
38
63
|
@installed_specs ||= Bundler.load.specs.each_with_object({}) do |spec, hash|
|
39
64
|
next if ignore?(spec)
|
@@ -51,8 +76,8 @@ module Bundler::Diff::CLI
|
|
51
76
|
end
|
52
77
|
end
|
53
78
|
|
54
|
-
def fetch(name, target_dir
|
55
|
-
dependency = Gem::Dependency.new(name, version)
|
79
|
+
def fetch(name, target_dir)
|
80
|
+
dependency = Gem::Dependency.new(name, options[:version])
|
56
81
|
|
57
82
|
specs_and_sources, errors = Gem::SpecFetcher.fetcher.spec_for_dependency(dependency)
|
58
83
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bundle-diff
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tim Craft
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-11-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -38,6 +38,7 @@ executables:
|
|
38
38
|
extensions: []
|
39
39
|
extra_rdoc_files: []
|
40
40
|
files:
|
41
|
+
- CHANGES.md
|
41
42
|
- LICENSE.txt
|
42
43
|
- README.md
|
43
44
|
- bin/bundler-diff
|