breezer 0.7.2 → 0.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +14 -0
- data/Gemfile +2 -0
- data/Gemfile.lock +21 -5
- data/Rakefile +5 -3
- data/bin/breezer +1 -59
- data/breezer.gemspec +11 -8
- data/lib/breezer/command.rb +80 -0
- data/lib/breezer/exceptions.rb +22 -0
- data/lib/breezer/freezer.rb +113 -109
- data/lib/breezer/parser.rb +13 -5
- data/lib/breezer/version.rb +3 -1
- data/lib/breezer.rb +3 -1
- data/plugins.rb +20 -0
- data/test/samples/Gemfile +3 -2
- data/test/samples/Gemfile.checked +2 -2
- data/test/samples/Gemfile.final.minor +2 -2
- data/test/samples/Gemfile.final.patch +2 -2
- data/test/test_breezer.rb +1 -2
- data/test/test_freezer.rb +1 -1
- metadata +36 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e55a1de81c8fff6777cfab781d875fcaf8c29e270a51203c74b9f1d263abc8f6
|
4
|
+
data.tar.gz: da017654e6c573fb38744d241012fd71cf8f253119a9f0a96d3d7162bea9cec8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c550d787c69ee714247a88b080519a3cd630a499ff1799d2bdcd6d0fc9ffff1ab3db3924d0920089ed7cfadafe6744f8c6218a8b62ee01140ba2185e25b5710a
|
7
|
+
data.tar.gz: d88d24b54f6c4a44ddab2987adebf58fa4a65b7717e9fe23fce52297eb3f8d141e243a1e1811c7af86261131ccc7ca48f3aff29333fba5b7a92249d0e3e2eced
|
data/.rubocop.yml
ADDED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,27 +1,43 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
breezer (0.7.
|
4
|
+
breezer (0.7.3)
|
5
5
|
bundler (> 1.0)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
+
ast (2.4.0)
|
10
11
|
bump (0.8.0)
|
12
|
+
jaro_winkler (1.5.4)
|
11
13
|
minitest (5.14.0)
|
12
14
|
minitest-around (0.5.0)
|
13
15
|
minitest (~> 5.0)
|
16
|
+
parallel (1.19.1)
|
17
|
+
parser (2.7.0.2)
|
18
|
+
ast (~> 2.4.0)
|
19
|
+
rainbow (3.0.0)
|
14
20
|
rake (13.0.1)
|
21
|
+
rubocop (0.79.0)
|
22
|
+
jaro_winkler (~> 1.5.1)
|
23
|
+
parallel (~> 1.10)
|
24
|
+
parser (>= 2.7.0.1)
|
25
|
+
rainbow (>= 2.2.2, < 4.0)
|
26
|
+
ruby-progressbar (~> 1.7)
|
27
|
+
unicode-display_width (>= 1.4.0, < 1.7)
|
28
|
+
ruby-progressbar (1.10.1)
|
29
|
+
unicode-display_width (1.6.1)
|
15
30
|
|
16
31
|
PLATFORMS
|
17
32
|
ruby
|
18
33
|
|
19
34
|
DEPENDENCIES
|
20
35
|
breezer!
|
21
|
-
bump
|
22
|
-
minitest
|
23
|
-
minitest-around
|
24
|
-
rake (
|
36
|
+
bump (~> 0.8)
|
37
|
+
minitest (~> 5.14)
|
38
|
+
minitest-around (~> 0.5)
|
39
|
+
rake (~> 13.0)
|
40
|
+
rubocop (~> 0.79.0)
|
25
41
|
|
26
42
|
BUNDLED WITH
|
27
43
|
2.1.4
|
data/Rakefile
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'rake/testtask'
|
2
4
|
require 'bundler/setup'
|
3
5
|
require 'bundler/gem_tasks'
|
@@ -5,8 +7,8 @@ require 'bump/tasks'
|
|
5
7
|
|
6
8
|
Rake::TestTask.new do |t|
|
7
9
|
t.libs << 'test'
|
8
|
-
t.test_files = FileList[
|
10
|
+
t.test_files = FileList['test/test_*.rb']
|
9
11
|
end
|
10
12
|
|
11
|
-
desc
|
12
|
-
task :
|
13
|
+
desc 'Run tests'
|
14
|
+
task default: :test
|
data/bin/breezer
CHANGED
@@ -3,64 +3,6 @@
|
|
3
3
|
|
4
4
|
require 'bundler'
|
5
5
|
require 'breezer'
|
6
|
-
require 'optparse'
|
7
6
|
|
8
|
-
|
9
|
-
|
10
|
-
gemfile_file = File.directory?(gemfile_dir) ? File.join(gemfile_dir, 'Gemfile') : gemfile_dir
|
11
|
-
lockfile_file = "#{gemfile_file}.lock"
|
12
|
-
|
13
|
-
options = {
|
14
|
-
debug: false
|
15
|
-
}
|
16
|
-
|
17
|
-
OptionParser.new do |parser|
|
18
|
-
parser.banner = 'Usage: breezer DIR [options]'
|
19
|
-
|
20
|
-
parser.on('-l', '--level LEVEL', "Set the minimum level of gem updates (default: patch). Set to 'exact' to lock gems versions (not recommended).") do |v|
|
21
|
-
unless %w[major minor patch exact].include?(v)
|
22
|
-
raise "Error: level must be one of: 'major', 'minor', 'patch' or 'exact', #{v} given."
|
23
|
-
end
|
24
|
-
|
25
|
-
options[:level] = v
|
26
|
-
end
|
27
|
-
|
28
|
-
parser.on('-L', '--lockfile NAME', 'Use different lockfile (default: Gemfile.lock)') do |v|
|
29
|
-
lockfile_file = v
|
30
|
-
end
|
31
|
-
|
32
|
-
parser.on('-d', '--dry-run', 'Print the updated Gemfile instead of writing it') do
|
33
|
-
options[:dry] = true
|
34
|
-
end
|
35
|
-
|
36
|
-
parser.on('-o', '--output FILE', 'The output file (default: Gemfile)') do |v|
|
37
|
-
options[:output] = v
|
38
|
-
end
|
39
|
-
|
40
|
-
parser.on('-c', '--check', 'Check that all gems have version constraints') do |_v|
|
41
|
-
options[:check] = true
|
42
|
-
end
|
43
|
-
|
44
|
-
parser.on('-h', '--help', 'Show this help message') do
|
45
|
-
puts parser
|
46
|
-
exit(0)
|
47
|
-
end
|
48
|
-
|
49
|
-
parser.on('-v', '--version', 'Show version') do
|
50
|
-
puts Breezer::VERSION
|
51
|
-
exit(0)
|
52
|
-
end
|
53
|
-
end.parse!
|
54
|
-
|
55
|
-
unless File.file?(gemfile_file)
|
56
|
-
puts "Unable to find a Gemfile (searched in #{gemfile_file})"
|
57
|
-
exit(1)
|
58
|
-
end
|
59
|
-
|
60
|
-
unless File.file?(lockfile_file)
|
61
|
-
puts "Unable to find a Lockfile (Gemfile.lock). If you don't have a Gemfile.lock yet, you can run 'bundle install' first. (searched in #{lockfile_file})"
|
62
|
-
exit(1)
|
63
|
-
end
|
64
|
-
|
65
|
-
r = Breezer.freeze!(gemfile_file, lockfile_file, options)
|
7
|
+
r = Breezer::Command.run!(ARGV)
|
66
8
|
exit(r == false ? 2 : 0)
|
data/breezer.gemspec
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
|
3
|
-
|
4
|
-
|
2
|
+
|
3
|
+
# rubocop:todo Gemspec/RequiredRubyVersion
|
4
|
+
$LOAD_PATH.push File.expand_path('lib', __dir__)
|
5
|
+
require 'breezer/version'
|
5
6
|
|
6
7
|
Gem::Specification.new do |s|
|
7
8
|
s.name = 'breezer'
|
@@ -24,13 +25,15 @@ Gem::Specification.new do |s|
|
|
24
25
|
s.summary = 'Breezer!'
|
25
26
|
s.license = 'MIT'
|
26
27
|
|
27
|
-
s.required_ruby_version = '>= 2.
|
28
|
+
s.required_ruby_version = '>= 2.1.0'
|
28
29
|
s.required_rubygems_version = '>= 2.7.0'
|
29
30
|
|
30
|
-
s.add_development_dependency 'bump'
|
31
|
-
s.add_development_dependency 'minitest'
|
32
|
-
s.add_development_dependency 'minitest-around'
|
33
|
-
s.add_development_dependency 'rake', '
|
31
|
+
s.add_development_dependency 'bump', '~> 0.8'
|
32
|
+
s.add_development_dependency 'minitest', '~> 5.14'
|
33
|
+
s.add_development_dependency 'minitest-around', '~> 0.5'
|
34
|
+
s.add_development_dependency 'rake', '~> 13.0'
|
35
|
+
s.add_development_dependency 'rubocop', '~> 0.79.0'
|
34
36
|
|
35
37
|
s.add_runtime_dependency('bundler', '> 1.0')
|
36
38
|
end
|
39
|
+
# rubocop:enable Gemspec/RequiredRubyVersion
|
@@ -0,0 +1,80 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'optparse'
|
4
|
+
|
5
|
+
module Breezer
|
6
|
+
|
7
|
+
#
|
8
|
+
# Used to parse the command line args and run the breezer accordingly
|
9
|
+
#
|
10
|
+
class Command
|
11
|
+
class << self
|
12
|
+
def run!(args)
|
13
|
+
gemfile_file = get_gemfile_file(args)
|
14
|
+
|
15
|
+
options = parse_options({ debug: false }.merge(args))
|
16
|
+
lockfile_file = options[:lockfile_file] || "#{gemfile_file}.lock"
|
17
|
+
|
18
|
+
unless File.file?(gemfile_file)
|
19
|
+
puts "Unable to find a Gemfile (searched in #{gemfile_file})"
|
20
|
+
raise NoGemfileException, "Unable to find a Gemfile (searched in #{gemfile_file})"
|
21
|
+
end
|
22
|
+
|
23
|
+
unless File.file?(lockfile_file)
|
24
|
+
puts "Unable to find a Lockfile (Gemfile.lock). If you don't have a Gemfile.lock yet, "\
|
25
|
+
"you can run 'bundle install' first. (searched in #{lockfile_file})"
|
26
|
+
raise NoLockfileException, "Unable to find a Lockfile (Gemfile.lock) (searched in #{lockfile_file})"
|
27
|
+
end
|
28
|
+
|
29
|
+
Breezer.freeze!(gemfile_file, lockfile_file, options)
|
30
|
+
end
|
31
|
+
|
32
|
+
def get_gemfile_file(args)
|
33
|
+
gemfile_dir = args.first || '.'
|
34
|
+
|
35
|
+
File.directory?(gemfile_dir) ? File.join(gemfile_dir, 'Gemfile') : gemfile_dir
|
36
|
+
end
|
37
|
+
|
38
|
+
def parse_options(options = { debug: false }) # rubocop:todo Metrics/AbcSize
|
39
|
+
OptionParser.new do |parser| # rubocop:todo Metrics/BlockLength
|
40
|
+
parser.banner = 'Usage: breezer DIR [options]'
|
41
|
+
|
42
|
+
parser.on('-l', '--level LEVEL', 'Set the minimum level of gem updates (default: patch).'\
|
43
|
+
' Set to "exact" to lock gems versions (not recommended).') do |v|
|
44
|
+
unless %w[major minor patch exact].include?(v)
|
45
|
+
raise InvalidLevelException, "Error: level must be one of: 'major', 'minor', 'patch' or 'exact', #{v} given."
|
46
|
+
end
|
47
|
+
|
48
|
+
options[:level] = v
|
49
|
+
end
|
50
|
+
|
51
|
+
parser.on('-L', '--lockfile NAME', 'Use different lockfile (default: Gemfile.lock)') do |v|
|
52
|
+
options[:lockfile_file] = v
|
53
|
+
end
|
54
|
+
|
55
|
+
parser.on('-d', '--dry-run', 'Print the updated Gemfile instead of writing it') do
|
56
|
+
options[:dry] = true
|
57
|
+
end
|
58
|
+
|
59
|
+
parser.on('-o', '--output FILE', 'The output file (default: Gemfile)') do |v|
|
60
|
+
options[:output] = v
|
61
|
+
end
|
62
|
+
|
63
|
+
parser.on('-c', '--check', 'Check that all gems have version constraints') do |_v|
|
64
|
+
options[:check] = true
|
65
|
+
end
|
66
|
+
|
67
|
+
parser.on('-h', '--help', 'Show this help message') do
|
68
|
+
puts parser
|
69
|
+
exit(0)
|
70
|
+
end
|
71
|
+
|
72
|
+
parser.on('-v', '--version', 'Show version') do
|
73
|
+
puts Breezer::VERSION
|
74
|
+
exit(0)
|
75
|
+
end
|
76
|
+
end.parse!
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Thrown when we can't find a Gemfile
|
4
|
+
class NoGemfileException < StandardError
|
5
|
+
def initialize(msg = 'Unable to find a Gemfile')
|
6
|
+
super
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
# Thrown when we can't find a Lockfile (Gemfile.lock)
|
11
|
+
class NoLockfileException < StandardError
|
12
|
+
def initialize(msg = 'Unable to find a Lockfile')
|
13
|
+
super
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
# Thrown the supplied level is invalid
|
18
|
+
class InvalidLevelException < StandardError
|
19
|
+
def initialize(msg = "Error: level must be one of: 'major', 'minor', 'patch' or 'exact'")
|
20
|
+
super
|
21
|
+
end
|
22
|
+
end
|
data/lib/breezer/freezer.rb
CHANGED
@@ -2,116 +2,120 @@
|
|
2
2
|
|
3
3
|
require 'bundler'
|
4
4
|
|
5
|
-
|
6
|
-
GEM_REGEX = /gem[\s]+(?<fullname>['"](?<name>[\w\-_]+)['"])(?<fullversion>,?[\s]?['"](?<version>[~><=]+[\s]?[\d\.]+)['"])?(?<fullsecversion>,?[\s]?['"](?<secversion>[~><=]+[\s]?[\d\.]+)['"])?/.freeze
|
5
|
+
module Breezer
|
7
6
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
line
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
7
|
+
#
|
8
|
+
# Will update (freeze) the gems in the Gemfile
|
9
|
+
#
|
10
|
+
class Freezer
|
11
|
+
class << self
|
12
|
+
GEM_REGEX = /gem[\s]+(?<fullname>['"](?<name>[\w\-_]+)['"])(?<fullversion>,?[\s]?['"](?<version>[~><=]+[\s]?[\d\.]+)['"])?(?<fullsecversion>,?[\s]?['"](?<secversion>[~><=]+[\s]?[\d\.]+)['"])?/.freeze
|
13
|
+
|
14
|
+
def update_gemfile!(gemfile, deps, **options)
|
15
|
+
new_gemfile = []
|
16
|
+
gemfile.split("\n").each { |line| new_gemfile << parse(line, deps, options) }
|
17
|
+
[*new_gemfile, ''].join("\n")
|
18
|
+
end
|
19
|
+
|
20
|
+
def check_gemfile!(gemfile, deps, **options)
|
21
|
+
gemfile.split("\n").each_with_index.map do |line, no|
|
22
|
+
[no + 1, check(line, deps, options)]
|
23
|
+
end.to_h
|
24
|
+
end
|
25
|
+
|
26
|
+
# Parse a gemfile line, and return the line updated with dependencies
|
27
|
+
def parse(line, deps, **options)
|
28
|
+
return line unless valid_line?(line)
|
29
|
+
|
30
|
+
matches = line.match(GEM_REGEX)
|
31
|
+
|
32
|
+
# return the line if we didn't matched a name
|
33
|
+
return line unless matches[:name]
|
34
|
+
|
35
|
+
proposed_version = deps[matches[:name]]
|
36
|
+
version_string = get_version_string(proposed_version, options)
|
37
|
+
|
38
|
+
# return the line if we didn't find a version
|
39
|
+
return line unless proposed_version && version_string
|
40
|
+
|
41
|
+
# if we already have a version and we don't want to override
|
42
|
+
return line if matches[:version] && options[:preserve]
|
43
|
+
|
44
|
+
transform_line_for_version(line, matches, version_string)
|
45
|
+
end
|
46
|
+
|
47
|
+
# Return false if there is no deps declaration in the given line
|
48
|
+
def valid_line?(line)
|
49
|
+
# Drop lines if no gem declared
|
50
|
+
return false if (line =~ /gem[\s]+/).nil?
|
51
|
+
|
52
|
+
# Skip git and github direct references
|
53
|
+
return false if line =~ %r{(git://|(github(:|\s)))}
|
54
|
+
|
55
|
+
# Drop line if it's a comment
|
56
|
+
return false unless (line =~ /^[\s]?#/).nil?
|
57
|
+
|
58
|
+
# Drop line if it contains a skip comment
|
59
|
+
return false unless (line =~ /breezer-disable/).nil?
|
60
|
+
|
61
|
+
true
|
62
|
+
end
|
63
|
+
|
64
|
+
# Parse a gemfile line, and return true or false wether the line is valid
|
65
|
+
def check(line, deps, **options)
|
66
|
+
return { valid: true } unless valid_line?(line)
|
67
|
+
|
68
|
+
matches = line.match(GEM_REGEX)
|
69
|
+
|
70
|
+
# return the line if we didn't matched a name
|
71
|
+
return { valid: true } unless matches[:name]
|
72
|
+
|
73
|
+
proposed_version = deps[matches[:name]]
|
74
|
+
get_version_string(proposed_version, options)
|
75
|
+
|
76
|
+
# Do we have a version ?
|
77
|
+
{
|
78
|
+
name: matches[:name],
|
79
|
+
proposed_version: proposed_version,
|
80
|
+
valid: !matches[:version].nil?
|
81
|
+
}
|
82
|
+
end
|
83
|
+
|
84
|
+
# Will rewrite the old deps line with the good version
|
85
|
+
def transform_line_for_version(line, matches, version_string)
|
86
|
+
# We remove the other version
|
87
|
+
line = line.gsub(matches[:fullsecversion], '') if matches[:fullsecversion]
|
88
|
+
|
89
|
+
# If we had a version
|
90
|
+
if matches[:version]
|
91
|
+
line.gsub(matches[:version], version_string)
|
92
|
+
else
|
93
|
+
line.gsub(matches[:fullname], "#{matches[:fullname]}, '#{version_string}'")
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
97
|
+
# Will return the Gemfile.lock version of a deps, with the version converted
|
98
|
+
# according to the given level (default 'patch')
|
99
|
+
def get_version_string(version, options)
|
100
|
+
options = { level: 'patch' }.merge(options)
|
101
|
+
|
102
|
+
gv = Gem::Version.create(version)
|
103
|
+
return unless gv
|
104
|
+
|
105
|
+
segments = [*gv.canonical_segments, 0, 0, 0].first(3)
|
106
|
+
case options[:level].to_s
|
107
|
+
when 'major'
|
108
|
+
"~> #{segments.first}"
|
109
|
+
when 'minor'
|
110
|
+
"~> #{segments.first(2).join('.')}"
|
111
|
+
when 'patch'
|
112
|
+
"~> #{segments.first(3).join('.')}"
|
113
|
+
when 'exact'
|
114
|
+
"= #{version}"
|
115
|
+
else
|
116
|
+
raise("Unsupported option: #{options[:level]}")
|
117
|
+
end
|
118
|
+
end
|
115
119
|
end
|
116
120
|
end
|
117
121
|
end
|
data/lib/breezer/parser.rb
CHANGED
@@ -2,10 +2,18 @@
|
|
2
2
|
|
3
3
|
require 'bundler'
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
5
|
+
module Breezer
|
6
|
+
|
7
|
+
#
|
8
|
+
# Used to parse the Gemfile.lock and extract the dependencies.
|
9
|
+
#
|
10
|
+
class Parser
|
11
|
+
class << self
|
12
|
+
def deps(lockfile_path = 'Gemfile.lock', **_options)
|
13
|
+
lockfile = Bundler::LockfileParser.new(Bundler.read_file(lockfile_path))
|
14
|
+
specs = lockfile.specs
|
15
|
+
specs.map { |h| [h.name, h.version.version] }.to_h
|
16
|
+
end
|
17
|
+
end
|
10
18
|
end
|
11
19
|
end
|
data/lib/breezer/version.rb
CHANGED
data/lib/breezer.rb
CHANGED
@@ -40,7 +40,7 @@ module Breezer
|
|
40
40
|
File.open(output_path, 'w') do |file|
|
41
41
|
file.write(updated_gemfile)
|
42
42
|
end
|
43
|
-
puts
|
43
|
+
puts 'Gemfile updated !'
|
44
44
|
end
|
45
45
|
updated_gemfile
|
46
46
|
end
|
@@ -58,6 +58,8 @@ module Breezer
|
|
58
58
|
end
|
59
59
|
end
|
60
60
|
|
61
|
+
require 'breezer/exceptions'
|
61
62
|
require 'breezer/parser'
|
62
63
|
require 'breezer/freezer'
|
63
64
|
require 'breezer/version'
|
65
|
+
require 'breezer/command'
|
data/plugins.rb
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
# This is the plugin for bundler
|
2
|
+
class Breezer < Bundler::Plugin::API
|
3
|
+
# Register this class as a handler for the `my_command` command
|
4
|
+
command "freeze"
|
5
|
+
|
6
|
+
# The exec method will be called with the `command` and the `args`.
|
7
|
+
# This is where you should handle all logic and functionality
|
8
|
+
def exec(command, args)
|
9
|
+
puts "You called " + command + " with args: " + args.inspect
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
# #!/usr/bin/env ruby
|
14
|
+
# # frozen_string_literal: true
|
15
|
+
|
16
|
+
# require 'bundler'
|
17
|
+
# require 'breezer'
|
18
|
+
|
19
|
+
# r = Breezer::Command.run!(ARGV)
|
20
|
+
# exit(r == false ? 2 : 0)
|
data/test/samples/Gemfile
CHANGED
@@ -5,10 +5,10 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" }
|
|
5
5
|
|
6
6
|
ruby '2.6.5'
|
7
7
|
|
8
|
-
gem 'colorize'
|
9
|
-
gem 'ruby-progressbar'
|
10
8
|
gem 'bootsnap', '>= 1.4.2', require: false
|
11
9
|
gem 'carrierwave-azure', github: 'tsara27/carrierwave-azure'
|
10
|
+
gem 'colorize'
|
11
|
+
gem 'ruby-progressbar'
|
12
12
|
gem 'tzinfo-data', platforms: %i[mingw mswin x64_mingw jruby]
|
13
13
|
# gem 'cancancan', '~> 1.10'
|
14
14
|
gem 'rack', git: 'git://github.com/rack/rack.git'
|
@@ -26,3 +26,4 @@ group :development do
|
|
26
26
|
gem 'spring-watcher-listen', '~> 2.0.0'
|
27
27
|
gem 'web-console', '>= 3.3.0'
|
28
28
|
end
|
29
|
+
|
@@ -5,10 +5,10 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" }
|
|
5
5
|
|
6
6
|
ruby '2.6.5'
|
7
7
|
|
8
|
-
gem 'colorize', '~> 0.8.1'
|
9
|
-
gem 'ruby-progressbar', '~> 1.10.1'
|
10
8
|
gem 'bootsnap', '~> 1.4.5', require: false
|
11
9
|
gem 'carrierwave-azure', github: 'tsara27/carrierwave-azure'
|
10
|
+
gem 'colorize', '~> 0.8.1'
|
11
|
+
gem 'ruby-progressbar', '~> 1.10.1'
|
12
12
|
gem 'tzinfo-data', platforms: %i[mingw mswin x64_mingw jruby] # breezer-disable
|
13
13
|
# gem 'cancancan', '~> 1.10'
|
14
14
|
gem 'rack', git: 'git://github.com/rack/rack.git'
|
@@ -5,10 +5,10 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" }
|
|
5
5
|
|
6
6
|
ruby '2.6.5'
|
7
7
|
|
8
|
-
gem 'colorize', '~> 0.8'
|
9
|
-
gem 'ruby-progressbar', '~> 1.10'
|
10
8
|
gem 'bootsnap', '~> 1.4', require: false
|
11
9
|
gem 'carrierwave-azure', github: 'tsara27/carrierwave-azure'
|
10
|
+
gem 'colorize', '~> 0.8'
|
11
|
+
gem 'ruby-progressbar', '~> 1.10'
|
12
12
|
gem 'tzinfo-data', platforms: %i[mingw mswin x64_mingw jruby]
|
13
13
|
# gem 'cancancan', '~> 1.10'
|
14
14
|
gem 'rack', git: 'git://github.com/rack/rack.git'
|
@@ -5,10 +5,10 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" }
|
|
5
5
|
|
6
6
|
ruby '2.6.5'
|
7
7
|
|
8
|
-
gem 'colorize', '~> 0.8.1'
|
9
|
-
gem 'ruby-progressbar', '~> 1.10.1'
|
10
8
|
gem 'bootsnap', '~> 1.4.5', require: false
|
11
9
|
gem 'carrierwave-azure', github: 'tsara27/carrierwave-azure'
|
10
|
+
gem 'colorize', '~> 0.8.1'
|
11
|
+
gem 'ruby-progressbar', '~> 1.10.1'
|
12
12
|
gem 'tzinfo-data', platforms: %i[mingw mswin x64_mingw jruby]
|
13
13
|
# gem 'cancancan', '~> 1.10'
|
14
14
|
gem 'rack', git: 'git://github.com/rack/rack.git'
|
data/test/test_breezer.rb
CHANGED
@@ -4,7 +4,7 @@ require 'minitest/autorun'
|
|
4
4
|
require 'minitest/around/spec'
|
5
5
|
require 'breezer'
|
6
6
|
|
7
|
-
describe Breezer do
|
7
|
+
describe Breezer do # rubocop:todo Metrics/BlockLength
|
8
8
|
around do |test|
|
9
9
|
files = Dir["#{File.dirname(__FILE__)}/samples/*"]
|
10
10
|
Dir.mktmpdir do |dir|
|
@@ -49,5 +49,4 @@ describe Breezer do
|
|
49
49
|
specs = Breezer.freeze!('Gemfile.checked', 'Gemfile.lock', check: true)
|
50
50
|
_(specs).must_equal true
|
51
51
|
end
|
52
|
-
|
53
52
|
end
|
data/test/test_freezer.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: breezer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- André Aubin
|
@@ -14,58 +14,72 @@ dependencies:
|
|
14
14
|
name: bump
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0'
|
19
|
+
version: '0.8'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '0'
|
26
|
+
version: '0.8'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: minitest
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '5.14'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '5.14'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: minitest-around
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '0'
|
47
|
+
version: '0.5'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '0'
|
54
|
+
version: '0.5'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rake
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
61
|
+
version: '13.0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - "
|
66
|
+
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
68
|
+
version: '13.0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rubocop
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 0.79.0
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 0.79.0
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
84
|
name: bundler
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -88,6 +102,7 @@ extensions: []
|
|
88
102
|
extra_rdoc_files: []
|
89
103
|
files:
|
90
104
|
- ".gitignore"
|
105
|
+
- ".rubocop.yml"
|
91
106
|
- Gemfile
|
92
107
|
- Gemfile.lock
|
93
108
|
- README.md
|
@@ -96,9 +111,12 @@ files:
|
|
96
111
|
- breezer.gemspec
|
97
112
|
- images/demo.gif
|
98
113
|
- lib/breezer.rb
|
114
|
+
- lib/breezer/command.rb
|
115
|
+
- lib/breezer/exceptions.rb
|
99
116
|
- lib/breezer/freezer.rb
|
100
117
|
- lib/breezer/parser.rb
|
101
118
|
- lib/breezer/version.rb
|
119
|
+
- plugins.rb
|
102
120
|
- test/samples/Gemfile
|
103
121
|
- test/samples/Gemfile.checked
|
104
122
|
- test/samples/Gemfile.final.minor
|
@@ -119,7 +137,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
119
137
|
requirements:
|
120
138
|
- - ">="
|
121
139
|
- !ruby/object:Gem::Version
|
122
|
-
version: 2.
|
140
|
+
version: 2.1.0
|
123
141
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
124
142
|
requirements:
|
125
143
|
- - ">="
|