Skip to content
Browse files

setup readme structure, add license, finish dsl

  • Loading branch information...
1 parent af0c996 commit 22f2eb29072909d1a037ef82792b962ccac90b5b @effkay committed
Showing with 89 additions and 1 deletion.
  1. +20 −0 MIT-LICENCE
  2. +26 −0 README.md
  3. +17 −1 lib/blazing/config.rb
  4. +26 −0 spec/blazing/config_spec.rb
View
20 MIT-LICENCE
@@ -0,0 +1,20 @@
+Copyright (c) 2011 Felipe Kaufmann
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
View
26 README.md
@@ -0,0 +1,26 @@
+# Blazing fast git push deploys
+
+## Overview
+
+## Installation
+
+## Usage
+
+## Development & Contribution
+
+### Improving Blazing itself
+
+### Blazing Recipes
+
+## Contribution
+
+## TODO
+
+* recipes at all
+* recipes with options
+
+## Authors
+
+## License
+
+See the `MIT-LICENSE` file
View
18 lib/blazing/config.rb
@@ -31,12 +31,28 @@ def recipes(recipes = nil)
if recipes.kind_of? Symbol
@recipes << Blazing::Recipe.init_by_name(recipes)
elsif recipes.kind_of? Array
- @recipes << recipes.map { |r| Blazing::Recipe.init_by_name(r) }
+ @recipes = recipes.map { |r| Blazing::Recipe.init_by_name(r) }
else
@recipes
end
end
+ def rake(task = nil)
+ if task
+ @rake = task
+ else
+ @rake
+ end
+ end
+
+ def rvm(rvm_string = nil)
+ if rvm_string
+ @rvm = rvm_string
+ else
+ @rvm
+ end
+ end
+
class << self
def parse(configuration_file = nil)
View
26 spec/blazing/config_spec.rb
@@ -72,14 +72,40 @@ class Blazing::Recipe::Dummy < Blazing::Recipe
@config.recipes :dummy
@config.recipes.first.should be_a Blazing::Recipe::Dummy
end
+
+ it 'accepts an array of recipes as argument' do
+ @config.recipes [:dummy, :dummy]
+ @config.recipes.size.should be 2
+ @config.recipes.each { |r| r.should be_a Blazing::Recipe::Dummy }
+ end
end
describe 'rake' do
+ it 'takes the name of the rake task as argument' do
+ @config.rake :post_deploy
+ @config.instance_variable_get('@rake').should be :post_deploy
+ end
+
+ it 'returns the name of the task if no argument given' do
+ @config.rake :post_deploy
+ @config.rake.should be :post_deploy
+ end
+
end
describe 'rvm' do
+ it 'takes an rvm string as argument' do
+ @config.rvm 'ruby-1.9.2@rails31'
+ @config.instance_variable_get('@rvm').should == 'ruby-1.9.2@rails31'
+ end
+
+ it 'returns the rvm string if no argument given' do
+ @config.rvm 'ruby-1.9.2@rails31'
+ @config.rvm.should == 'ruby-1.9.2@rails31'
+ end
+
end
end
end

0 comments on commit 22f2eb2

Please sign in to comment.
Something went wrong with that request. Please try again.