Permalink
Browse files

Merge pull request #82 from rtyler/bug/79-separating-out-gems

Separating out the Jasmine and Cucumber code into peripheral gems
  • Loading branch information...
2 parents 55804aa + 8ac48b8 commit 6cc5a0de5b567bd09c1254ef309953b8ec767359 @rtyler rtyler committed Aug 15, 2012
View
@@ -18,8 +18,6 @@ namespace :spec do
end
end
-task :default => :'spec:unit'
-
def ensure_rvm!
unless File.exists? File.expand_path("~/.rvm/scripts/rvm")
abort("I don't think you have RVM installed, which means this test will fail")
@@ -77,33 +75,27 @@ Rake::RDocTask.new do |rdoc|
rdoc.rdoc_files.include('lib/**/*.rb')
end
-desc 'Release gem to rubygems.org'
-task :release => :build do
- gems = Dir["pkg/*.gem"]
- if gems
- system("gem push #{gems[-1]}")
- end
+GEMS = ['sauce-jasmine', 'sauce-cucumber']
+
+def gem_kind(name)
+ name.split('-')[1]
end
-desc 'tag current version'
-task :tag do
- version = nil
- File.open("sauce.gemspec").each do |line|
- if line =~ /s.version = "(.*)"/
- version = $1
+GEMS.each do |gem|
+
+ namespace gem_kind(gem) do
+ desc "Build the #{gem} gem"
+ task :build do
+ sh "(cd gems/#{gem} && rake build)"
end
- end
- if version.nil?
- raise "Couldn't find version"
+ desc "Release the #{gem} gem"
+ task :release do
+ sh "(cd gems/#{gem} && rake release)"
+ end
end
-
- system "git tag v#{version}"
-end
-
-desc 'push to github'
-task :push do
- system "git push origin master --tags"
end
-#task :default => [:tag, :release, :push]
+task :build => GEMS.collect { |n| "#{gem_kind(n)}:build" }
+task :release => [:build]
+task :default => [:'spec:unit', :build]
@@ -4,3 +4,4 @@ gem 'cucumber'
gem 'rspec'
gem 'capybara'
gem 'sauce', :path => '../../'
+gem 'sauce-cucumber', :path => '../../gems/sauce-cucumber'
@@ -1,6 +1,5 @@
require 'capybara/cucumber'
-require 'sauce/capybara'
-require 'sauce/capybara/cucumber'
+require 'sauce/cucumber'
Capybara.current_driver = :sauce
@@ -0,0 +1,17 @@
+*.gem
+*.rbc
+.bundle
+.config
+.yardoc
+Gemfile.lock
+InstalledFiles
+_yardoc
+coverage
+doc/
+lib/bundler/man
+pkg
+rdoc
+spec/reports
+test/tmp
+test/version_tmp
+tmp
@@ -0,0 +1,29 @@
+# Sauce::Cucumber
+
+TODO: Write a gem description
+
+## Installation
+
+Add this line to your application's Gemfile:
+
+ gem 'sauce-cucumber'
+
+And then execute:
+
+ $ bundle
+
+Or install it yourself as:
+
+ $ gem install sauce-cucumber
+
+## Usage
+
+TODO: Write usage instructions here
+
+## Contributing
+
+1. Fork it
+2. Create your feature branch (`git checkout -b my-new-feature`)
+3. Commit your changes (`git commit -am 'Added some feature'`)
+4. Push to the branch (`git push origin my-new-feature`)
+5. Create new Pull Request
@@ -0,0 +1,2 @@
+#!/usr/bin/env rake
+require "bundler/gem_tasks"
@@ -1,6 +1,7 @@
require 'capybara'
require 'cucumber'
require 'sauce/job'
+require 'sauce/capybara'
module Sauce
module Capybara
@@ -0,0 +1,17 @@
+# -*- encoding: utf-8 -*-
+require File.expand_path(File.dirname(__FILE__) + '/../../lib/sauce/version')
+
+Gem::Specification.new do |gem|
+ gem.authors = ["R. Tyler Croy"]
+ gem.email = ["tyler@monkeypox.org"]
+ gem.description = ''
+ gem.summary = ''
+ gem.homepage = ""
+
+ gem.files = `git ls-files`.split($\)
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
+ gem.name = "sauce-cucumber"
+ gem.require_paths = ["lib"]
+ gem.version = "#{Sauce::MAJOR_VERSION}.0"
+end
@@ -0,0 +1,17 @@
+*.gem
+*.rbc
+.bundle
+.config
+.yardoc
+Gemfile.lock
+InstalledFiles
+_yardoc
+coverage
+doc/
+lib/bundler/man
+pkg
+rdoc
+spec/reports
+test/tmp
+test/version_tmp
+tmp
@@ -0,0 +1,29 @@
+# Sauce::Jasmine
+
+TODO: Write a gem description
+
+## Installation
+
+Add this line to your application's Gemfile:
+
+ gem 'sauce-jasmine'
+
+And then execute:
+
+ $ bundle
+
+Or install it yourself as:
+
+ $ gem install sauce-jasmine
+
+## Usage
+
+TODO: Write usage instructions here
+
+## Contributing
+
+1. Fork it
+2. Create your feature branch (`git checkout -b my-new-feature`)
+3. Commit your changes (`git commit -am 'Added some feature'`)
+4. Push to the branch (`git push origin my-new-feature`)
+5. Create new Pull Request
@@ -0,0 +1,2 @@
+#!/usr/bin/env rake
+require "bundler/gem_tasks"
File renamed without changes.
@@ -0,0 +1,17 @@
+# -*- encoding: utf-8 -*-
+require File.expand_path(File.dirname(__FILE__) + '/../../lib/sauce/version')
+
+Gem::Specification.new do |gem|
+ gem.authors = ["R. Tyler Croy"]
+ gem.email = ["tyler@monkeypox.org"]
+ gem.description = ''
+ gem.summary = ''
+ gem.homepage = ""
+
+ gem.files = `git ls-files`.split($\)
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
+ gem.name = "sauce-jasmine"
+ gem.require_paths = ["lib"]
+ gem.version = "#{Sauce::MAJOR_VERSION}.0"
+end
View
@@ -1,10 +1,8 @@
+require 'sauce/version'
require 'sauce/utilities'
require 'sauce/job'
require 'sauce/client'
require 'sauce/config'
require 'sauce/selenium'
require 'sauce/integrations'
require 'sauce/connect'
-
-module Sauce
-end
@@ -0,0 +1,4 @@
+
+module Sauce
+ MAJOR_VERSION = '2.1'
+end
View
@@ -1,8 +1,9 @@
# -*- encoding: utf-8 -*-
+require File.expand_path('../lib/sauce/version', __FILE__)
Gem::Specification.new do |s|
s.name = 'sauce'
- s.version = '2.0.0'
+ s.version = "#{Sauce::MAJOR_VERSION}.0"
s.authors = ["Eric Allen", "Sean Grove", "Steven Hazel", "R. Tyler Croy", "Santiago Suarez Ordoñez"]
s.homepage = 'http://github.com/saucelabs/sauce_ruby'
s.email = 'help@saucelabs.com'
@@ -14,38 +15,15 @@ Gem::Specification.new do |s|
s.default_executable = 'sauce'
s.require_paths = ["lib"]
s.test_files = Dir['test/*.rb']
- s.add_dependency('net-http-persistent')
-
- if s.respond_to? :specification_version then
- s.specification_version = 3
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
- s.add_runtime_dependency(%q<rest-client>, [">= 0"])
- s.add_runtime_dependency(%q<net-ssh>, [">= 0"])
- s.add_runtime_dependency(%q<net-ssh-gateway>, [">= 0"])
- s.add_runtime_dependency(%q<selenium-webdriver>, [">= 0.1.4"])
- s.add_runtime_dependency(%q<childprocess>, [">= 0.1.6"])
- s.add_runtime_dependency(%q<json>, [">= 1.2.0"])
- s.add_runtime_dependency(%q<cmdparse>, [">= 2.0.2"])
- s.add_runtime_dependency(%q<highline>, [">= 1.5.0"])
- else
- s.add_dependency(%q<rest-client>, [">= 0"])
- s.add_dependency(%q<net-ssh>, [">= 0"])
- s.add_dependency(%q<net-ssh-gateway>, [">= 0"])
- s.add_dependency(%q<selenium-webdriver>, [">= 0.1.2"])
- s.add_dependency(%q<childprocess>, [">= 0.1.6"])
- s.add_dependency(%q<json>, [">= 1.2.0"])
- s.add_dependency(%q<cmdparse>, [">= 2.0.2"])
- s.add_dependency(%q<highline>, [">= 1.5.0"])
- end
- else
- s.add_dependency(%q<rest-client>, [">= 0"])
- s.add_dependency(%q<net-ssh>, [">= 0"])
- s.add_dependency(%q<net-ssh-gateway>, [">= 0"])
- s.add_dependency(%q<selenium-webdriver>, [">= 0.1.2"])
- s.add_dependency(%q<childprocess>, [">= 0.1.6"])
- s.add_dependency(%q<json>, [">= 1.2.0"])
- s.add_dependency(%q<cmdparse>, [">= 2.0.2"])
- s.add_dependency(%q<highline>, [">= 1.5.0"])
- end
+ s.add_dependency('net-http-persistent')
+ s.add_dependency('capybara')
+ s.add_dependency('rest-client', [">= 0"])
+ s.add_dependency('net-ssh', [">= 0"])
+ s.add_dependency('net-ssh-gateway', [">= 0"])
+ s.add_dependency('selenium-webdriver', [">= 0.1.2"])
+ s.add_dependency('childprocess', [">= 0.1.6"])
+ s.add_dependency('json', [">= 1.2.0"])
+ s.add_dependency('cmdparse', [">= 2.0.2"])
+ s.add_dependency('highline', [">= 1.5.0"])
end
File renamed without changes.
@@ -1,6 +1,5 @@
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
require 'sauce/capybara'
-require 'sauce/capybara/cucumber'
describe Sauce::Capybara do
describe '#connect_tunnel' do
@@ -1,9 +1,8 @@
-require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
-require 'sauce/capybara'
-require 'sauce/capybara/cucumber'
+require 'spec_helper'
-# We need to pull in our local spec_helper.rb to test cucumbery things
-require File.dirname(__FILE__) + '/spec_helper'
+require 'sauce/cucumber'
+# We need to pull in the cucumber_helper to effectively test cucumbery things
+require 'cucumber_helper'
module Sauce::Capybara
describe Cucumber do
View
@@ -1,4 +1,6 @@
$:.unshift File.expand_path(File.dirname(__FILE__) + '/../lib')
+$:.unshift File.expand_path(File.dirname(__FILE__) + '/../gems/sauce-jasmine/lib')
+$:.unshift File.expand_path(File.dirname(__FILE__) + '/../gems/sauce-cucumber/lib')
require 'sauce'

0 comments on commit 6cc5a0d

Please sign in to comment.