Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
esambo committed Nov 25, 2011
2 parents 90a925b + 98089d8 commit 907fe05
Show file tree
Hide file tree
Showing 10 changed files with 85 additions and 28 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
coverage
rdoc
pkg
rerun.txt
1 change: 1 addition & 0 deletions .rspec
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
--color
--format documentation
32 changes: 32 additions & 0 deletions .rvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/usr/bin/env bash
# Based on: http://rvm.beginrescueend.com/workflow/rvmrc/

ruby_string="ruby-1.9.3-p0"
gemset_name="practice_game_of_life"

if rvm list strings | grep -q "${ruby_string}" ; then

# Load or create the specified environment
if [[ -d "${rvm_path:-$HOME/.rvm}/environments" \
&& -s "${rvm_path:-$HOME/.rvm}/environments/${ruby_string}@${gemset_name}" ]] ; then
\. "${rvm_path:-$HOME/.rvm}/environments/${ruby_string}@${gemset_name}"
else
rvm --create "${ruby_string}@${gemset_name}"
fi

(
# Ensure that Bundler is installed, install it if it is not.
if ! command -v bundle ; then
gem install bundler
fi

# Bundle while redcing excess noise.
bundle | grep -v 'Using' | grep -v 'complete' | sed '/^$/d'
)&

else

# Notify the user to install the desired interpreter before proceeding.
echo "${ruby_string} was not found, please run 'rvm install ${ruby_string}' and then cd back into the project directory."

fi
13 changes: 6 additions & 7 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
source 'http://rubygems.org'
gem 'cucumber'
gem 'rspec'
source :rubygems
gem 'rake'
gem 'jeweler'
gem 'rdoc'
gem 'rcov'

gem 'rspec'
gem 'cucumber'
gem 'guard-rspec'
# gem 'rb-fsevent'
# gem 'growl_notify'

# gem 'watchr'
gem 'guard-cucumber'
gem 'growl_notify'
44 changes: 27 additions & 17 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,46 +2,56 @@ GEM
remote: http://rubygems.org/
specs:
builder (3.0.0)
cucumber (1.1.3)
cucumber (1.0.0)
builder (>= 2.1.2)
diff-lcs (>= 1.1.2)
gherkin (~> 2.6.7)
gherkin (~> 2.4.1)
json (>= 1.4.6)
term-ansicolor (>= 1.0.6)
diff-lcs (1.1.3)
gherkin (2.6.7)
term-ansicolor (>= 1.0.5)
diff-lcs (1.1.2)
gherkin (2.4.1)
json (>= 1.4.6)
git (1.2.5)
guard (0.8.8)
growl_notify (0.0.1)
rb-appscript
guard (0.6.3)
thor (~> 0.14.6)
guard-rspec (0.5.5)
guard (>= 0.8.4)
guard-cucumber (0.6.2)
cucumber (>= 0.10)
guard (>= 0.4.0)
guard-rspec (0.4.4)
guard (>= 0.4.0)
jeweler (1.6.4)
bundler (~> 1.0)
git (>= 1.2.5)
rake
json (1.6.1)
json (1.5.3)
rake (0.9.2.2)
rb-appscript (0.6.1)
rcov (0.9.11)
rdoc (3.11)
json (~> 1.4)
rspec (2.7.0)
rspec-core (~> 2.7.0)
rspec-expectations (~> 2.7.0)
rspec-mocks (~> 2.7.0)
rspec-core (2.7.1)
rspec-expectations (2.7.0)
rspec (2.6.0)
rspec-core (~> 2.6.0)
rspec-expectations (~> 2.6.0)
rspec-mocks (~> 2.6.0)
rspec-core (2.6.4)
rspec-expectations (2.6.0)
diff-lcs (~> 1.1.2)
rspec-mocks (2.7.0)
term-ansicolor (1.0.7)
rspec-mocks (2.6.0)
term-ansicolor (1.0.5)
thor (0.14.6)

PLATFORMS
ruby

DEPENDENCIES
cucumber
growl_notify
guard-cucumber
guard-rspec
jeweler
rake
rcov
rdoc
rspec
11 changes: 11 additions & 0 deletions Guardfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
guard 'rspec', version: 2 do
watch(%r{^spec/.+_spec\.rb$})
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
watch('spec/spec_helper.rb') { "spec/" }
end

guard 'cucumber', cli: '--profile guard' do
watch(%r{^features/.+\.feature$})
watch(%r{^features/support/.+$}) { 'features' }
watch(%r{^features/step_definitions/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'features' }
end
6 changes: 4 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ rescue LoadError
puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
end

require 'rspec'
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec) do |spec|
spec.rspec_opts = ['--format doc', '--color']
Expand All @@ -32,7 +33,8 @@ end

begin
require 'cucumber/rake/task'
Cucumber::Rake::Task.new(:features)
Cucumber::Rake::Task.new(:features) do |f|
f.cucumber_opts = "features --format pretty"

# task :features => :check_dependencies
rescue LoadError
Expand All @@ -41,7 +43,7 @@ rescue LoadError
end
end

task :default => :spec
task :default => [:spec, :cucumber]

require 'rdoc/task'
RDoc::Task.new do |rdoc|
Expand Down
2 changes: 2 additions & 0 deletions cucumber.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
wip: --tags @wip:3 --wip features
guard: --tags @wip --format progress --wip features
1 change: 0 additions & 1 deletion features/multiple_generations.feature
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,3 @@ Feature: Evolving a grid over multiple generations
| . | x | x | x | . |
| . | . | . | . | . |
| . | . | . | . | . |

2 changes: 1 addition & 1 deletion spec/game_of_life_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
require 'spec_helper'

describe "GameOfLife" do
it "fails" do
Expand Down

0 comments on commit 907fe05

Please sign in to comment.