capistrano-faster-rails 1.0.4 → 1.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9be7709b36d541d72465155698e5b9d8f6df3c526f651cfd75f42062ccb6a26f
4
- data.tar.gz: b7cb9a66577b095f79a56d4819f4cd893141d0fedc67e40f56e29e979d254e21
3
+ metadata.gz: 3c27bd41538284e866aa011daddf6707c004edf5b8737620353b3026b86c1ae8
4
+ data.tar.gz: 35050bfbade0d05279e32618b1467e4c866a98076cfeef86eb0348696d84bbd1
5
5
  SHA512:
6
- metadata.gz: b90b59041cde3a4feb9b3313f0eed217a5c62cf0837e22473351c1dceefeac2f79786f52ce739bfdde828ad1345c424aef8691a8a5eb6ed1ee1910a3b03f741d
7
- data.tar.gz: 31ec4c01fcdc068fe2ba8f2cd4b8fc4ee1a4c3d672cd9c6f67c351c02e4f55195502f9c8f41ceea9539ff69a99fef88f669f10f180c589256d1a9149fbae2e7a
6
+ metadata.gz: 9390ec415afd8d142a4fb1189cd2f9fafb42e1e0cd012c5a52ba70e4dbbeab6f9f060259d14961d864fd6c28be4e058a025589b96a4c863edef76139c356bece
7
+ data.tar.gz: 90f7405708d460444233799d763935740ba13254e81040c5402e1670cf6665e8f344e481d42484c3e04d48556a5c71887a183c3f2c49c1b60d3a6ee7acce5b8f
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "capistrano-faster-rails"
7
- spec.version = "1.0.4"
7
+ spec.version = "1.0.5"
8
8
  spec.authors = ["lifuzhong"]
9
9
  spec.email = ["lifuzho@126.com"]
10
10
 
@@ -1,12 +1,3 @@
1
- asset_change = proc {
2
- asset_files = fetch(:asset_files, "vendor/assets app/assets config/initializers/assets.rb")
3
- within(repo_path) {
4
- previous_revision, current_revision = fetch(:previous_revision), fetch(:current_revision)
5
- previous_revision.to_s.empty? ||
6
- !capture("cd #{repo_path} && git diff --name-only #{previous_revision} #{current_revision} -- #{asset_files}").empty?
7
- }
8
- }
9
-
10
1
  namespace :deploy do
11
2
  namespace :symlink do
12
3
  Rake::Task["deploy:symlink:linked_files"].clear_actions
@@ -42,7 +33,13 @@ namespace :deploy do
42
33
  task :precompile do
43
34
  on(release_roles(fetch(:assets_roles))) {
44
35
  log "[deploy:assets:precompile] Checking assets changes"
45
- if asset_change.call()
36
+ asset_files = fetch(:asset_files, "vendor/assets app/assets config/initializers/assets.rb")
37
+ asset_changed = within(repo_path) {
38
+ previous_revision, current_revision = fetch(:previous_revision), fetch(:current_revision)
39
+ previous_revision.to_s.empty? ||
40
+ !capture("cd #{repo_path} && git diff --name-only #{previous_revision} #{current_revision} -- #{asset_files}").empty?
41
+ }
42
+ if asset_changed
46
43
  within(release_path) do
47
44
  with rails_env: fetch(:rails_env), rails_groups: fetch(:rails_assets_groups) do
48
45
  execute :rake, "assets:precompile"
@@ -69,7 +66,7 @@ namespace :bundler do
69
66
  !capture("cd #{repo_path} && git diff --name-only #{previous_revision} #{current_revision} -- #{bundle_files}").empty?
70
67
  }
71
68
 
72
- within release_path {
69
+ within(release_path) {
73
70
  with fetch(:bundle_env_variables) do
74
71
  options = []
75
72
  options << "--gemfile #{fetch(:bundle_gemfile)}" if fetch(:bundle_gemfile)
@@ -101,7 +98,13 @@ if yarn_install_task
101
98
  task :install do
102
99
  on roles fetch(:yarn_roles) do
103
100
  log "[yarn:install] Checking assets changes"
104
- if asset_change.call()
101
+ asset_files = fetch(:asset_files, "vendor/assets app/assets config/initializers/assets.rb")
102
+ asset_changed = within(repo_path) {
103
+ previous_revision, current_revision = fetch(:previous_revision), fetch(:current_revision)
104
+ previous_revision.to_s.empty? ||
105
+ !capture("cd #{repo_path} && git diff --name-only #{previous_revision} #{current_revision} -- #{asset_files}").empty?
106
+ }
107
+ if asset_changed
105
108
  within fetch(:yarn_target_path, release_path) do
106
109
  with fetch(:yarn_env_variables, {}) do
107
110
  execute fetch(:yarn_bin), 'install', fetch(:yarn_flags)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-faster-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - lifuzhong