Sha256: 731396e102ac251fb686daf9ed2bfadfa4dc6fcf91a6c2a2665a6bdc249a4278

Contents?: true

Size: 703 Bytes

Versions: 8

Compression:

Stored size: 703 Bytes

Contents

module Bundler::Patch
  class RubyVersion < UpdateSpec
    RUBY_VERSION_LINE_REGEXPS = [/ruby\s+["'](.*)['"]/]

    def self.files
      @files ||= {
        '.ruby-version' => [/.*/]
      }
    end

    def initialize(target_bundle: TargetBundle.new, patched_versions: [])
      super(target_file: target_bundle.gemfile,
            target_dir: target_bundle.dir,
            regexes: regexes,
            patched_versions: patched_versions)
    end

    def update
      hash = self.class.files.dup
      hash[@target_file.dup] = RUBY_VERSION_LINE_REGEXPS
      hash.each_pair do |file, regexes|
        @target_file = file
        @regexes = regexes
        file_replace
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
bundler-patch-1.2.0 lib/bundler/patch/ruby_version.rb
bundler-patch-1.1.0 lib/bundler/patch/ruby_version.rb
bundler-patch-1.1.0.pre6 lib/bundler/patch/ruby_version.rb
bundler-patch-1.1.0.pre5 lib/bundler/patch/ruby_version.rb
bundler-patch-1.1.0.pre4 lib/bundler/patch/ruby_version.rb
bundler-patch-1.1.0.pre3 lib/bundler/patch/ruby_version.rb
bundler-patch-1.1.0.pre2 lib/bundler/patch/ruby_version.rb
bundler-patch-1.1.0.pre1 lib/bundler/patch/ruby_version.rb