blazing 0.0.12 → 0.0.13

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- blazing (0.0.12)
4
+ blazing (0.0.13)
5
5
  activesupport (>= 3.0.5)
6
6
  grit
7
7
  i18n
@@ -61,13 +61,6 @@ module Blazing
61
61
  target = config.find_target(target_name)
62
62
  Blazing::Remote.new(target.name).post_receive
63
63
  end
64
-
65
- desc 'rvm', 'used by post_receive hook to decide if rvm env needs to be switched'
66
- def rvm(target_name = nil)
67
- target = config.find_target(target_name)
68
- log :info, Blazing::Remote.new(target.name).use_rvm?
69
- report
70
- end
71
64
  end
72
65
  end
73
66
  end
@@ -6,7 +6,7 @@ module Blazing
6
6
 
7
7
  include Thor::Actions
8
8
 
9
- argument :target
9
+ argument :rvm_string
10
10
 
11
11
  desc 'generate', 'generate post-receive hook from template'
12
12
  def generate
@@ -1,12 +1,25 @@
1
1
  #!/bin/bash
2
2
 
3
- cd ..
4
- unset GIT_DIR
3
+ <%- unless rvm_string == 'none' %>
4
+ # Load RVM into a shell session *as a function*
5
+ if [[ -s "$HOME/.rvm/scripts/rvm" ]] ; then
6
+
7
+ # First try to load from a user install
8
+ source "$HOME/.rvm/scripts/rvm"
9
+ <%= "rvm use #{rvm_string}" %>
10
+
11
+ elif [[ -s "/usr/local/rvm/scripts/rvm" ]] ; then
5
12
 
6
- rvm=$(bundle exec blazing rvm)
13
+ # Then try to load from a root install
14
+ source "/usr/local/rvm/scripts/rvm"
15
+ <%= "rvm use #{rvm_string}" %>
7
16
 
8
- if [ $rvm != 'false' ]; then
9
- rvm use $rvm
10
- fi
17
+ else
18
+ printf "ERROR: RVM was enabled in config but no RVM installation was not found.\n"
19
+ fi
20
+ <%- end -%>
21
+
22
+ cd ..
23
+ unset GIT_DIR
11
24
 
12
25
  bundle exec blazing post_receive
@@ -40,7 +40,7 @@ module Blazing
40
40
  if @rvm_recipe
41
41
  @rvm_recipe.options[:rvm_string]
42
42
  else
43
- false
43
+ 'none'
44
44
  end
45
45
  end
46
46
 
@@ -82,7 +82,7 @@ module Blazing
82
82
  end
83
83
 
84
84
  def setup_post_receive_hook
85
- @hook.new([@name]).generate
85
+ @hook.new([Blazing::Remote.new(@name).use_rvm?]).generate
86
86
  @runner.run "scp /tmp/post-receive #{@user}@#{@host}:#{@path}/.git/hooks/post-receive"
87
87
  @runner.run "ssh #{@user}@#{@host} 'chmod +x #{@path}/.git/hooks/post-receive'"
88
88
  end
@@ -1,3 +1,3 @@
1
1
  module Blazing
2
- VERSION = "0.0.12"
2
+ VERSION = "0.0.13"
3
3
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: blazing
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.12
5
+ version: 0.0.13
6
6
  platform: ruby
7
7
  authors:
8
8
  - Felipe Kaufmann
@@ -123,7 +123,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
123
123
  requirements:
124
124
  - - ">="
125
125
  - !ruby/object:Gem::Version
126
- hash: 777711064405027808
126
+ hash: -3305365196802226824
127
127
  segments:
128
128
  - 0
129
129
  version: "0"
@@ -132,7 +132,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
132
132
  requirements:
133
133
  - - ">="
134
134
  - !ruby/object:Gem::Version
135
- hash: 777711064405027808
135
+ hash: -3305365196802226824
136
136
  segments:
137
137
  - 0
138
138
  version: "0"