magic_recipes 0.1.10 → 0.1.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/magic_recipes/assets.rb +30 -5
  2. metadata +1 -1
@@ -43,6 +43,7 @@ module MagicRecipes
43
43
  :assets_prefix variable to match.
44
44
  DESC
45
45
  task :symlink, :roles => assets_role, :except => { :no_release => true } do
46
+ # => sudo chown <username> .
46
47
  run <<-CMD
47
48
  #{sudo if use_sudo} rm -rf #{latest_release}/public/#{assets_prefix} &&
48
49
  #{sudo if use_sudo} mkdir -p #{latest_release}/public &&
@@ -62,7 +63,6 @@ module MagicRecipes
62
63
  set :asset_env, "RAILS_GROUPS=assets"
63
64
  DESC
64
65
  task :precompile, :roles => assets_role, :except => { :no_release => true } do
65
- # run "cd #{latest_release} && #{rake} RAILS_ENV=#{rails_env} #{asset_env} assets:precompile"
66
66
  if make_pulbic_folder_public
67
67
  chmod
68
68
  end
@@ -70,16 +70,27 @@ module MagicRecipes
70
70
  run <<-CMD
71
71
  #{rvm_cmd} &&
72
72
  cd #{latest_release} &&
73
- #{"#{sudo} -i -u #{user}" if use_sudo} #{rake} RAILS_ENV=#{rails_env} #{asset_env} assets:precompile
73
+ #{rake} RAILS_ENV=#{rails_env} #{asset_env} assets:precompile
74
74
  CMD
75
75
  else
76
- run "cd #{latest_release} && #{"#{sudo} -i -u #{user}" if use_sudo} #{rake} RAILS_ENV=#{rails_env} #{asset_env} assets:precompile"
76
+ run <<-CMD
77
+ cd #{latest_release} &&
78
+ #{rake} RAILS_ENV=#{rails_env} #{asset_env} assets:precompile
79
+ CMD
77
80
  end
78
81
  end
79
82
 
80
83
  desc "make the public folder public for all (777)"
81
84
  task :chmod, :roles => assets_role, :except => { :no_release => true } do
82
- run "cd #{latest_release} && #{sudo} chmod -R 777 public/ && #{sudo} chmod -R 777 tmp/"
85
+ run <<-CMD
86
+ cd #{latest_release} &&
87
+ #{sudo} chmod -R 777 public/ &&
88
+ #{sudo} chmod -R 777 tmp/
89
+ CMD
90
+ run <<-CMD
91
+ cd #{shared_path} &&
92
+ #{sudo} chmod -R 777 assets/
93
+ CMD
83
94
  end
84
95
 
85
96
  desc <<-DESC
@@ -94,7 +105,21 @@ module MagicRecipes
94
105
  set :asset_env, "RAILS_GROUPS=assets"
95
106
  DESC
96
107
  task :clean, :roles => assets_role, :except => { :no_release => true } do
97
- run "cd #{latest_release} && #{"#{sudo} -i -u #{user}" if use_sudo} #{rake} RAILS_ENV=#{rails_env} #{asset_env} assets:clean"
108
+ if make_pulbic_folder_public
109
+ chmod
110
+ end
111
+ if use_rvm
112
+ run <<-CMD
113
+ #{rvm_cmd} &&
114
+ cd #{latest_release} &&
115
+ #{rake} RAILS_ENV=#{rails_env} #{asset_env} assets:clean
116
+ CMD
117
+ else
118
+ run <<-CMD
119
+ cd #{latest_release} &&
120
+ #{rake} RAILS_ENV=#{rails_env} #{asset_env} assets:clean
121
+ CMD
122
+ end
98
123
  end
99
124
  end
100
125
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: magic_recipes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.10
4
+ version: 0.1.11
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: