Rakefile in bundleup-0.8.1 vs Rakefile in bundleup-0.9.0

- old
+ new

@@ -19,20 +19,22 @@ task bump: %w[bump:bundler bump:ruby bump:year] namespace :bump do task :bundler do - version = Gemfile.bundler_version + version = Gem.latest_version_for("bundler").to_s replace_in_file ".travis.yml", /bundler -v (\S+)/ => version + replace_in_file "Gemfile.lock", /^BUNDLED WITH\n\s+([\d\.]+)$/ => version end task :ruby do lowest = RubyVersions.lowest_supported lowest_minor = RubyVersions.lowest_supported_minor replace_in_file "bundleup.gemspec", /ruby_version = ">= (.*)"/ => lowest replace_in_file ".rubocop.yml", /TargetRubyVersion: (.*)/ => lowest_minor + replace_in_file "README.md", /Ruby (\d+\.\d+)/ => lowest_minor travis = YAML.safe_load(open(".travis.yml")) travis["rvm"] = RubyVersions.latest_supported_patches + ["ruby-head"] IO.write(".travis.yml", YAML.dump(travis)) end @@ -56,24 +58,10 @@ end end IO.write(path, contents) if contents != orig_contents end -module Gemfile - class << self - def bundler_version - lock_file[/BUNDLED WITH\n (\S+)$/, 1] - end - - private - - def lock_file - @_lock_file ||= IO.read("Gemfile.lock") - end - end -end - module RubyVersions class << self def lowest_supported "#{lowest_supported_minor}.0" end @@ -93,10 +81,10 @@ private def versions @_versions ||= begin - yaml = open( + yaml = URI.open( "https://raw.githubusercontent.com/ruby/www.ruby-lang.org/master/_data/downloads.yml" ) YAML.safe_load(yaml, symbolize_names: true) end end