bundleup 0.5.0 → 0.6.0

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: 2cdcf23602e29ab6ba90b1595932e66128998669
4
- data.tar.gz: 18f6f50cc591ee28556dd02b6d49e17ac59bf1f3
3
+ metadata.gz: 937fb9c6fe224775034f3b171ba144c66d219ecd
4
+ data.tar.gz: 125b8152261a96af8e11ae5a194d6c3b086996fd
5
5
  SHA512:
6
- metadata.gz: 4aad6eeb2689aa6e4497773eb121a49a4fa0e76b60b74f7b0093b934d6bc078026076c3fbfb351a3364896a101ec108a43bc479e3cf9a8be6ea7bf8642588274
7
- data.tar.gz: e1858b619e1df3213996abd4da0ad6d27b8ecf8b0ced37bf487baf21412c43ef2d6418d791d7569b0b5ff02e1bdb5e7c2615c86d3d9c94f0536cdf2ade089d5b
6
+ metadata.gz: f270281d398bf180238623faf7e7dd7f7fe049ed6ec700a68ddbb128cc7178c007d3f21e18bacf118d52d1d6153313dad16c3ad2b92c9cfa11377f976d7b4bff
7
+ data.tar.gz: 32cef2ce2c943d5b71a194423a006bb734855eb6e6a0654b219250cb8eee54f7d99baa3739f8dd538ee78019914a32df2e2d0bc69167616bcc31fcdbe15f62b0
@@ -2,6 +2,9 @@ AllCops:
2
2
  Exclude:
3
3
  - "*.gemspec"
4
4
 
5
+ Layout/SpaceAroundEqualsInParameterDefault:
6
+ EnforcedStyle: no_space
7
+
5
8
  Metrics/AbcSize:
6
9
  Exclude:
7
10
  - "test/**/*"
@@ -29,8 +32,5 @@ Style/DoubleNegation:
29
32
  Style/HashSyntax:
30
33
  EnforcedStyle: hash_rockets
31
34
 
32
- Style/SpaceAroundEqualsInParameterDefault:
33
- EnforcedStyle: no_space
34
-
35
35
  Style/StringLiterals:
36
36
  EnforcedStyle: double_quotes
@@ -3,4 +3,5 @@ rvm:
3
3
  - 2.1
4
4
  - 2.2
5
5
  - 2.3.0
6
- before_install: gem install bundler -v 1.11.2
6
+ - 2.4.0
7
+ before_install: gem install bundler -v 1.13.7
@@ -8,6 +8,10 @@ bundleup is in a pre-1.0 state. This means that its APIs and behavior are subjec
8
8
 
9
9
  * Your contribution here!
10
10
 
11
+ ## [0.6.0][] (2017-11-06)
12
+
13
+ * [#1](https://github.com/mattbrictson/bundleup/issues/1): If a Gemfile has an inline or prefix comment for a particular gem, and that gem is being held back due to a pin, then print the comment along with the pin information in bundleup's output.
14
+
11
15
  ## [0.5.0][] (2016-04-01)
12
16
 
13
17
  * You can now pass command-line arguments to bundleup, which will in turn be
@@ -44,7 +48,8 @@ bundleup is in a pre-1.0 state. This means that its APIs and behavior are subjec
44
48
  * Initial release
45
49
 
46
50
  [Semver]: http://semver.org
47
- [Unreleased]: https://github.com/mattbrictson/bundleup/compare/v0.5.0...HEAD
51
+ [Unreleased]: https://github.com/mattbrictson/bundleup/compare/v0.6.0...HEAD
52
+ [0.6.0]: https://github.com/mattbrictson/bundleup/compare/v0.5.0...v0.6.0
48
53
  [0.5.0]: https://github.com/mattbrictson/bundleup/compare/v0.4.0...v0.5.0
49
54
  [0.4.0]: https://github.com/mattbrictson/bundleup/compare/v0.3.0...v0.4.0
50
55
  [0.3.0]: https://github.com/mattbrictson/bundleup/compare/v0.2.0...v0.3.0
data/Rakefile CHANGED
@@ -12,4 +12,4 @@ end
12
12
  RuboCop::RakeTask.new
13
13
 
14
14
  task "release:rubygem_push" => "chandler:push"
15
- task :default => [:test, :rubocop]
15
+ task :default => %i[test rubocop]
@@ -21,9 +21,9 @@ Gem::Specification.new do |spec|
21
21
 
22
22
  spec.add_development_dependency "bundler", "~> 1.11"
23
23
  spec.add_development_dependency "chandler"
24
- spec.add_development_dependency "coveralls"
24
+ spec.add_development_dependency "coveralls", "~> 0.8.19"
25
25
  spec.add_development_dependency "minitest", "~> 5.0"
26
- spec.add_development_dependency "minitest-reporters"
27
- spec.add_development_dependency "rake", "~> 10.0"
28
- spec.add_development_dependency "rubocop", ">= 0.37.2"
26
+ spec.add_development_dependency "minitest-reporters", "~> 1.1"
27
+ spec.add_development_dependency "rake", "~> 12.0"
28
+ spec.add_development_dependency "rubocop", "0.51.0"
29
29
  end
@@ -2,5 +2,6 @@ require "bundleup/version"
2
2
  require "bundleup/console"
3
3
  require "bundleup/bundle_commands"
4
4
  require "bundleup/gem_status"
5
+ require "bundleup/gemfile"
5
6
  require "bundleup/upgrade"
6
7
  require "bundleup/cli"
@@ -5,15 +5,15 @@ module Bundleup
5
5
  include Console
6
6
 
7
7
  def outdated
8
- run(%w(bundle outdated), true)
8
+ run(%w[bundle outdated], true)
9
9
  end
10
10
 
11
11
  def show
12
- run(%w(bundle show))
12
+ run(%w[bundle show])
13
13
  end
14
14
 
15
15
  def update(args=[])
16
- run(%w(bundle update) + args)
16
+ run(%w[bundle update] + args)
17
17
  end
18
18
 
19
19
  private
@@ -60,17 +60,25 @@ module Bundleup
60
60
  [g.name, g.old_version || "(new)", "→", g.new_version || "(removed)"]
61
61
  end
62
62
  upgrades.zip(rows).each do |g, row|
63
- color(g.color, row)
63
+ puts color(g.color, row)
64
64
  end
65
65
  end
66
66
 
67
67
  def print_pins_table
68
68
  rows = tableize(pins) do |g|
69
- pin_operator, pin_version = g.pin.split(" ", 2)
70
- reason = [":", "pinned at", pin_operator.rjust(2), pin_version]
71
- [g.name, g.new_version, "→", g.newest_version, *reason]
69
+ [g.name, g.new_version, "→", g.newest_version, *pin_reason(g)]
72
70
  end
73
71
  puts rows.join("\n")
74
72
  end
73
+
74
+ def pin_reason(gem)
75
+ notes = color(:gray, gemfile.gem_comment(gem.name))
76
+ pin_operator, pin_version = gem.pin.split(" ", 2)
77
+ [":", "pinned at", pin_operator.rjust(2), pin_version, notes]
78
+ end
79
+
80
+ def gemfile
81
+ @gemfile ||= Gemfile.new
82
+ end
75
83
  end
76
84
  end
@@ -9,17 +9,17 @@ module Bundleup
9
9
  }.freeze
10
10
 
11
11
  def ok(message)
12
- color(:green, "✔ #{message}")
12
+ puts color(:green, "✔ #{message}")
13
13
  end
14
14
 
15
15
  def attention(message)
16
- color(:yellow, message)
16
+ puts color(:yellow, message)
17
17
  end
18
18
 
19
19
  def color(color_name, message)
20
20
  code = ANSI_CODES[color_name]
21
21
  return puts(message) if code.nil?
22
- puts "\e[0;#{code};49m#{message}\e[0m"
22
+ "\e[0;#{code};49m#{message}\e[0m"
23
23
  end
24
24
 
25
25
  def confirm(question)
@@ -29,7 +29,7 @@ module Bundleup
29
29
 
30
30
  # Runs a block in the background and displays a spinner until it completes.
31
31
  def progress(message, &block)
32
- spinner = %w(/ - \\ |).cycle
32
+ spinner = %w[/ - \\ |].cycle
33
33
  print "\e[90m#{message}... \e[0m"
34
34
  result = observing_thread(block, 0.5, 0.1) do
35
35
  print "\r\e[90m#{message}... #{spinner.next} \e[0m"
@@ -1,3 +1,4 @@
1
+ # rubocop:disable Metrics/BlockLength
1
2
  module Bundleup
2
3
  GemStatus = Struct.new(:name,
3
4
  :old_version,
@@ -0,0 +1,27 @@
1
+ module Bundleup
2
+ class Gemfile
3
+ def initialize(path="Gemfile")
4
+ @contents = IO.read(path)
5
+ end
6
+
7
+ def gem_comment(gem_name)
8
+ inline_comment(gem_name) || prefix_comment(gem_name)
9
+ end
10
+
11
+ private
12
+
13
+ attr_reader :contents
14
+
15
+ def inline_comment(gem_name)
16
+ contents[/#{gem_declaration_re(gem_name)}.*(#\s*\S+.*)/, 1]
17
+ end
18
+
19
+ def prefix_comment(gem_name)
20
+ contents[/^\s*(#\s*\S+.*)\n#{gem_declaration_re(gem_name)}/, 1]
21
+ end
22
+
23
+ def gem_declaration_re(gem_name)
24
+ /^\s*gem\s+["']#{Regexp.escape(gem_name)}["']/
25
+ end
26
+ end
27
+ end
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module Bundleup
3
- VERSION = "0.5.0".freeze
4
+ VERSION = "0.6.0".freeze
4
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bundleup
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Brictson
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-04-01 00:00:00.000000000 Z
11
+ date: 2017-11-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -42,16 +42,16 @@ dependencies:
42
42
  name: coveralls
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '0'
47
+ version: 0.8.19
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.8.19
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: minitest
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -70,44 +70,44 @@ dependencies:
70
70
  name: minitest-reporters
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ">="
73
+ - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '0'
75
+ version: '1.1'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ">="
80
+ - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '0'
82
+ version: '1.1'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rake
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '10.0'
89
+ version: '12.0'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '10.0'
96
+ version: '12.0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: rubocop
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ">="
101
+ - - '='
102
102
  - !ruby/object:Gem::Version
103
- version: 0.37.2
103
+ version: 0.51.0
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - ">="
108
+ - - '='
109
109
  - !ruby/object:Gem::Version
110
- version: 0.37.2
110
+ version: 0.51.0
111
111
  description:
112
112
  email:
113
113
  - bundleup@mattbrictson.com
@@ -135,6 +135,7 @@ files:
135
135
  - lib/bundleup/cli.rb
136
136
  - lib/bundleup/console.rb
137
137
  - lib/bundleup/gem_status.rb
138
+ - lib/bundleup/gemfile.rb
138
139
  - lib/bundleup/upgrade.rb
139
140
  - lib/bundleup/version.rb
140
141
  - sample.png
@@ -158,7 +159,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
158
159
  version: '0'
159
160
  requirements: []
160
161
  rubyforge_project:
161
- rubygems_version: 2.6.2
162
+ rubygems_version: 2.6.13
162
163
  signing_key:
163
164
  specification_version: 4
164
165
  summary: A friendlier command-line interface for Bundler’s `update` and `outdated`