vlad-rainbows 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -33,14 +33,17 @@ The tasks invoked can be overriden by updating deploy.rb with:
33
33
  set :app_start_task, "task_name"
34
34
  set :app_stop_task, "task_name"
35
35
 
36
- The plugin also assumes you have a way execute these rake tasks remotely.
36
+ The plugin provides a run_rake method for executing rake tasks remotely. If you wish to override the methods
37
+ implementation, simply provide a block to the :run_rake_proc variable.
37
38
 
38
- def run_rake task
39
+ set :rake_cmd, "bundle exec rake"
40
+ set :run_rake_proc, Proc.new {
39
41
  run [
42
+ "source /usr/local/lib/rvm",
40
43
  "cd #{current_path}",
41
44
  "#{rake_cmd} RACK_ENV=#{rack_env} #{task}",
42
- ].join " && "
43
- end
45
+ ]
46
+ }
44
47
 
45
48
  ## Credits
46
49
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.2
1
+ 0.1.3
data/lib/vlad/rainbows.rb CHANGED
@@ -1,15 +1,16 @@
1
1
  require "vlad"
2
+ require "vlad/utils"
2
3
 
3
4
  class Vlad::Rainbows
4
5
  namespace :vlad do
5
6
  desc "Start the daemon."
6
7
  remote_task :start_app, :roles => :app do
7
- run_rake Rake::RemoteTask.fetch :app_start_task, "app:start"
8
+ Vlad::Utils.run_rake Rake::RemoteTask.fetch :app_start_task, "app:start"
8
9
  end
9
10
 
10
11
  desc "Stop the daemon."
11
12
  remote_task :stop_app, :roles => :app do
12
- run_rake Rake::RemoteTask.fetch :app_stop_task, "app:stop"
13
+ Vlad::Utils.run_rake Rake::RemoteTask.fetch :app_stop_task, "app:stop"
13
14
  end
14
15
  end
15
16
  end
data/lib/vlad/utils.rb ADDED
@@ -0,0 +1,20 @@
1
+ class Vlad::Utils
2
+
3
+ ##
4
+ # Invokes the given rake task remotely; setting up the proper environment.
5
+ # If a block is provided, it will be excuted instead.
6
+ #
7
+ # +task+ is the fully qualified task name.
8
+ # +rake_cmd+ is the rake command to execute remotely.
9
+
10
+ def self.run_rake task
11
+ if defined? run_rake_proc
12
+ run_rake_proc.call
13
+ else
14
+ run [
15
+ "cd #{current_path}",
16
+ "#{rake_cmd} RACK_ENV=#{rack_env} #{task}",
17
+ ].join " && "
18
+ end
19
+ end
20
+ end
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{vlad-rainbows}
8
- s.version = "0.1.2"
8
+ s.version = "0.1.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["retr0h"]
@@ -23,6 +23,7 @@ Gem::Specification.new do |s|
23
23
  "Rakefile",
24
24
  "VERSION",
25
25
  "lib/vlad/rainbows.rb",
26
+ "lib/vlad/utils.rb",
26
27
  "vlad-rainbows.gemspec"
27
28
  ]
28
29
  s.homepage = %q{http://github.com/retr0h/vlad-rainbows}
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vlad-rainbows
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
4
+ hash: 29
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 2
10
- version: 0.1.2
9
+ - 3
10
+ version: 0.1.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - retr0h
@@ -36,6 +36,7 @@ files:
36
36
  - Rakefile
37
37
  - VERSION
38
38
  - lib/vlad/rainbows.rb
39
+ - lib/vlad/utils.rb
39
40
  - vlad-rainbows.gemspec
40
41
  has_rdoc: true
41
42
  homepage: http://github.com/retr0h/vlad-rainbows