Sha256: 687353469d1a7ab22bfdf489788ba6ae1da90e7c16f0baf1013a4e3cda51b975

Contents?: true

Size: 1.47 KB

Versions: 18

Compression:

Stored size: 1.47 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

18 entries across 18 versions & 1 rubygems

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