lib/softwear/lib.rb in softwear-lib-0.0.3 vs lib/softwear/lib.rb in softwear-lib-0.0.4
- old
+ new
@@ -3,12 +3,10 @@
module Softwear
module Lib
def self.common_gems(gemfile)
gemfile.instance_eval do
- gem 'softwear-lib'
-
gem 'rails', '4.2.1'
gem 'mysql2'
gem 'sass-rails'
gem 'uglifier', '>= 1.3.0'
@@ -60,20 +58,23 @@
end
end
def self.capistrano(context)
context.instance_eval do
- gems_path = fetch(:gems_path) || "#{fetch(:deploy_to)}/shared/bundle/rbx/2.1/gems"
+ gem_home = fetch(:gems_path) || "#{fetch(:deploy_to)}/shared/bundle/rbx/2.1/gems"
namespace :deploy do
desc 'Assure softwear-lib is up to date before deploying'
- task :softwear_lib do
- execute "GEM_HOME=#{gems_path} gem install softwear-lib"
- execute "GEM_HOME=#{gems_path} gem update softwear-lib"
+ task :update_softwear_lib do
+ on roles(:app), in: :sequence do
+ execute "GEM_PATH=#{gem_home} GEM_HOME=#{gem_home} gem install softwear-lib"
+ execute "GEM_PATH=#{gem_home} GEM_HOME=#{gem_home} gem update softwear-lib"
+ # execute "export GEM_HOME=#{gem_home} && echo gem home IS: $GEM_HOME"
+ end
end
- before :publishing, :restart
+ before :updating, :update_softwear_lib
end
end
end