Class: Vagrant::Rubymine::BashProfile

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant/rubymine/bash_profile.rb

Instance Method Summary collapse

Constructor Details

#initialize(profile_path) ⇒ BashProfile

Returns a new instance of BashProfile.



5
6
7
8
# File 'lib/vagrant/rubymine/bash_profile.rb', line 5

def initialize(profile_path)
  @profile_path = profile_path
  @commands = []
end

Instance Method Details

#add_command(command) ⇒ Object



10
11
12
# File 'lib/vagrant/rubymine/bash_profile.rb', line 10

def add_command(command)
  @commands << "echo \"#{escape_shell(command)}\" >> \"#{@profile_path}\""
end

#apply(&block) ⇒ Object



14
15
16
17
18
# File 'lib/vagrant/rubymine/bash_profile.rb', line 14

def apply(&block)
  @commands.each do |command|
    block.call(command)
  end
end

#create_profileObject



20
21
22
23
# File 'lib/vagrant/rubymine/bash_profile.rb', line 20

def create_profile
  @commands << "rm -f #{@profile_path}"
  @commands << "touch #{@profile_path}"
end