diff options
author | Samuel Giddins <segiddins@segiddins.me> | 2017-08-01 16:27:23 -0500 |
---|---|---|
committer | Samuel Giddins <segiddins@segiddins.me> | 2017-08-01 16:27:23 -0500 |
commit | c5a1f1a7bbb0a0b88cc448bbf8d6b16f2945d363 (patch) | |
tree | 79cbeeca6e0acfa5e8b73bdf5f1e5bae57042df7 | |
parent | 02ed02ff784f7168d29e5633a094013199db4d46 (diff) | |
download | bundler-c5a1f1a7bbb0a0b88cc448bbf8d6b16f2945d363.tar.gz |
Cleanup
-rw-r--r-- | lib/bundler/definition.rb | 7 | ||||
-rw-r--r-- | lib/bundler/lockfile_generator.rb | 6 | ||||
-rw-r--r-- | lib/bundler/lockfile_parser.rb | 1 | ||||
-rw-r--r-- | lib/bundler/rubygems_ext.rb | 16 |
4 files changed, 8 insertions, 22 deletions
diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb index a84f4c3b5d..157492c4fb 100644 --- a/lib/bundler/definition.rb +++ b/lib/bundler/definition.rb @@ -39,17 +39,16 @@ module Bundler parsed_lockfile = LockfileParser.new(Bundler.read_file(lockfile)) changed_gemfiles = parsed_lockfile.gemfiles.values.reject(&:unchanged?) if !changed_gemfiles.empty? - warn "skipping lf since #{changed_gemfiles} changed" + nil elsif unlock != {} - warn "skipping lf since unlocking" + nil elsif parsed_lockfile.gemfiles.empty? - warn "skipping lf since no locked gemfiles" + nil else sources = parsed_lockfile.sources.dup aggregate = sources.delete(parsed_lockfile.aggregate_source) sources = SourceList.from_sources(sources) aggregate.remotes.each {|r| sources.global_rubygems_source = r } if aggregate - # warn "using lockfile" return Definition.new(parsed_lockfile, parsed_lockfile.dependencies.values, sources, {}, parsed_lockfile.ruby_version, parsed_lockfile.optional_groups, parsed_lockfile.gemfiles.keys) end end diff --git a/lib/bundler/lockfile_generator.rb b/lib/bundler/lockfile_generator.rb index 324b39324b..7fb7255ad7 100644 --- a/lib/bundler/lockfile_generator.rb +++ b/lib/bundler/lockfile_generator.rb @@ -19,7 +19,7 @@ module Bundler add_sources add_platforms add_dependencies - add_section("OPTIONAL GROUPS", definition.optional_groups) + add_optional_groups add_gemfiles add_locked_ruby_version add_bundled_with @@ -74,6 +74,10 @@ module Bundler end end + def add_optional_groups + add_section("OPTIONAL GROUPS", definition.optional_groups) + end + def add_gemfiles return unless SharedHelpers.md5_available? gemfiles = {} diff --git a/lib/bundler/lockfile_parser.rb b/lib/bundler/lockfile_parser.rb index 8c23d1bae2..8849432dbd 100644 --- a/lib/bundler/lockfile_parser.rb +++ b/lib/bundler/lockfile_parser.rb @@ -116,7 +116,6 @@ module Bundler else send("parse_#{@state}", line) if @state end - # puts "#{@state.to_s.rjust(15)} => #{line}" end send("finalize_#{@state}") if @state diff --git a/lib/bundler/rubygems_ext.rb b/lib/bundler/rubygems_ext.rb index de421e172d..0dec8479b2 100644 --- a/lib/bundler/rubygems_ext.rb +++ b/lib/bundler/rubygems_ext.rb @@ -150,22 +150,6 @@ module Gem instance_variables.reject {|p| ["@source", "@groups", "@all_sources"].include?(p.to_s) } end - def to_lock(single_line = false) - out = String.new(" #{name}") - unless requirement.none? - reqs = requirement.requirements.map {|o, v| "#{o} #{v}" }.sort.reverse - out << " (#{reqs.join(", ")})" - end - return out if single_line - out << "!" if source - out << "\n" - if groups && groups.any? - p groups - out << " groups: " << groups.sort_by(&:to_s).join(":") << "\n" - end - out - end - # Backport of performance enhancement added to RubyGems 1.4 def matches_spec?(spec) # name can be a Regexp, so use === |