Class: Vagrant::Rubymine::BashProfile
- Inherits:
-
Object
- Object
- Vagrant::Rubymine::BashProfile
- Defined in:
- lib/vagrant/rubymine/bash_profile.rb
Instance Method Summary collapse
- #add_command(command) ⇒ Object
- #apply(&block) ⇒ Object
- #create_profile ⇒ Object
-
#initialize(profile_path) ⇒ BashProfile
constructor
A new instance of BashProfile.
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_profile ⇒ Object
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 |