win32-autogui 0.4.3 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. data/.gemfiles +3 -3
  2. data/.gitignore +5 -8
  3. data/Gemfile +1 -1
  4. data/Gemfile.lock +54 -34
  5. data/HISTORY.markdown +4 -1
  6. data/README.markdown +20 -17
  7. data/Rakefile +43 -32
  8. data/TODO.markdown +10 -4
  9. data/VERSION +1 -1
  10. data/config/cucumber.yml +4 -3
  11. data/examples/quicknote/FormAboutU.dfm +0 -0
  12. data/examples/quicknote/FormAboutU.pas +0 -0
  13. data/examples/quicknote/FormMainU.dfm +0 -0
  14. data/examples/quicknote/FormMainU.pas +0 -0
  15. data/examples/quicknote/FormSplashU.dfm +0 -0
  16. data/examples/quicknote/FormSplashU.pas +0 -0
  17. data/examples/quicknote/Gemfile +18 -0
  18. data/examples/quicknote/Gemfile.lock +69 -0
  19. data/examples/quicknote/LICENSE +0 -0
  20. data/examples/quicknote/README.markdown +11 -1
  21. data/examples/quicknote/Rakefile +5 -5
  22. data/examples/quicknote/TODO.markdown +0 -0
  23. data/examples/quicknote/exe/.gitignore +0 -0
  24. data/examples/quicknote/lib/quicknote.rb +0 -0
  25. data/examples/quicknote/quicknote.cfg +0 -0
  26. data/examples/quicknote/quicknote.dof +0 -0
  27. data/examples/quicknote/quicknote.dpr +0 -0
  28. data/examples/quicknote/quicknote.res +0 -0
  29. data/examples/quicknote/spec/quicknote/form_about_spec.rb +0 -0
  30. data/examples/quicknote/spec/quicknote/form_main_spec.rb +5 -5
  31. data/examples/quicknote/spec/quicknote/form_splash_spec.rb +3 -3
  32. data/examples/quicknote/spec/spec_helper.rb +6 -4
  33. data/examples/quicknote/spec/watchr.rb +0 -0
  34. data/examples/skeleton/Gemfile +18 -0
  35. data/examples/skeleton/HISTORY.markdown +0 -0
  36. data/examples/skeleton/LICENSE +0 -0
  37. data/examples/skeleton/README.markdown +2 -2
  38. data/examples/skeleton/Rakefile +5 -5
  39. data/examples/skeleton/TODO.markdown +0 -0
  40. data/examples/skeleton/config/cucumber.yml +0 -0
  41. data/examples/skeleton/exe/.gitignore +0 -0
  42. data/examples/skeleton/features/basic.feature +0 -0
  43. data/examples/skeleton/features/step_definitions/.gitignore +0 -0
  44. data/examples/skeleton/features/step_definitions/application_steps.rb +0 -0
  45. data/examples/skeleton/features/support/env.rb +6 -2
  46. data/examples/skeleton/lib/myapp.rb +0 -0
  47. data/examples/skeleton/spec/myapp/form_about_spec.rb +0 -0
  48. data/examples/skeleton/spec/myapp/form_main_spec.rb +0 -0
  49. data/examples/skeleton/spec/spec_helper.rb +6 -4
  50. data/examples/skeleton/spec/watchr.rb +0 -0
  51. data/features/support/env.rb +6 -2
  52. data/lib/win32/autogui/application.rb +3 -2
  53. data/lib/win32/autogui/input.rb +2 -2
  54. data/lib/win32/autogui/window.rb +8 -0
  55. data/lib/win32/autogui/windows/window.rb +1 -0
  56. data/spec/applications/notepad.rb +0 -0
  57. data/spec/auto_gui/application_spec.rb +15 -1
  58. data/spec/auto_gui/input_spec.rb +0 -0
  59. data/spec/auto_gui/logging_spec.rb +1 -1
  60. data/spec/auto_gui/window_spec.rb +2 -2
  61. data/spec/basic_gem/aruba_helper_spec.rb +2 -2
  62. data/spec/basic_gem/basic_gem_spec.rb +5 -1
  63. data/spec/basic_gem/gemspec_spec.rb +6 -6
  64. data/spec/spec_helper.rb +6 -4
  65. data/spec/watchr.rb +2 -0
  66. data/win32-autogui.gemspec +25 -35
  67. metadata +131 -198
  68. data/examples/quicknote/spec/spec.opts +0 -2
  69. data/examples/skeleton/spec/spec.opts +0 -2
  70. data/spec/spec.opts +0 -2
data/.gemfiles CHANGED
@@ -18,6 +18,8 @@ examples/quicknote/FormMainU.dfm
18
18
  examples/quicknote/FormMainU.pas
19
19
  examples/quicknote/FormSplashU.dfm
20
20
  examples/quicknote/FormSplashU.pas
21
+ examples/quicknote/Gemfile
22
+ examples/quicknote/Gemfile.lock
21
23
  examples/quicknote/LICENSE
22
24
  examples/quicknote/README.markdown
23
25
  examples/quicknote/Rakefile
@@ -34,10 +36,10 @@ examples/quicknote/spec/aruba_helper.rb
34
36
  examples/quicknote/spec/quicknote/form_about_spec.rb
35
37
  examples/quicknote/spec/quicknote/form_main_spec.rb
36
38
  examples/quicknote/spec/quicknote/form_splash_spec.rb
37
- examples/quicknote/spec/spec.opts
38
39
  examples/quicknote/spec/spec_helper.rb
39
40
  examples/quicknote/spec/watchr.rb
40
41
  examples/skeleton/.gitignore
42
+ examples/skeleton/Gemfile
41
43
  examples/skeleton/HISTORY.markdown
42
44
  examples/skeleton/LICENSE
43
45
  examples/skeleton/README.markdown
@@ -54,7 +56,6 @@ examples/skeleton/lib/myapp.rb
54
56
  examples/skeleton/spec/aruba_helper.rb
55
57
  examples/skeleton/spec/myapp/form_about_spec.rb
56
58
  examples/skeleton/spec/myapp/form_main_spec.rb
57
- examples/skeleton/spec/spec.opts
58
59
  examples/skeleton/spec/spec_helper.rb
59
60
  examples/skeleton/spec/watchr.rb
60
61
  features/automating_an_application.feature
@@ -77,7 +78,6 @@ spec/auto_gui/window_spec.rb
77
78
  spec/basic_gem/aruba_helper_spec.rb
78
79
  spec/basic_gem/basic_gem_spec.rb
79
80
  spec/basic_gem/gemspec_spec.rb
80
- spec/spec.opts
81
81
  spec/spec_helper.rb
82
82
  spec/watchr.rb
83
83
  win32-autogui.gemspec
data/.gitignore CHANGED
@@ -1,11 +1,8 @@
1
- pkg/*
2
- *.gem
3
- .bundle
4
- coverage
5
- rdoc
6
- .yardoc
1
+ /pkg/
2
+ /.bundle/
3
+ /rdoc/
4
+ /.yardoc/
7
5
  rerun.txt
8
6
  tags
9
- tmp/fixtures
10
- tmp/aruba
11
7
  autogui.log
8
+ /tmp/
data/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
- source :rubygems
1
+ source "http://rubygems.org"
2
2
 
3
3
  # Specify your gem's dependencies in the .gemspec file
4
4
  gemspec
@@ -1,55 +1,75 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- win32-autogui (0.4.3)
4
+ win32-autogui (0.5.0)
5
5
  log4r (>= 1.1.9)
6
- win32-clipboard (= 0.5.2)
7
- win32-process (= 0.6.4)
8
- windows-api (= 0.4.0)
9
- windows-pr (= 1.1.2)
6
+ win32-clipboard (~> 0.5.2)
7
+ win32-process (~> 0.6.5)
8
+ windows-api (~> 0.4.0)
9
+ windows-pr (~> 1.2.0)
10
10
 
11
11
  GEM
12
12
  remote: http://rubygems.org/
13
13
  specs:
14
- aruba (0.2.2)
15
- builder (2.1.2)
16
- cucumber (0.9.4)
17
- builder (~> 2.1.2)
18
- diff-lcs (~> 1.1.2)
19
- gherkin (~> 2.2.9)
20
- json (~> 1.4.6)
21
- term-ansicolor (~> 1.0.5)
14
+ aruba (0.4.6)
15
+ bcat (>= 0.6.1)
16
+ childprocess (>= 0.2.0)
17
+ cucumber (>= 1.0.2)
18
+ rdiscount (>= 1.6.8)
19
+ rspec (>= 2.6.0)
20
+ bcat (0.6.1)
21
+ rack (~> 1.0)
22
+ builder (3.0.0)
23
+ childprocess (0.2.1)
24
+ ffi (~> 1.0.6)
25
+ cucumber (1.0.2)
26
+ builder (>= 2.1.2)
27
+ diff-lcs (>= 1.1.2)
28
+ gherkin (~> 2.4.5)
29
+ json (>= 1.4.6)
30
+ term-ansicolor (>= 1.0.5)
22
31
  diff-lcs (1.1.2)
23
- gherkin (2.2.9)
24
- json (~> 1.4.6)
25
- term-ansicolor (~> 1.0.5)
26
- json (1.4.6)
27
- kramdown (0.12.0)
32
+ ffi (1.0.9-x86-mingw32)
33
+ gherkin (2.4.11-x86-mingw32)
34
+ json (>= 1.4.6)
35
+ json (1.5.3)
28
36
  log4r (1.1.9)
29
- rake (0.8.7)
30
- rspec (1.3.1)
31
- term-ansicolor (1.0.5)
32
- win32-api (1.4.6)
37
+ rack (1.3.2)
38
+ rake (0.9.2)
39
+ rdiscount (1.6.8)
40
+ redcarpet (1.17.2)
41
+ rspec (2.6.0)
42
+ rspec-core (~> 2.6.0)
43
+ rspec-expectations (~> 2.6.0)
44
+ rspec-mocks (~> 2.6.0)
45
+ rspec-core (2.6.4)
46
+ rspec-expectations (2.6.0)
47
+ diff-lcs (~> 1.1.2)
48
+ rspec-mocks (2.6.0)
49
+ term-ansicolor (1.0.6)
50
+ win32-api (1.4.8-x86-mingw32)
33
51
  win32-clipboard (0.5.2)
34
52
  windows-pr (>= 1.0.3)
35
- win32-process (0.6.4)
36
- windows-pr (>= 1.1.0)
53
+ win32-process (0.6.5)
54
+ windows-pr (>= 1.1.2)
55
+ win32console (1.3.0-x86-mingw32)
37
56
  windows-api (0.4.0)
38
57
  win32-api (>= 1.4.5)
39
- windows-pr (1.1.2)
58
+ windows-pr (1.2.0)
40
59
  win32-api (>= 1.4.5)
41
60
  windows-api (>= 0.3.0)
42
- yard (0.6.2)
61
+ yard (0.7.2)
43
62
 
44
63
  PLATFORMS
45
- ruby
64
+ x86-mingw32
46
65
 
47
66
  DEPENDENCIES
48
- aruba (= 0.2.2)
49
- bundler (>= 1.0.7)
50
- cucumber (>= 0.9.4)
51
- kramdown (>= 0.12.0)
52
- rake (>= 0.8.7)
53
- rspec (= 1.3.1)
67
+ aruba (~> 0.4.2)
68
+ bundler (>= 1.0.14)
69
+ cucumber (~> 1.0)
70
+ rake (>= 0.9.2)
71
+ redcarpet (>= 1.17.2)
72
+ rspec (>= 2.6.0)
54
73
  win32-autogui!
55
- yard (>= 0.6.2)
74
+ win32console (>= 1.2.0)
75
+ yard (>= 0.7.2)
@@ -2,10 +2,13 @@ History
2
2
  =======
3
3
  Most recent changes are at the top
4
4
 
5
-
6
5
  Changes
7
6
  -------
8
7
 
8
+ ### 0.5.0 - 08/16/2011 ###
9
+
10
+ * Ruby 1.9.2.p290 compatible
11
+
9
12
  ### 0.4.3 - 03/17/2011 ###
10
13
 
11
14
  * Add test coverage for Autogui::Input using Notepad.exe
@@ -21,21 +21,20 @@ with the Win32-autogui RubyGem.
21
21
 
22
22
  Read our introduction blog posting here: <http://www.gearheadforhire.com/articles/ruby/win32-autogui/using-ruby-to-drive-windows-applications>
23
23
 
24
- Run Win32-autogui's internal specs and example programs.
24
+ Run Win32-autogui's internal specs and example programs from the system gem location
25
25
 
26
26
  gem install win32-autogui
27
- gem install rake bundler win32console cucumber
28
- gem install rspec -v 1.3.1
27
+ gem install bundler
29
28
 
30
- cd C:\Ruby187\lib\ruby\gems\1.8\gems\win32-autogui-0.4.0
29
+ cd C:\Ruby187\lib\ruby\gems\1.8\gems\win32-autogui-X.X.X
31
30
  bundle install
32
31
 
33
32
  # run the calculator specs and features
34
- rake
33
+ bundle exec rake
35
34
 
36
35
  # run the example quicknote specs
37
36
  cd examples\quicknote
38
- rake
37
+ bundle exec rake
39
38
 
40
39
 
41
40
  Example Usage: Driving Calc.exe
@@ -238,13 +237,14 @@ Testing was done on the following Ruby platforms:
238
237
 
239
238
  * ruby 1.8.7 (2008-08-11 patchlevel 72) [i386-cygwin]
240
239
  * ruby 1.8.7 (2010-08-16 patchlevel 302) [i386-mingw32]
240
+ * ruby 1.9.2p290 (2011-07-09) [i386-mingw32]
241
241
 
242
242
 
243
243
  Dependencies
244
244
  ------------
245
245
  Win32-autogui depends on the following RubyGems
246
246
 
247
- * Windows-api <http://github.com/djberg96/win32-api>
247
+ * Windows-api <http://github.com/djberg96/windows-api>
248
248
  * Windows-pr <http://github.com/djberg96/windows-pr>
249
249
  * Win32-process <http://github.com/djberg96/win32-process>
250
250
  * Win32-clipboard <http://github.com/djberg96/win32-clipboard>
@@ -261,27 +261,29 @@ Win32-autogui is available on [RubyGems.org](http://rubygems.org/gems/win32-auto
261
261
  References and Alternative Libraries
262
262
  ------------------------------------
263
263
 
264
- * Scripted GUI Testing with Ruby by Ian Dees <http://pragprog.com/titles/idgtr/scripted-gui-testing-with-ruby>
264
+ * Scripted GUI Testing with Ruby by Ian Dees
265
+ <http://pragprog.com/titles/idgtr/scripted-gui-testing-with-ruby>
265
266
  * RAA - win32-guitest <http://raa.ruby-lang.org/project/win32-guitest>
266
267
  * Updated win32-guitest <http://rubyforge.org/projects/guitest>
267
268
 
268
269
 
269
270
  Development
270
271
  -----------
271
- Win32-autogui development was jump-started by cloning [BasicGem](http://github.com/robertwahler/basic_gem).
272
+ Win32-autogui development was jump-started by cloning
273
+ [BasicGem](http://github.com/robertwahler/basic_gem).
272
274
 
273
275
  ### Dependencies ###
274
276
 
275
277
  * Bundler for dependency management <http://github.com/carlhuda/bundler>
276
- * RSpec for unit testing <http://github.com/dchelimsky/rspec>
277
- * Cucumber for functional testing <http://github.com/aslakhellesoy/cucumber>
278
- * Aruba for CLI testing <http://github.com/aslakhellesoy/aruba>
279
- * YARD for documentation generation <http://github.com/lsegal/yard>
280
- * Kramdown for documentation markup processing <https://github.com/gettalong/kramdown>
278
+ * Rspec for unit testing <http://github.com/rspec/rspec>
279
+ * Cucumber for functional testing <http://github.com/cucumber/cucumber>
280
+ * Aruba for CLI testing <http://github.com/cucumber/aruba>
281
+ * Yard for documentation generation <http://github.com/lsegal/yard>
282
+ * Redcarpet for documentation markup processing <http://github.com/tanoku/redcarpet>
281
283
 
282
284
  ### Rake tasks ###
283
285
 
284
- rake -T
286
+ bundle exec rake -T
285
287
 
286
288
  rake build # Build win32-autogui-0.0.1.gem into the pkg directory
287
289
  rake doc:clean # Remove generated documenation
@@ -318,10 +320,11 @@ Grab the source
318
320
  cd examples/quicknote
319
321
  watchr spec/watchr.rb
320
322
 
321
- Watchr will now watch the files defined in 'spec/watchr.rb' and run RSpec or Cucumber, as appropriate.
323
+ Watchr will now watch the files defined in 'spec/watchr.rb' and run RSpec or
324
+ Cucumber, as appropriate.
322
325
 
323
326
 
324
327
  Copyright
325
328
  ---------
326
329
 
327
- Copyright (c) 2010 GearheadForHire, LLC. See [LICENSE](LICENSE) for details.
330
+ Copyright (c) 2010-2011 GearheadForHire, LLC. See [LICENSE](LICENSE) for details.
data/Rakefile CHANGED
@@ -1,35 +1,15 @@
1
1
  # encoding: utf-8
2
2
 
3
- # bundler/setup is managing $LOAD_PATH, any gem needed by this Rakefile must
4
- # be listed as a development dependency in the gemspec
5
-
6
- require 'rubygems'
3
+ # Bundler is managing $LOAD_PATH, any gem needed by this Rakefile must be
4
+ # listed as a development dependency in the gemspec
7
5
  require 'bundler/setup'
6
+ require 'bundler/gem_tasks'
8
7
 
9
- # TODO: remove this once issue corrected
10
- # Bundler broken up to 1.0.7 on Windows
11
- module Bundler
12
- class GemHelper
13
- def self.install_tasks(opts = nil)
14
- dir = caller.find{|c| /Rakefile:/}[/^(.*?)\/Rakefile:/, 1]
15
- self.new(dir, opts && opts[:name]).install
16
- end
17
- end
18
- end
19
- Bundler::GemHelper.install_tasks
20
-
21
- def gemspec
22
- @gemspec ||= begin
23
- file = File.expand_path('../win32-autogui.gemspec', __FILE__)
24
- eval(File.read(file), binding, file)
25
- end
26
- end
27
-
28
- require 'spec'
29
- require 'spec/rake/spectask'
30
- Spec::Rake::SpecTask.new(:spec) do |spec|
31
- spec.libs << 'lib' << 'spec'
32
- spec.spec_files = FileList['spec/**/*_spec.rb']
8
+ require 'rspec/core/rake_task'
9
+ desc "Run RSpec"
10
+ RSpec::Core::RakeTask.new do |spec|
11
+ spec.pattern = 'spec/**/*_spec.rb'
12
+ spec.rspec_opts = ['--color', '--format nested']
33
13
  end
34
14
 
35
15
  require 'cucumber'
@@ -44,16 +24,18 @@ task :test => [:spec, :features]
44
24
  task :default => :test
45
25
 
46
26
  namespace :doc do
27
+
28
+ doc_version = File.open(File.join(File.dirname(__FILE__), 'VERSION'), "r") { |f| f.read }
47
29
  project_root = File.expand_path(File.dirname(__FILE__))
48
30
  doc_destination = File.join(project_root, 'rdoc')
49
31
 
50
32
  require 'yard'
51
- require 'yard/rake/yardoc_task'
52
33
 
53
34
  YARD::Rake::YardocTask.new(:generate) do |yt|
54
- yt.options = ['--output-dir', doc_destination
55
- ] +
56
- gemspec.rdoc_options - ['--line-numbers', '--inline-source']
35
+ yt.options = ['--output-dir', doc_destination,
36
+ '--title', "Win32-AutoGUI #{doc_version} Documentation",
37
+ '--main', "README.markdown"
38
+ ]
57
39
  end
58
40
 
59
41
  desc "Remove generated documenation"
@@ -67,3 +49,32 @@ namespace :doc do
67
49
  end
68
50
 
69
51
  end
52
+
53
+ # put the gemfiles task in the :build dependency chain
54
+ task :build => [:gemfiles]
55
+
56
+ desc "Generate .gemfiles via 'git ls-files'"
57
+ task :gemfiles do
58
+ files = `git ls-files`
59
+
60
+ filename = File.join(File.dirname(__FILE__), '.gemfiles')
61
+ cached_files = nil
62
+ if File.exists?(filename)
63
+ puts ".gemfiles exists, reading..."
64
+ cached_files = File.open(filename, "rb") {|f| f.read}
65
+ end
66
+
67
+ if cached_files && cached_files.match("\r\n")
68
+ puts ".gemfiles using DOS EOL"
69
+ files.gsub!(/\n/, "\r\n")
70
+ end
71
+
72
+ if cached_files != files
73
+ puts ".gemfiles updating"
74
+ File.open(filename, 'wb') {|f| f.write(files)}
75
+ else
76
+ puts ".gemfiles update not required"
77
+ end
78
+
79
+ raise "unable to process .gemfiles" unless files
80
+ end
@@ -4,9 +4,15 @@ TODO
4
4
  general
5
5
  -------
6
6
 
7
- * (1.0) stop changing $LOAD_PATH in specs and features, modify ENV[] in before and afters
8
- * (1.0) implement Application.find and add option to not start application automatically, allows driving already running applications
7
+ * (1.0) stop changing $LOAD_PATH in specs and features, modify ENV[] in before
8
+ and afters
9
+ * (1.0) implement Application.find and add option to not start application
10
+ automatically, allows driving already running applications
9
11
  * (1.0) application class should be a mixin, not classical inheritance
10
- * (1.0) "rake release" broken on Windows, create patch to fix Bundler. For now, 'git tag v0.3.0 && rake build && gem push pkg/win32-autogui-0.3.0.gem'
11
- * (1.0) add an exception dialog watcher that accepts a block and scans for exception dialogs in a separate thread
12
+ * (1.0) "rake release" broken on Windows, create patch to fix Bundler. For
13
+ now, 'git tag v0.3.0 && rake build && gem push pkg/win32-autogui-0.3.0.gem'
14
+ * (1.0) add an exception dialog watcher that accepts a block and scans for
15
+ exception dialogs in a separate thread
12
16
  * unicode support for window text
17
+ * extract examples/skeleton to a separate cloneable repository or create a Thor
18
+ generator
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.3
1
+ 0.5.0
@@ -1,7 +1,8 @@
1
1
  <%
2
2
  rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : ""
3
- rerun_opts = rerun.to_s.strip.empty? ? "--format pretty features" : "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} #{rerun}"
4
- std_opts = "#{rerun_opts} --format rerun --out rerun.txt --strict --tags ~@wip"
3
+ rerun_opts = rerun.to_s.strip.empty? ? "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} features" : "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} #{rerun}"
4
+ std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} --strict --tags ~@wip"
5
5
  %>
6
- default: <%= std_opts %>
6
+ default: <%= std_opts %> features
7
7
  wip: --tags @wip:3 --wip features
8
+ rerun: <%= rerun_opts %> --format rerun --out rerun.txt --strict --tags ~@wip
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -0,0 +1,18 @@
1
+ source "http://rubygems.org"
2
+
3
+ gem "bundler", ">= 1.0.14"
4
+ gem "rake", ">= 0.9.2"
5
+
6
+ # development path manually added, this is here just for dependencies
7
+ gem "win32-autogui", ">= 0.5.0"
8
+
9
+ # scripting
10
+ gem "mutagem", ">= 0.2.0"
11
+
12
+ # this gem is only used if ANSICON support is not detected
13
+ gem "win32console", ">= 1.2.0"
14
+
15
+ # Specs and Features
16
+ gem "rspec", ">= 2.6.0"
17
+ gem "cucumber", "~> 1.0"
18
+ gem "aruba", "~> 0.4.2"