inploy 1.6.6 → 1.6.7

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/Rakefile CHANGED
@@ -5,7 +5,7 @@ require 'rake/gempackagetask'
5
5
  require 'spec/rake/spectask'
6
6
 
7
7
  GEM = "inploy"
8
- GEM_VERSION = "1.6.6"
8
+ GEM_VERSION = "1.6.7"
9
9
  SUMMARY = "Rails deployment made easy"
10
10
  AUTHOR = "Diego Carrion"
11
11
  EMAIL = "dc.rec1@gmail.com"
data/lib/inploy/deploy.rb CHANGED
@@ -38,12 +38,7 @@ module Inploy
38
38
  end
39
39
 
40
40
  def remote_setup
41
- if branch.eql? "master"
42
- checkout = ""
43
- else
44
- checkout = "&& $(git branch | grep -vq #{branch}) && git checkout -f -b #{branch} origin/#{branch}"
45
- end
46
- remote_run "cd #{path} && #{@sudo}git clone --depth 1 #{repository} #{application} && cd #{application} #{checkout} && #{@sudo}rake inploy:local:setup environment=#{environment}#{skip_steps_cmd}"
41
+ remote_run "cd #{path} && #{@sudo}git clone --depth 1 #{repository} #{application} && cd #{application} #{checkout}#{bundle} && #{@sudo}rake inploy:local:setup environment=#{environment}#{skip_steps_cmd}"
47
42
  end
48
43
 
49
44
  def local_setup
@@ -77,6 +72,14 @@ module Inploy
77
72
 
78
73
  private
79
74
 
75
+ def checkout
76
+ branch.eql?("master") ? "" : "&& $(git branch | grep -vq #{branch}) && git checkout -f -b #{branch} origin/#{branch}"
77
+ end
78
+
79
+ def bundle
80
+ " && #{bundle_cmd}" if using_bundler?
81
+ end
82
+
80
83
  def after_update_code
81
84
  run "git submodule update --init"
82
85
  copy_sample_files
data/lib/inploy/dsl.rb CHANGED
@@ -33,6 +33,10 @@ module Inploy
33
33
  @sudo ? 'sudo ' : ''
34
34
  end
35
35
 
36
+ def using_bundler?
37
+ file_exists?("Gemfile")
38
+ end
39
+
36
40
  def run(command, disable_sudo = false)
37
41
  log command
38
42
 
data/lib/inploy/helper.rb CHANGED
@@ -52,8 +52,20 @@ module Inploy
52
52
  `rake -T`
53
53
  end
54
54
 
55
+ def bundle_cmd
56
+ "bundle install ~/.bundle --without development test"
57
+ end
58
+
59
+ def bundle_install
60
+ run bundle_cmd
61
+ end
62
+
55
63
  def install_gems
56
- rake "gems:install RAILS_ENV=#{environment}" unless skip_step?('install_gems')
64
+ if using_bundler?
65
+ bundle_install
66
+ else
67
+ rake "gems:install RAILS_ENV=#{environment}" unless skip_step?('install_gems')
68
+ end
57
69
  end
58
70
 
59
71
  def update_crontab
@@ -1,23 +1,8 @@
1
1
  module Inploy
2
2
  module Templates
3
3
  module Rails3
4
- def remote_setup
5
- if branch.eql? "master"
6
- checkout = ""
7
- else
8
- checkout = "&& $(git branch | grep -vq #{branch}) && git checkout -f -b #{branch} origin/#{branch}"
9
- end
10
- remote_run "cd #{path} && #{@sudo}git clone --depth 1 #{repository} #{application} && cd #{application} #{checkout} && bundle install ~/.bundle && #{@sudo}rake inploy:local:setup environment=#{environment}"
11
- end
12
-
13
- def install_gems
14
- run bundle
15
- end
16
-
17
- private
18
-
19
- def bundle
20
- "bundle install ~/.bundle"
4
+ def using_bundler?
5
+ true
21
6
  end
22
7
  end
23
8
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 6
8
- - 6
9
- version: 1.6.6
8
+ - 7
9
+ version: 1.6.7
10
10
  platform: ruby
11
11
  authors:
12
12
  - Diego Carrion