diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..b3196d6 --- /dev/null +++ b/Gemfile @@ -0,0 +1,18 @@ +## Dependencies in this Gemfile are managed through the gemspec. Add/remove +## depenencies there, rather than editing this file +# +#require 'pathname' +#NAME = 'win_gui' +#BASE_PATH = Pathname.new(__FILE__).dirname +#GEMSPEC_PATH = BASE_PATH + "#{NAME}.gemspec" +# +#source :gemcutter +# +## Setup gemspec dependencies +#gemspec = eval(GEMSPEC_PATH.read) +#gemspec.dependencies.each do |dep| +# group = dep.type == :development ? :development : :default +# gem dep.name, dep.requirement, :group => group +#end +#gem(gemspec.name, gemspec.version, :path => BASE_PATH) + diff --git a/HISTORY b/HISTORY new file mode 100644 index 0000000..ea4fc8d --- /dev/null +++ b/HISTORY @@ -0,0 +1,7 @@ +== 0.0.0 / 2010-01-08 + +* Birthday! Initial concept: Following "Scripted Gui testing with Ruby" by Ian Dees + +== 0.2.0 / 2010-05-15 + +* Window class extracted into a separate lib diff --git a/LICENSE b/LICENSE index 87c2914..8aacd5e 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2009 arvicco +Copyright (c) 2010 Arvicco Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff --git a/README.rdoc b/README.rdoc index d019613..e28c985 100644 --- a/README.rdoc +++ b/README.rdoc @@ -1,92 +1,52 @@ = win_gui - by: Arvicco - url: http://github.com/arvicco/win_gui +by:: Arvicco +url:: http://github.com/arvicco/win_gui == DESCRIPTION: -WinGui is a module that provides convenient wrapper methods for multiple Win32 API -functions (mostly from user32.dll) dealing with Windows GUI manipulation/automation. -In addition to straightforward API wrappers, it also defines more Ruby-like -abstractions and convenience methods for manipulating windows and other GUI -elements (such as WinGui::Window class and its methods). - -!!! This project has been discontinued due to problems with Win32::API Callbacks and -need to support non-MRI Ruby implementations. So, new project is now based on FFI and -can be found here: http://github.com/arvicco/win (it is now available as a gem 'win'). - -== SUMMARY - -So you want to write a simple program that makes some Win32 API function calls. -You searched MSDN high and low and you now know exactly what functions you need. -All you want is just putting those function calls into your Ruby code without too -much pain. You'd love this to be more or less natural extension of your Ruby code, -preferably not turning your code base into an ugly C++ like spaghetty -of CamelCase calls, String/Array pack/unpack gymnastics, buffer allocations, -extracting return values from [in/out] parameters and checking return codes for 0. - -You can definitely use excellent 'win32-api' gem by Daniel J. Berger and Park Heesob -that allows you to define Win32 API objects for any function you can find on MSDN, -execute calls on them and even define callback objects that some of those API functions expect. - -However, that gem will only take you so far. You'll still have to handle (somewhat) -gory details of argument preparation, mimicking pointers with Strings and stuff. -For example, consider the amount of code needed to complete a task as simple as -getting unicode title text for the window that you already have handle for: - - api = Win32::API.new( 'GetWindowTextW', ['L', 'P', 'I'], 'L', 'user32' ) - buffer = "\x00" * 1024 # I just hope it will be enough... - num_chars = api.call( window_handle, buffer, buffer.size) - title = if num_chars == 0 - nil - else - buffer.force_encoding('utf-16LE').encode('utf-8').rstrip - end - -Ew, ugly. What about getting information about process id for a known window? - - api = Win32::API.new( 'GetWindowThreadProcessId', ['L', 'P'], 'L' , 'user32' ) - process_packed = [1].pack('L') - thread = api.call(window_handle, process_packed) - process = process_packed.unpack('L').first - -Wow, packing and unpacking arrays into String to get hold of a simple integer id. -Just great. Now, wouldn't it be MUCH better if you can just say something like this: +WinGui is a module that provides higher-level abstractions/wrappers around GUI-related +Win32 API functions. It uses Win gem as a basis, which in turn uses FFI. +So (in theory) it should work for any Ruby implementation supporting FFI. In practice, +it's been only tested under mingw and cygwin Ruby 1.9.1. - title = window_text( window_handle) - thread, process = window_thread_process_id( window_handle) +== SUMMARY: -What about API functions expecting callbacks? Well, something like this may be nice: +Win gem provides Rubyesque wrappers around Win32 API functions, but it is not enough to +to make Win32 API calls feel like more or less natural extension of Ruby code. +The reason for this, straightforward API wrappers are not object-oriented enough. - enum_child_windows( parent_handle, message ){|child_handle, message| puts child_handle } +For example, here is how you deal with typical GUI-related tasks using Win: -If you think about it, callbacks are not much more than code blocks, so let's not be afraid -to treat them as such. It would be also good if test functions return true/false instead of -zero/nonzero, find functions return nil if nothing was found etc... + require 'win/gui' + include Win::Gui::Window -So this is an idea behind WinGui library - make Win32 API functions more fun to use -and feel more natural inside Ruby code. Following the principle of least surprise, we -define methods with Rubyesque names (minimized? instead of IsMinimized, etc), minimum -arguments with sensible defaults, explicit return values and generous use of attached blocks. + window_handle = find_window('WinClass', nil) + title = window_text(window_handle ) + thread, process = window_thread_process_id(window_handle) + puts window_handle, title, thread, process -Well, we even keep a backup solution for those diehard Win32 API longtimers who would rather -allocate their buffer strings by hand and mess with obscure return codes. If you use original -CamelCase method name instead of Rubyesque snake_case one, it will expect those standard -parameters you know and love from MSDN, return your zeroes instead of nils and support no -other enhancements. + enum_child_windows(window_handle, message) do |child_handle, message| + title = window_text(child_handle ) + thread, process = window_thread_process_id(child_handle) + puts child_handle, title, thread, process + end + close_window(window_handle) -And if you do not see your favorite Windows API function amoung those already defined, it is -quite easy to define new one with def_api class method that does a lot of heavy lifting for -you and can be customized with options and code blocks to give you reusable API wrapper method -with the exact behavior you need. +Ideally, there should be thin wrapper class around window handle, and the code above should be more like this: + require 'win_gui' + include WinGui -== DOCUMENTATION: + window = Window.find(:first, :class => 'WinClass) + puts window.handle, window.title, window.thread, window.process + window.each_child {|child| puts child.handle, child.title, child.thread, child.process } + window.close -See WinGui and WinGui::Window for documentation +This library will try to provide such wrappers and convenience methods that will make working with +Windows GUI-related code much more fun than it is right now. == REQUIREMENTS: -Only works with Ruby 1.9.1+ since it uses some of the most recent features (block -arguments given to block, etc...) +Only works with Ruby 1.9.1+ compatible implementations since Win gem uses some of latest Ruby features. == FEATURES/PROBLEMS: @@ -104,11 +64,14 @@ Contributors always welcome! More examples will follow when the code is closer to production quality... -== CREDITS: +== CREDITS/PRIOR ART: This library started as an extension of ideas and code described in excellent book "Scripted GUI Testing with Ruby" by Ian Dees. +Win32::GuiTest by MoonWolf is a port of eponimous Perl library to Ruby +(http://raa.ruby-lang.org/project/win32-guitest). I do not like its Perlisms though. + == LICENSE: -Copyright (c) 2009 Arvicco. See LICENSE for details \ No newline at end of file +Copyright (c) 2010 Arvicco. See LICENSE for details \ No newline at end of file diff --git a/Rakefile b/Rakefile index f8b6bd5..b322030 100644 --- a/Rakefile +++ b/Rakefile @@ -1,58 +1,24 @@ -require 'rubygems' -require 'rake' +require 'pathname' +NAME = 'win_gui' +BASE_PATH = Pathname.new(__FILE__).dirname +LIB_PATH = BASE_PATH + 'lib' +PKG_PATH = BASE_PATH + 'pkg' +DOC_PATH = BASE_PATH + 'rdoc' -begin - require 'jeweler' - Jeweler::Tasks.new do |gem| - gem.name = "win_gui" - gem.summary = %Q{Rubyesque interfaces and wrappers for Win32 API GUI functions} - gem.description = %Q{Rubyesque interfaces and wrappers for Win32 API GUI functions} - gem.email = "arvitallian@gmail.com" - gem.homepage = "http://github.com/arvicco/win_gui" - gem.authors = ["arvicco"] - gem.add_dependency "win32-api", ">= 1.4.5" - gem.add_development_dependency "rspec", ">= 1.2.9" - gem.add_development_dependency "cucumber", ">= 0" - # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings - end - Jeweler::GemcutterTasks.new -rescue LoadError - puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler" -end - -require 'spec/rake/spectask' -Spec::Rake::SpecTask.new(:spec) do |spec| - spec.libs << 'lib' << 'spec' - spec.spec_files = FileList['spec/**/*_spec.rb'] -end +$LOAD_PATH.unshift LIB_PATH.to_s +require 'version' -Spec::Rake::SpecTask.new(:rcov) do |spec| - spec.libs << 'lib' << 'spec' - spec.pattern = 'spec/**/*_spec.rb' - spec.rcov = true -end - -task :spec => :check_dependencies +CLASS_NAME = WinGui +VERSION = CLASS_NAME::VERSION begin - require 'cucumber/rake/task' - Cucumber::Rake::Task.new(:features) - - task :features => :check_dependencies + require 'rake' rescue LoadError - task :features do - abort "Cucumber is not available. In order to run features, you must: sudo gem install cucumber" - end + require 'rubygems' + gem 'rake', '~> 0.8.3.1' + require 'rake' end -task :default => :spec +# Load rakefile tasks +Dir['tasks/*.rake'].sort.each { |file| load file } -require 'rake/rdoctask' -Rake::RDocTask.new do |rdoc| - version = File.exist?('VERSION') ? File.read('VERSION') : "" - - rdoc.rdoc_dir = 'rdoc' - rdoc.title = "win_gui #{version}" - rdoc.rdoc_files.include('README*') - rdoc.rdoc_files.include('lib/**/*.rb') -end diff --git a/VERSION b/VERSION index c946ee6..0ea3a94 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.1.6 +0.2.0 diff --git a/features/support/env.rb b/features/support/env.rb index 3f91603..97dac7e 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -1,4 +1,7 @@ $LOAD_PATH.unshift(File.dirname(__FILE__) + '/../../lib') require 'win_gui' - require 'spec/expectations' +require 'spec/stubs/cucumber' + +require 'pathname' +BASE_PATH = Pathname.new(__FILE__).dirname + '../..' diff --git a/lib/version.rb b/lib/version.rb new file mode 100644 index 0000000..62347ee --- /dev/null +++ b/lib/version.rb @@ -0,0 +1,8 @@ +require 'pathname' + +module WinGui + + VERSION_FILE = Pathname.new(__FILE__).dirname + '../VERSION' # :nodoc: + VERSION = VERSION_FILE.exist? ? VERSION_FILE.read.strip : nil + +end \ No newline at end of file diff --git a/lib/win_gui.rb b/lib/win_gui.rb index 9c0a730..7326209 100644 --- a/lib/win_gui.rb +++ b/lib/win_gui.rb @@ -1,3 +1,25 @@ -win_gui_dir = File.join(File.dirname(__FILE__),"win_gui" ) -$LOAD_PATH.unshift win_gui_dir unless $LOAD_PATH.include?(win_gui_dir) -require 'win_gui' \ No newline at end of file +require 'version' + +module WinGui + +# require "bundler" +# Bundler.setup + + # Requires ruby source file(s). Accepts either single filename/glob or Array of filenames/globs. + # Accepts following options: + # :*file*:: Lib(s) required relative to this file - defaults to __FILE__ + # :*dir*:: Required lib(s) located under this dir name - defaults to gem name + # + def self.require_libs( libs, opts={} ) + file = Pathname.new(opts[:file] || __FILE__) + [libs].flatten.each do |lib| + name = file.dirname + (opts[:dir] || file.basename('.*')) + lib.gsub(/(? 'test:run' +#task 'gem:release' => 'test:run' + +#Bundler not ready for prime time just yet +#desc 'Bundle dependencies' +#task :bundle do +# output = `bundle check 2>&1` +# +# unless $?.to_i == 0 +# puts output +# system "bundle install" +# puts +# end +#end \ No newline at end of file diff --git a/tasks/doc.rake b/tasks/doc.rake new file mode 100644 index 0000000..21c7884 --- /dev/null +++ b/tasks/doc.rake @@ -0,0 +1,14 @@ +desc 'Alias to doc:rdoc' +task :doc => 'doc:rdoc' + +namespace :doc do + require 'rake/rdoctask' + Rake::RDocTask.new do |rdoc| +# Rake::RDocTask.new(:rdoc => "rdoc", :clobber_rdoc => "clobber", :rerdoc => "rerdoc") do |rdoc| + rdoc.rdoc_dir = DOC_PATH.basename.to_s + rdoc.title = "#{NAME} #{VERSION} Documentation" + rdoc.main = "README.doc" + rdoc.rdoc_files.include('README*') + rdoc.rdoc_files.include('lib/**/*.rb') + end +end diff --git a/tasks/gem.rake b/tasks/gem.rake new file mode 100644 index 0000000..1a29f79 --- /dev/null +++ b/tasks/gem.rake @@ -0,0 +1,39 @@ +desc "Alias to gem:release" +task :release => 'gem:release' + +desc "Alias to gem:install" +task :install => 'gem:install' + +desc "Alias to gem:build" +task :gem => 'gem:build' + +namespace :gem do + gem_file = "#{NAME}-#{VERSION}.gem" + + desc "(Re-)Build gem" + task :build do + puts "Remove existing gem package" + rm_rf PKG_PATH + puts "Build new gem package" + system "gem build #{NAME}.gemspec" + puts "Move built gem to package dir" + mkdir_p PKG_PATH + mv gem_file, PKG_PATH + end + + desc "Cleanup already installed gem(s)" + task :cleanup do + puts "Cleaning up installed gem(s)" + system "gem cleanup #{NAME}" + end + + desc "Build and install gem" + task :install => :build do + system "gem install #{PKG_PATH}/#{gem_file}" + end + + desc "Build and push gem to Gemcutter" + task :release => [:build, 'git:tag'] do + system "gem push #{PKG_PATH}/#{gem_file}" + end +end \ No newline at end of file diff --git a/tasks/git.rake b/tasks/git.rake new file mode 100644 index 0000000..6f38934 --- /dev/null +++ b/tasks/git.rake @@ -0,0 +1,34 @@ +desc "Alias to git:commit" +task :git => 'git:commit' + +namespace :git do + + desc "Stage and commit your work [with message]" + task :commit, [:message] do |t, args| + puts "Staging new (unversioned) files" + system "git add --all" + if args.message + puts "Committing with message: #{args.message}" + system %Q[git commit -a -m "#{args.message}" --author arvicco] + else + puts "Committing" + system %Q[git commit -a -m "No message" --author arvicco] + end + end + + desc "Push local changes to Github" + task :push => :commit do + puts "Pushing local changes to remote" + system "git push" + end + + desc "Create (release) tag on Github" + task :tag => :push do + tag = VERSION + puts "Creating git tag: #{tag}" + system %Q{git tag -a -m "Release tag #{tag}" #{tag}} + puts "Pushing #{tag} to remote" + system "git push origin #{tag}" + end + +end \ No newline at end of file diff --git a/tasks/spec.rake b/tasks/spec.rake new file mode 100644 index 0000000..56dd8e3 --- /dev/null +++ b/tasks/spec.rake @@ -0,0 +1,19 @@ +desc 'Alias to spec:spec' +task :spec => 'spec:spec' + +namespace :spec do + require 'spec/rake/spectask' + + desc "Run all specs" + Spec::Rake::SpecTask.new(:spec) do |t| + t.spec_opts = ['--options', %Q{"#{BASE_PATH}/spec/spec.opts"}] + t.spec_files = FileList['spec/**/*_spec.rb'] + end + + desc "Run specs with RCov" + Spec::Rake::SpecTask.new(:rcov) do |t| + t.spec_files = FileList['spec/**/*_spec.rb'] + t.rcov = true + t.rcov_opts = ['--exclude', 'spec'] + end +end diff --git a/tasks/version.rake b/tasks/version.rake new file mode 100644 index 0000000..c51ba68 --- /dev/null +++ b/tasks/version.rake @@ -0,0 +1,71 @@ +class Version + attr_accessor :major, :minor, :patch, :build + + def initialize(version_string) + raise "Invalid version #{version_string}" unless version_string =~ /^(\d+)\.(\d+)\.(\d+)(?:\.(.*?))?$/ + @major = $1.to_i + @minor = $2.to_i + @patch = $3.to_i + @build = $4 + end + + def bump_major(x) + @major += x.to_i + @minor = 0 + @patch = 0 + @build = nil + end + + def bump_minor(x) + @minor += x.to_i + @patch = 0 + @build = nil + end + + def bump_patch(x) + @patch += x.to_i + @build = nil + end + + def update(major, minor, patch, build=nil) + @major = major + @minor = minor + @patch = patch + @build = build + end + + def write(desc = nil) + CLASS_NAME::VERSION_FILE.open('w') {|file| file.puts to_s } + (BASE_PATH + 'HISTORY').open('a') do |file| + file.puts "\n== #{to_s} / #{Time.now.strftime '%Y-%m-%d'}\n" + file.puts "\n* #{desc}\n" if desc + end + end + + def to_s + [major, minor, patch, build].compact.join('.') + end +end + +desc 'Set version: [x.y.z] - explicitly, [1/10/100] - bump major/minor/patch, [.build] - build' +task :version, [:command, :desc] do |t, args| + version = Version.new(VERSION) + case args.command + when /^(\d+)\.(\d+)\.(\d+)(?:\.(.*?))?$/ # Set version explicitly + version.update($1, $2, $3, $4) + when /^\.(.*?)$/ # Set build + version.build = $1 + when /^(\d{1})$/ # Bump patch + version.bump_patch $1 + when /^(\d{1})0$/ # Bump minor + version.bump_minor $1 + when /^(\d{1})00$/ # Bump major + version.bump_major $1 + else # Unknown command, just display VERSION + puts "#{NAME} #{version}" + next + end + + puts "Writing version #{version} to VERSION file" + version.write args.desc +end diff --git a/win_gui.gemspec b/win_gui.gemspec index e2007d4..cec9e8c 100644 --- a/win_gui.gemspec +++ b/win_gui.gemspec @@ -1,215 +1,42 @@ -# Generated by jeweler -# DO NOT EDIT THIS FILE DIRECTLY -# Instead, edit Jeweler::Tasks in rakefile, and run the gemspec command -# -*- encoding: utf-8 -*- +# Gemspecs should not be generated, but edited directly. +# Refer to: http://yehudakatz.com/2010/04/02/using-gemspecs-as-intended/ -Gem::Specification.new do |s| - s.name = %q{win_gui} - s.version = "0.1.6" +lib = File.expand_path('../lib/', __FILE__) +$:.unshift lib unless $:.include?(lib) - s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= - s.authors = ["arvicco"] - s.date = %q{2010-02-14} - s.description = %q{Rubyesque interfaces and wrappers for Win32 API GUI functions} - s.email = %q{arvitallian@gmail.com} - s.extra_rdoc_files = [ - "LICENSE", - "README.rdoc" - ] - s.files = [ - ".document", - ".gitignore", - "LICENSE", - "README.rdoc", - "Rakefile", - "VERSION", - "book_code/early_success/bundle.rb", - "book_code/early_success/english.txt", - "book_code/early_success/jruby_basics.rb", - "book_code/early_success/windows_basics.rb", - "book_code/guessing/locknote.rb", - "book_code/guessing/monkeyshines.rb", - "book_code/guessing/note.rb", - "book_code/guessing/note_spec.rb", - "book_code/guessing/replay.rb", - "book_code/guessing/seed.rb", - "book_code/guessing/spec_helper.rb", - "book_code/guessing/windows_gui.rb", - "book_code/home_stretch/junquenote.rb", - "book_code/home_stretch/locknote.rb", - "book_code/home_stretch/note.rb", - "book_code/home_stretch/note_spec.rb", - "book_code/home_stretch/spec_helper.rb", - "book_code/home_stretch/swing_gui.rb", - "book_code/home_stretch/windows_gui.rb", - "book_code/junquenote/exports.sh", - "book_code/junquenote/jruby_mac.sh", - "book_code/junquenote/junquenote_app.rb", - "book_code/novite/Rakefile", - "book_code/novite/app/controllers/application.rb", - "book_code/novite/app/controllers/guests_controller.rb", - "book_code/novite/app/controllers/parties_controller.rb", - "book_code/novite/app/helpers/application_helper.rb", - "book_code/novite/app/helpers/guests_helper.rb", - "book_code/novite/app/helpers/parties_helper.rb", - "book_code/novite/app/models/guest.rb", - "book_code/novite/app/models/party.rb", - "book_code/novite/app/models/party_mailer.rb", - "book_code/novite/app/views/layouts/application.rhtml", - "book_code/novite/app/views/parties/new.html.erb", - "book_code/novite/app/views/parties/show.html.erb", - "book_code/novite/app/views/party_mailer/invite.erb", - "book_code/novite/config/boot.rb", - "book_code/novite/config/database.yml", - "book_code/novite/config/environment.rb", - "book_code/novite/config/environments/development.rb", - "book_code/novite/config/environments/production.rb", - "book_code/novite/config/environments/test.rb", - "book_code/novite/config/initializers/inflections.rb", - "book_code/novite/config/initializers/mime_types.rb", - "book_code/novite/config/routes.rb", - "book_code/novite/db/migrate/001_create_parties.rb", - "book_code/novite/db/migrate/002_create_guests.rb", - "book_code/novite/db/schema.rb", - "book_code/novite/log/empty.txt", - "book_code/novite/public/.htaccess", - "book_code/novite/public/404.html", - "book_code/novite/public/422.html", - "book_code/novite/public/500.html", - "book_code/novite/public/dispatch.cgi", - "book_code/novite/public/dispatch.fcgi", - "book_code/novite/public/dispatch.rb", - "book_code/novite/public/favicon.ico", - "book_code/novite/public/images/rails.png", - "book_code/novite/public/index.html", - "book_code/novite/public/javascripts/application.js", - "book_code/novite/public/javascripts/controls.js", - "book_code/novite/public/javascripts/dragdrop.js", - "book_code/novite/public/javascripts/effects.js", - "book_code/novite/public/javascripts/prototype.js", - "book_code/novite/public/robots.txt", - "book_code/novite/script/about", - "book_code/novite/script/console", - "book_code/novite/script/destroy", - "book_code/novite/script/generate", - "book_code/novite/script/performance/benchmarker", - "book_code/novite/script/performance/profiler", - "book_code/novite/script/performance/request", - "book_code/novite/script/plugin", - "book_code/novite/script/process/inspector", - "book_code/novite/script/process/reaper", - "book_code/novite/script/process/spawner", - "book_code/novite/script/runner", - "book_code/novite/script/server", - "book_code/novite/test/test_helper.rb", - "book_code/one_more_thing/applescript.rb", - "book_code/one_more_thing/note_spec.rb", - "book_code/one_more_thing/spec_helper.rb", - "book_code/one_more_thing/textedit-pure.rb", - "book_code/one_more_thing/textedit.applescript", - "book_code/one_more_thing/textedit.rb", - "book_code/one_more_thing/textnote.rb", - "book_code/simplify/junquenote.rb", - "book_code/simplify/locknote.rb", - "book_code/simplify/note.rb", - "book_code/simplify/note_spec.rb", - "book_code/simplify/swing_gui.rb", - "book_code/simplify/windows_gui.rb", - "book_code/simplify/windows_gui_spec.rb", - "book_code/story/invite.story", - "book_code/story/journal.txt", - "book_code/story/novite_stories.rb", - "book_code/story/party.rb", - "book_code/story/password.rb", - "book_code/story/password.story", - "book_code/story/rsvp.story", - "book_code/tables/TestTime.html", - "book_code/tables/TestTimeSample.html", - "book_code/tables/calculate_time.rb", - "book_code/tables/calculator.rb", - "book_code/tables/calculator_actions.rb", - "book_code/tables/calculator_spec.rb", - "book_code/tables/fit.rb", - "book_code/tables/matrix.rb", - "book_code/tables/pseudocode.rb", - "book_code/tubes/book_selenium.rb", - "book_code/tubes/book_watir.rb", - "book_code/tubes/dragdrop.html", - "book_code/tubes/html_capture.rb", - "book_code/tubes/joke_list.rb", - "book_code/tubes/list_spec.rb", - "book_code/tubes/search_spec.rb", - "book_code/tubes/selenium_example.rb", - "book_code/tubes/selenium_link.rb", - "book_code/tubes/web_server.rb", - "book_code/windows/wgui.rb", - "book_code/windows/wobj.rb", - "book_code/windows/wsh.rb", - "book_code/with_rspec/empty_spec.rb", - "book_code/with_rspec/junquenote.rb", - "book_code/with_rspec/locknote.rb", - "book_code/with_rspec/note_spec.rb", - "book_code/with_rspec/should_examples.rb", - "features/step_definitions/win_gui_steps.rb", - "features/support/env.rb", - "features/win_gui.feature", - "lib/note.rb", - "lib/note/java/jemmy.jar", - "lib/note/java/jnote.rb", - "lib/note/java/jruby_basics.rb", - "lib/note/java/junquenote_app.rb", - "lib/note/java/note_spec.rb", - "lib/note/win/locknote.rb", - "lib/win_gui.rb", - "lib/win_gui/constants.rb", - "lib/win_gui/def_api.rb", - "lib/win_gui/string_extensions.rb", - "lib/win_gui/win_gui.rb", - "lib/win_gui/window.rb", - "old/windows_basics.rb", - "old/wnote.rb", - "old/wnote_spec.rb", - "spec/note/win/locknote_spec.rb", - "spec/spec.opts", - "spec/spec_helper.rb", - "spec/test_apps/locknote/LockNote.exe", - "spec/win_gui/def_api_spec.rb", - "spec/win_gui/string_extensions_spec.rb", - "spec/win_gui/win_gui_spec.rb", - "spec/win_gui/window_spec.rb", - "win_gui.gemspec" - ] - s.homepage = %q{http://github.com/arvicco/win_gui} - s.rdoc_options = ["--charset=UTF-8"] - s.require_paths = ["lib"] - s.rubygems_version = %q{1.3.5} - s.summary = %q{Rubyesque interfaces and wrappers for Win32 API GUI functions} - s.test_files = [ - "spec/note/win/locknote_spec.rb", - "spec/spec_helper.rb", - "spec/win_gui/def_api_spec.rb", - "spec/win_gui/string_extensions_spec.rb", - "spec/win_gui/window_spec.rb", - "spec/win_gui/win_gui_spec.rb" - ] +require 'version' - if s.respond_to? :specification_version then - current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION - s.specification_version = 3 +Gem::Specification.new do |gem| + gem.name = "win_gui" + gem.version = ::WinGui::VERSION + gem.summary = %q{FIXME: New project win_gui} + gem.description = %q{FIXME: New project win_gui} + gem.authors = ["arvicco"] + gem.email = "arvitallian@gmail.com" + gem.homepage = %q{http://github.com/arvicco/win_gui} + gem.platform = Gem::Platform::RUBY + gem.date = Date.today.to_s - if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then - s.add_runtime_dependency(%q, [">= 1.4.5"]) - s.add_development_dependency(%q, [">= 1.2.9"]) - s.add_development_dependency(%q, [">= 0"]) - else - s.add_dependency(%q, [">= 1.4.5"]) - s.add_dependency(%q, [">= 1.2.9"]) - s.add_dependency(%q, [">= 0"]) - end - else - s.add_dependency(%q, [">= 1.4.5"]) - s.add_dependency(%q, [">= 1.2.9"]) - s.add_dependency(%q, [">= 0"]) - end + # Files setup + versioned = `git ls-files -z`.split("\0") + gem.files = Dir['{bin,lib,man,spec,features,tasks}/**/*', 'Rakefile', 'README*', 'LICENSE*', + 'VERSION*', 'CHANGELOG*', 'HISTORY*', 'ROADMAP*', '.gitignore'] & versioned + gem.executables = (Dir['bin/**/*'] & versioned).map{|file|File.basename(file)} + gem.test_files = Dir['spec/**/*'] & versioned + gem.require_paths = ["lib"] + + # RDoc setup + gem.has_rdoc = true + gem.rdoc_options.concat %W{--charset UTF-8 --main README.rdoc --title win_gui} + gem.extra_rdoc_files = ["LICENSE", "HISTORY", "README.rdoc"] + + # Dependencies + gem.add_development_dependency(%q{rspec}, [">= 1.2.9"]) + gem.add_development_dependency(%q{cucumber}, [">= 0"]) + #gem.add_dependency(%q{bunder}, [">= 1.2.9"]) + + gem.rubyforge_project = "" + gem.rubygems_version = `gem -v` + #gem.required_rubygems_version = ">= 1.3.6" end