Class: Bundler::Patch::RubyVersion
- Inherits:
-
UpdateSpec
- Object
- UpdateSpec
- Bundler::Patch::RubyVersion
- Defined in:
- lib/bundler/patch/ruby_version.rb
Instance Attribute Summary
Attributes inherited from UpdateSpec
#patched_versions, #regexes, #target_dir, #target_file
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(target_dir: Dir.pwd, patched_versions: []) ⇒ RubyVersion
constructor
A new instance of RubyVersion.
- #update ⇒ Object
Methods inherited from UpdateSpec
#calc_new_version, #file_replace, #target_path_fn, #update_to_new_version, #verbose_puts
Constructor Details
#initialize(target_dir: Dir.pwd, patched_versions: []) ⇒ RubyVersion
Returns a new instance of RubyVersion.
10 11 12 13 14 15 |
# File 'lib/bundler/patch/ruby_version.rb', line 10 def initialize(target_dir: Dir.pwd, patched_versions: []) super(target_file: target_file, target_dir: target_dir, regexes: regexes, patched_versions: patched_versions) end |
Class Method Details
.files ⇒ Object
3 4 5 6 7 8 |
# File 'lib/bundler/patch/ruby_version.rb', line 3 def self.files { '.ruby-version' => [/.*/], '.jenkins.xml' => [/\<string\>(.*)\<\/string\>/, /rvm.*\>ruby-(.*)@/, /version.*rbenv.*\>(.*)\</] } end |
Instance Method Details
#update ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/bundler/patch/ruby_version.rb', line 17 def update self.class.files.each_pair do |file, regexes| @target_file = file @regexes = regexes file_replace end end |