Class: Maguro::Gemfile

Inherits:
Object
  • Object
show all
Defined in:
lib/maguro/gemfile.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(builder) ⇒ Gemfile

Returns a new instance of Gemfile.



5
6
7
8
# File 'lib/maguro/gemfile.rb', line 5

def initialize(builder)
  @builder = builder
  @file_name = "Gemfile"
end

Instance Attribute Details

#builderObject (readonly)

Returns the value of attribute builder.



3
4
5
# File 'lib/maguro/gemfile.rb', line 3

def builder
  @builder
end

#file_nameObject (readonly)

Returns the value of attribute file_name.



3
4
5
# File 'lib/maguro/gemfile.rb', line 3

def file_name
  @file_name
end

Instance Method Details

#remove(regex, replacement) ⇒ Object



10
11
12
# File 'lib/maguro/gemfile.rb', line 10

def remove(regex, replacement)
  builder.gsub_file(file_name, regex, replacement)
end