Skip to content
This repository has been archived by the owner on Jun 8, 2019. It is now read-only.

Commit

Permalink
Tasks get loaded
Browse files Browse the repository at this point in the history
  • Loading branch information
gabebw committed Jul 23, 2011
1 parent ac7eef2 commit 49842d3
Show file tree
Hide file tree
Showing 9 changed files with 72 additions and 3 deletions.
24 changes: 24 additions & 0 deletions features/loading_tasks.feature
@@ -0,0 +1,24 @@
Feature: Loading tasks
In order to use Kumade
As a user
I want to load Rake tasks

Scenario: Load Rake tasks
Given a directory named "taskloader"
When I cd to "taskloader"
And I write to "Gemfile" with:
"""
source "http://rubygems.org"
gem "rake", "0.8.7"
gem "kumade"
"""
And I add "kumade" from this project as a dependency
And I write to "Rakefile" with:
"""
require 'kumade'
Kumade.load_tasks
"""
And I run `rake -T`
Then the output should contain "deploy"
And the output should contain "deploy:staging"
And the output should contain "deploy:production"
4 changes: 4 additions & 0 deletions features/step_definitions/dependency_steps.rb
@@ -0,0 +1,4 @@
When /^I add "([^"]*)" from this project as a dependency$/ do |gem_name|
append_to_file('Gemfile', %{\ngem "#{gem_name}", :path => "#{PROJECT_ROOT}"})
end

10 changes: 10 additions & 0 deletions features/step_definitions/git_steps.rb
@@ -0,0 +1,10 @@
When /^I initialize a git repo$/ do
When "I successfully run `git init`"
end

When /^I commit everything in the current directory to git$/ do
steps %{
When I successfully run `git add .`
And I successfully run `git commit -m blerg`
}
end
6 changes: 6 additions & 0 deletions features/support/env.rb
@@ -0,0 +1,6 @@
require 'aruba/cucumber'
# require 'rspec/mocks'
#
# RSpec::Mocks::setup(Object)

PROJECT_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..', '..')).freeze
1 change: 1 addition & 0 deletions kumade.gemspec
Expand Up @@ -20,6 +20,7 @@ Gem::Specification.new do |s|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
s.require_paths = ["lib"]

s.add_development_dependency('rake', '~> 0.8.7')
s.add_development_dependency('rspec', '~> 2.6.0')
s.add_development_dependency('cucumber', '~> 1.0.2')
s.add_development_dependency('aruba', '~> 0.4.3')
Expand Down
8 changes: 6 additions & 2 deletions lib/kumade.rb
@@ -1,3 +1,7 @@
module Kumade
# Your code goes here...
require 'kumade/deployer'

class Kumade
def self.load_tasks
Deployer.new.load_tasks
end
end
7 changes: 7 additions & 0 deletions lib/kumade/deployer.rb
@@ -0,0 +1,7 @@
class Kumade
class Deployer
def load_tasks
load 'kumade/tasks/deploy.rake'
end
end
end
13 changes: 13 additions & 0 deletions lib/kumade/tasks/deploy.rake
@@ -0,0 +1,13 @@
desc "Alias for deploy:staging"
task :deploy do
end

namespace :deploy do
desc "Deploy to Heroku staging"
task :staging do
end

desc "Deploy to Heroku production"
task :production do
end
end
2 changes: 1 addition & 1 deletion lib/kumade/version.rb
@@ -1,3 +1,3 @@
module Kumade
class Kumade
VERSION = "0.0.1"
end

0 comments on commit 49842d3

Please sign in to comment.