awetestlib 0.1.8 → 0.1.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -12,11 +12,11 @@ def print_usage
12
12
  awetestlib regression_setup
13
13
  setup awetest regression and register autoitx3.dll
14
14
 
15
- awetestlib rubymine_setup
16
- setup a sample rubymine project
15
+ awetestlib rubymine_setup <project_name>
16
+ setup a rubymine project
17
17
 
18
- awetestlib netbeans_setup
19
- setup a sample netbeans project
18
+ awetestlib netbeans_setup <project_name>
19
+ setup a netbeans project
20
20
 
21
21
  awetestlib cucumber_setup
22
22
  setup cucumber regression and provide skeleton folder structure
@@ -1,6 +1,6 @@
1
1
  def edit_config_file
2
- @new_config_file = File.join(FileUtils.pwd,"sample_netbeans","nbproject","private","configs", "Demo.properties")
3
- @demo_script = File.join(FileUtils.pwd,"sample_netbeans", "demo.rb")
2
+ @new_config_file = File.join(FileUtils.pwd, @proj_dir, "nbproject","private","configs", "Demo.properties")
3
+ @demo_script = File.join(FileUtils.pwd, @proj_dir, "demo.rb")
4
4
  workspace_text = File.read(@new_config_file)
5
5
  new_workspace_text = workspace_text.gsub(/SAMPLE-SCRIPT/,@demo_script )
6
6
  new_workspace_text = new_workspace_text.gsub(/WORK-DIR/, File.dirname(@demo_script))
@@ -8,31 +8,53 @@ def edit_config_file
8
8
  end
9
9
 
10
10
  def edit_private_file
11
- @new_private_file = File.join(FileUtils.pwd,"sample_netbeans","nbproject","private", "private.properties")
11
+ @new_private_file = File.join(FileUtils.pwd, @proj_dir, "nbproject", "private", "private.properties")
12
12
  @bin_dir = File.join(File.dirname(__FILE__))
13
13
  workspace_text = File.read(@new_private_file)
14
14
  new_workspace_text = workspace_text.gsub(/BIN-DIR/,@bin_dir )
15
15
  File.open(@new_private_file, "w") {|file| file.puts new_workspace_text}
16
16
  end
17
17
 
18
+ # def rename_project_name
19
+ # unless ARGV[1].nil?
20
+ # new_dir = File.join(FileUtils.pwd, ARGV[1])
21
+ # File.rename (@netbeans_dir, new_dir)
22
+ # config_file = File.join(FileUtils.pwd,ARGV[1],"nbproject","private","configs", "Demo.properties")
23
+ # workspace_text = File.read(config_file)
24
+ # new_workspace_text = workspace_text.gsub("sample_netbeans",ARGV[1])
25
+ # File.open(config_file, "w") {|file| file.puts new_workspace_text}
26
+ # end
27
+
28
+ # end
29
+
30
+
18
31
  def awetestlib_netbeans_setup
19
- @netbeans_dir = File.join(FileUtils.pwd, "sample_netbeans")
32
+ if ARGV[1].nil?
33
+ @proj_dir = "sample_netbeans"
34
+ else
35
+ @proj_dir = ARGV[1]
36
+ end
37
+
38
+ @netbeans_dir = File.join(FileUtils.pwd, @proj_dir)
20
39
  @source_dir = File.join(File.dirname(__FILE__), '..', 'setup_samples', 'sample_netbeans')
21
40
 
22
41
  if File.exists?(@netbeans_dir)
23
- puts "Sample Netbeans directory already exists."
42
+ puts "Netbeans project directory already exists."
24
43
  exit 1
25
44
  end
26
45
 
27
46
  msg("Question") do
28
- puts "I'm about to create a sample netbeans project in this directory"
47
+ puts "I'm about to create a netbeans project named #{ARGV[1]} in this directory" if ARGV[1]
48
+ puts "I'm about to create a netbeans project named sample_netbeans in this directory" if ARGV[1].nil?
29
49
  puts "Please hit return to confirm that's what you want."
30
50
  puts "NOTE: You may need to run this command as an administrator."
31
51
  end
32
52
  exit 2 unless STDIN.gets.chomp == ''
53
+
33
54
  FileUtils.cp_r(@source_dir, @netbeans_dir)
34
55
  edit_config_file
35
56
  edit_private_file
57
+
36
58
  msg("Info") do
37
59
  puts "Configuring files and settings"
38
60
  end
@@ -1,6 +1,6 @@
1
1
  def edit_config_file
2
- @new_config_file = File.join(FileUtils.pwd,"sample_rubymine",".idea","workspace.xml")
3
- @demo_script = File.join(FileUtils.pwd,"sample_rubymine", "demo.rb")
2
+ @new_config_file = File.join(FileUtils.pwd, @proj_dir, ".idea", "workspace.xml")
3
+ @demo_script = File.join(FileUtils.pwd, @proj_dir, "demo.rb")
4
4
  @awetestlib_file = File.join(File.dirname(__FILE__), "awetestlib")
5
5
  workspace_text = File.read(@new_config_file)
6
6
  new_workspace_text = workspace_text.gsub(/SAMPLE-SCRIPT/,@demo_script )
@@ -10,16 +10,23 @@ def edit_config_file
10
10
  end
11
11
 
12
12
  def awetestlib_rubymine_setup
13
- @rubymine_dir = File.join(FileUtils.pwd, "sample_rubymine")
13
+ if ARGV[1].nil?
14
+ @proj_dir = "sample_rubymine"
15
+ else
16
+ @proj_dir = ARGV[1]
17
+ end
18
+
19
+ @rubymine_dir = File.join(FileUtils.pwd, @proj_dir)
14
20
  @source_dir = File.join(File.dirname(__FILE__), '..', 'setup_samples', 'sample_rubymine')
15
21
 
16
22
  if File.exists?(@rubymine_dir)
17
- puts "Sample Rubymine directory already exists."
23
+ puts "Rubymine project directory already exists."
18
24
  exit 1
19
25
  end
20
26
 
21
27
  msg("Question") do
22
- puts "I'm about to create a sample rubymine project in this directory"
28
+ puts "I'm about to create a rubymine project named #{ARGV[1]} in this directory" if ARGV[1]
29
+ puts "I'm about to create a rubymine project named sample_rubymine in this directory" if ARGV[1].nil?
23
30
  puts "Please hit return to confirm that's what you want."
24
31
  puts "NOTE: You may need to run this command as an administrator."
25
32
  end
data/lib/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Awetestlib
2
- VERSION = "0.1.8"
3
- VERSION_DATE = "2012-08-28"
2
+ VERSION = "0.1.9"
3
+ VERSION_DATE = "2012-08-30"
4
4
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: awetestlib
3
3
  version: !ruby/object:Gem::Version
4
- hash: 11
4
+ hash: 9
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 8
10
- version: 0.1.8
9
+ - 9
10
+ version: 0.1.9
11
11
  platform: ruby
12
12
  authors:
13
13
  - Anthony Woo
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2012-08-28 00:00:00 Z
19
+ date: 2012-08-30 00:00:00 Z
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
22
  name: watir-webdriver