From 91c5a9a99e2b4e5e03cb61c32c732603c65be543 Mon Sep 17 00:00:00 2001 From: Burin Choomnuan Date: Sun, 26 Jun 2016 02:49:17 -0400 Subject: [PATCH 1/2] Add Gemfile/Gemfile.lock and update bin permission --- Gemfile | 2 ++ Gemfile.lock | 61 +++++++++++++++++++++++++++++++++++++++++++ bin/selenium-cucumber | 0 3 files changed, 63 insertions(+) create mode 100644 Gemfile create mode 100644 Gemfile.lock mode change 100644 => 100755 bin/selenium-cucumber diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..851fabc --- /dev/null +++ b/Gemfile @@ -0,0 +1,2 @@ +source 'https://rubygems.org' +gemspec diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..9c0356e --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,61 @@ +PATH + remote: . + specs: + selenium-cucumber (2.1.4) + appium_lib (>= 4.0.0) + chunky_png (>= 1.3.0) + cucumber (>= 1.3.18) + selenium-webdriver (>= 2.41.0) + +GEM + remote: https://rubygems.org/ + specs: + appium_lib (8.0.2) + awesome_print (~> 1.6) + json (~> 1.8) + nokogiri (~> 1.6.6) + selenium-webdriver (~> 2.49) + tomlrb (~> 1.1) + awesome_print (1.7.0) + builder (3.2.2) + childprocess (0.5.9) + ffi (~> 1.0, >= 1.0.11) + chunky_png (1.3.6) + cucumber (2.4.0) + builder (>= 2.1.2) + cucumber-core (~> 1.5.0) + cucumber-wire (~> 0.0.1) + diff-lcs (>= 1.1.3) + gherkin (~> 4.0) + multi_json (>= 1.7.5, < 2.0) + multi_test (>= 0.1.2) + cucumber-core (1.5.0) + gherkin (~> 4.0) + cucumber-wire (0.0.1) + diff-lcs (1.2.5) + ffi (1.9.10) + gherkin (4.0.0) + json (1.8.3) + mini_portile2 (2.1.0) + multi_json (1.12.1) + multi_test (0.1.2) + nokogiri (1.6.8) + mini_portile2 (~> 2.1.0) + pkg-config (~> 1.1.7) + pkg-config (1.1.7) + rubyzip (1.2.0) + selenium-webdriver (2.53.3) + childprocess (~> 0.5) + rubyzip (~> 1.0) + websocket (~> 1.0) + tomlrb (1.2.2) + websocket (1.2.3) + +PLATFORMS + ruby + +DEPENDENCIES + selenium-cucumber! + +BUNDLED WITH + 1.12.5 diff --git a/bin/selenium-cucumber b/bin/selenium-cucumber old mode 100644 new mode 100755 From be86d5633411d9df82bdb3e3b2854b0e56ce23f4 Mon Sep 17 00:00:00 2001 From: Burin Choomnuan Date: Sun, 26 Jun 2016 03:11:02 -0400 Subject: [PATCH 2/2] Fix the gemspec and add sensible Rakefile - Also add .gitignore - Modify the file permissions for running on *nix system --- .gitignore | 54 +++++++++++++++++++++++++++++++++++++++ Rakefile | 3 +++ bin/generate.rb | 1 - bin/helper.rb | 0 bin/selenium-cucumber | 3 +-- selenium-cucumber.gemspec | 8 +++--- 6 files changed, 62 insertions(+), 7 deletions(-) create mode 100644 .gitignore create mode 100644 Rakefile mode change 100644 => 100755 bin/generate.rb mode change 100644 => 100755 bin/helper.rb diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ad28e38 --- /dev/null +++ b/.gitignore @@ -0,0 +1,54 @@ + +# Created by https://www.gitignore.io/api/ruby + +### Ruby ### +*.gem +*.rbc +/.config +/coverage/ +/InstalledFiles +/pkg/ +/spec/reports/ +/spec/examples.txt +/test/tmp/ +/test/version_tmp/ +/tmp/ + +# Used by dotenv library to load environment variables. +# .env + +## Specific to RubyMotion: +.dat* +.repl_history +build/ +*.bridgesupport +build-iPhoneOS/ +build-iPhoneSimulator/ + +## Specific to RubyMotion (use of CocoaPods): +# +# We recommend against adding the Pods directory to your .gitignore. However +# you should judge for yourself, the pros and cons are mentioned at: +# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control +# +# vendor/Pods/ + +## Documentation cache and generated files: +/.yardoc/ +/_yardoc/ +/doc/ +/rdoc/ + +## Environment normalization: +/.bundle/ +/vendor/bundle +/lib/bundler/man/ + +# for a library or gem, you might want to ignore these files since the code is +# intended to run in multiple environments; otherwise, check them in: +# Gemfile.lock +# .ruby-version +# .ruby-gemset + +# unless supporting rvm < 1.11.0 or doing something fancy, ignore this: +.rvmrc diff --git a/Rakefile b/Rakefile new file mode 100644 index 0000000..d2c48c1 --- /dev/null +++ b/Rakefile @@ -0,0 +1,3 @@ +require 'bundler/gem_tasks' +require 'rake/testtask' +project_name = 'selenium-cucumber' diff --git a/bin/generate.rb b/bin/generate.rb old mode 100644 new mode 100755 index 8b17511..f4c8fe7 --- a/bin/generate.rb +++ b/bin/generate.rb @@ -1,4 +1,3 @@ - def selenium_cucumber_scaffold if File.exists?(@features_dir) puts "A features directory already exists. Stopping..." diff --git a/bin/helper.rb b/bin/helper.rb old mode 100644 new mode 100755 diff --git a/bin/selenium-cucumber b/bin/selenium-cucumber index e998f7e..a4e32dd 100755 --- a/bin/selenium-cucumber +++ b/bin/selenium-cucumber @@ -1,5 +1,4 @@ -#!/usr/bin/env ruby - +#!/usr/bin/env ruby require_relative 'helper.rb' require_relative 'generate.rb' require 'selenium-cucumber/version' diff --git a/selenium-cucumber.gemspec b/selenium-cucumber.gemspec index 1089022..56f2822 100644 --- a/selenium-cucumber.gemspec +++ b/selenium-cucumber.gemspec @@ -1,6 +1,6 @@ -$:.push File.expand_path('../lib', __FILE__) +lib = File.expand_path('../lib', __FILE__) +$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'selenium-cucumber/version' - Gem::Specification.new do |s| s.name = 'selenium-cucumber' s.version = Selenium::Cucumber::VERSION @@ -17,10 +17,10 @@ Gem::Specification.new do |s| s.files += Dir['doc/*'] s.files += Dir['features-skeleton/**/*'] s.files += Dir['example/**/*'] - s.executables = 'selenium-cucumber' + s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) } + s.test_files = s.files.grep(%r{^(test|spec|features)/}) s.require_paths = ['lib'] s.post_install_message = 'Thank you for installing selenium-cucumber gem.' - s.required_ruby_version = '>= 1.9.3' s.add_runtime_dependency 'cucumber', '>= 1.3.18' s.add_runtime_dependency 'selenium-webdriver', '>= 2.41.0'