Sha256: 692a021d320523ad56ff9473b452e9842fbe010dc15998159b9fc1a03e8eee2b

Contents?: true

Size: 1.51 KB

Versions: 21

Compression:

Stored size: 1.51 KB

Contents

def edit_config_file
  @new_config_file = File.join(FileUtils.pwd, @proj_dir, ".idea", "workspace.xml")
  @demo_script = File.join(FileUtils.pwd, @proj_dir, "demo.rb")
  @awetestlib_file = File.join(File.dirname(__FILE__), "awetestlib")
  workspace_text = File.read(@new_config_file)
  new_workspace_text = workspace_text.gsub(/SAMPLE-SCRIPT/,@demo_script )
  new_workspace_text = new_workspace_text.gsub(/RUBY-SCRIPT/, @awetestlib_file)
  new_workspace_text = new_workspace_text.gsub(/WORK-DIR/, File.dirname(@demo_script))
  File.open(@new_config_file, "w") {|file| file.puts new_workspace_text}
end

def awetestlib_rubymine_setup
  if ARGV[1].nil?
    @proj_dir = "sample_rubymine"
  else
    @proj_dir = ARGV[1]
  end

  @rubymine_dir = File.join(FileUtils.pwd, @proj_dir)
  @source_dir = File.join(File.dirname(__FILE__), '..', 'setup_samples', 'sample_rubymine')

  if File.exists?(@rubymine_dir)
    puts "Rubymine project directory already exists."
    exit 1
  end

  msg("Question") do
    puts "I'm about to create a rubymine project named #{ARGV[1]} in this directory" if ARGV[1]
    puts "I'm about to create a rubymine project named sample_rubymine in this directory" if ARGV[1].nil?
    puts "Please hit return to confirm that's what you want."
    puts "NOTE: You may need to run this command as an administrator."
  end
  exit 2 unless STDIN.gets.chomp == ''
  FileUtils.cp_r(@source_dir, @rubymine_dir)
  edit_config_file
  msg("Info") do
    puts "Configuring files and settings"
  end

end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
awetestlib-0.1.29pre3-x86-mingw32 bin/awetestlib-rubymine-setup.rb
awetestlib-0.1.29pre3 bin/awetestlib-rubymine-setup.rb
awetestlib-0.1.29pre1 bin/awetestlib-rubymine-setup.rb
awetestlib-0.1.28-x86-mingw32 bin/awetestlib-rubymine-setup.rb
awetestlib-0.1.27-x86-mingw32 bin/awetestlib-rubymine-setup.rb
awetestlib-0.1.26-x86-mingw32 bin/awetestlib-rubymine-setup.rb
awetestlib-0.1.25-x86-mingw32 bin/awetestlib-rubymine-setup.rb
awetestlib-0.1.24-x86-mingw32 bin/awetestlib-rubymine-setup.rb
awetestlib-0.1.23-x86-mingw32 bin/awetestlib-rubymine-setup.rb
awetestlib-0.1.22-x86-mingw32 bin/awetestlib-rubymine-setup.rb
awetestlib-0.1.20-x86-mingw32 bin/awetestlib-rubymine-setup.rb
awetestlib-0.1.19-x86-mingw32 bin/awetestlib-rubymine-setup.rb
awetestlib-0.1.17-x86-mingw32 bin/awetestlib-rubymine-setup.rb
awetestlib-0.1.16-x86-mingw32 bin/awetestlib-rubymine-setup.rb
awetestlib-0.1.15-x86-mingw32 bin/awetestlib-rubymine-setup.rb
awetestlib-0.1.14-x86-mingw32 bin/awetestlib-rubymine-setup.rb
awetestlib-0.1.13-x86-mingw32 bin/awetestlib-rubymine-setup.rb
awetestlib-0.1.12-x86-mingw32 bin/awetestlib-rubymine-setup.rb
awetestlib-0.1.11-x86-mingw32 bin/awetestlib-rubymine-setup.rb
awetestlib-0.1.10-x86-mingw32 bin/awetestlib-rubymine-setup.rb