blazing 0.2.14 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  ## master
2
2
 
3
+ ## 0.3.0 - January 23, 2013
4
+
5
+ * target name is passed to recipe at runtime
6
+ * Add alias for rvm_scripts (env_scripts) which enables the use of rbenv et al.
7
+
3
8
  ## 0.2.14 - October 23, 2012
4
9
 
5
10
  * readme tweaks
data/README.md CHANGED
@@ -19,7 +19,7 @@ Out of the box, blazing can do the following:
19
19
 
20
20
  * set up a repository you can push to for deployment
21
21
  * set up a git post-receive hook, configurable by a simple DSL
22
- * works with rvm
22
+ * works with rvm/rbenv/chruby(and probably others)
23
23
  * uses bundler for dependency management
24
24
  * allows you to run custom rake tasks after deployment
25
25
  * is extendable by blazing recipes
@@ -118,6 +118,16 @@ rvm 'ruby-1.9.3@some-gemset'
118
118
  rvm_scripts '/opt/rvm/scripts/rvm'
119
119
 
120
120
 
121
+ # Sample rbenv/chruby/other setup:
122
+ #
123
+ # env_scripts <path_to_version_manager_script>
124
+ #
125
+ # If you need to source a file for your non-rvm version manager to
126
+ # you can do that with env_scripts. You should also remove the
127
+ # rvm/rvm_scripts options above.
128
+
129
+ env_scripts '/etc/profile.d/rbenv.sh'
130
+
121
131
  # Sample recipe setup:
122
132
  #
123
133
  # recipe <recipe_name>, [options]
data/blazing.gemspec CHANGED
@@ -7,7 +7,7 @@ Gem::Specification.new do |s|
7
7
  #
8
8
  # TODO: Remove Config.repository in 0.3
9
9
  #
10
- s.version = '0.2.14'
10
+ s.version = '0.3.0'
11
11
 
12
12
  s.authors = ["Felipe Kaufmann"]
13
13
  s.email = ["felipekaufmann@gmail.com"]
@@ -43,7 +43,7 @@ module Blazing
43
43
  end
44
44
 
45
45
  def recipes
46
- @config.recipes.each { |recipe| recipe.run }
46
+ @config.recipes.each { |recipe| recipe.run({:target_name => @target_name}) }
47
47
  end
48
48
 
49
49
  def list
@@ -9,7 +9,8 @@ class Blazing::Config
9
9
 
10
10
  attr_reader :file
11
11
  attr_accessor :targets, :recipes
12
- dsl_setter :rvm, :rvm_scripts
12
+ dsl_setter :rvm, :env_scripts
13
+ alias :rvm_scripts :env_scripts
13
14
 
14
15
  class << self
15
16
  def parse(configuration_file = nil)
@@ -36,6 +36,15 @@ rvm 'ruby-1.9.3@some-gemset'
36
36
 
37
37
  rvm_scripts '/opt/rvm/scripts/rvm'
38
38
 
39
+ # Sample rbenv/chruby/other setup:
40
+ #
41
+ # env_scripts <path_to_version_manager_script>
42
+ #
43
+ # If you need to source a file for your non-rvm version manager to
44
+ # you can do that with env_scripts. You should also remove the
45
+ # rvm/rvm_scripts options above.
46
+
47
+ env_scripts '/etc/profile.d/rbenv.sh'
39
48
 
40
49
  # Sample recipe setup:
41
50
  #
@@ -1,5 +1,6 @@
1
1
  <%= load_template 'hook/setup' %>
2
2
  <%= load_template 'hook/git-reset' %>
3
+ <%= load_template 'hook/env-scripts' %>
3
4
  <%= load_template 'hook/rvm' %>
4
5
  <%= load_template 'hook/bundler' %>
5
6
  <%= load_template 'hook/recipes' %>
@@ -0,0 +1,6 @@
1
+ <% if @config.env_scripts %>
2
+
3
+ source <%= @config.env_scripts %>
4
+ echo "------> [blazing] Loading environment scripts from custom location"
5
+
6
+ <% end %>
@@ -1,17 +1,9 @@
1
1
  <% if @config.rvm %>
2
2
 
3
- #
4
- # Custom RVM script location?
5
- #
6
- <% if @config.rvm_scripts %>
7
-
8
- source <%= @config.rvm_scripts %>
9
- echo "------> [blazing] Loading rvmscripts from custom location"
10
-
11
3
  #
12
4
  # Normal RVM installation
13
5
  #
14
- <% else %>
6
+ <% unless @config.rvm_scripts %>
15
7
  # Load RVM into a shell session *as a function*
16
8
  if [[ -s "$HOME/.rvm/scripts/rvm" ]] ; then
17
9
 
@@ -126,6 +126,11 @@ module Blazing
126
126
  recipes.each { |r| r.should_receive(:run) }
127
127
  commands.run(:recipes)
128
128
  end
129
+
130
+ it 'passes in target_name' do
131
+ recipes.each { |r| r.should_receive(:run).with({:target_name => :testing}) }
132
+ commands.run(:recipes, :target_name => :testing)
133
+ end
129
134
  end
130
135
 
131
136
  describe '#list' do
@@ -116,7 +116,7 @@ describe Blazing::Config do
116
116
 
117
117
  it 'takes an string as argument' do
118
118
  @config.rvm_scripts '/opt/rvm/scripts'
119
- @config.instance_variable_get('@rvm_scripts').should == '/opt/rvm/scripts'
119
+ @config.instance_variable_get('@env_scripts').should == '/opt/rvm/scripts'
120
120
  end
121
121
 
122
122
  it 'returns the string if no argument given' do
@@ -5,7 +5,7 @@ describe '$ blazing recipes' do
5
5
  before :each do
6
6
  setup_sandbox
7
7
  class Blazing::Recipe::Dummy < Blazing::Recipe
8
- def run
8
+ def run(target_options={})
9
9
  puts 'dummy recipe was run'
10
10
  end
11
11
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blazing
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.14
4
+ version: 0.3.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-10-23 00:00:00.000000000 Z
12
+ date: 2013-01-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rdoc
@@ -269,6 +269,7 @@ files:
269
269
  - lib/blazing/templates/config.erb
270
270
  - lib/blazing/templates/hook/base.erb
271
271
  - lib/blazing/templates/hook/bundler.erb
272
+ - lib/blazing/templates/hook/env-scripts.erb
272
273
  - lib/blazing/templates/hook/git-reset.erb
273
274
  - lib/blazing/templates/hook/rake.erb
274
275
  - lib/blazing/templates/hook/recipes.erb