softwear-lib 1.5.1 → 1.5.2

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
  SHA1:
3
- metadata.gz: aee29f7263adae53ab78fc85bbf5be053ab9e595
4
- data.tar.gz: fb4122fcdf16d493d6458ccd6244b0389abed414
3
+ metadata.gz: 56a733c32d114c4aefd83328ba1264b7695f8822
4
+ data.tar.gz: 009929f9221bb986b7b8c6d0f06cf8a41f2d9828
5
5
  SHA512:
6
- metadata.gz: 1d9e0af480f85c41f40b64c63e26d1c6de7bc8a061117673373fe3889e7c606be2e49ab664a3f53296141be71c0a3a2a2bbdb470113a9008546d8f7ce6d4d975
7
- data.tar.gz: 1eaf5225a3240a1e6d0b7953ce33ebab100cb836bf9388dcafc899ba84581a4feaf505cc87ca26696052f54fc443d668320fc12870e5a8e1a22c95a4c4149b0e
6
+ metadata.gz: 7519e0b29822609607a7f631eb993eda4ce0d98991080527b449de569a8d3506d5b8697aeaf1f45d577ebf6fd040c691ead7032160f507b9c04270444be3bd0a
7
+ data.tar.gz: ac135980397e3b033bb4d2d87d63eee03e5be3cf1014d71acda1e547fc8b910120404ac13a3cff55a455aae4f739532d08ecb0753cfaea50c4e2fde299c6cbd7
data/lib/softwear/lib.rb CHANGED
@@ -66,98 +66,6 @@ group :test do
66
66
  gem 'shoulda-matchers'
67
67
  end
68
68
  )
69
-
70
- def self.capistrano(context)
71
- context.instance_eval do
72
- Rake::Task["deploy:compile_assets"].clear
73
-
74
- ruby = fetch(:rvm_ruby_string) || fetch(:rvm_ruby_version)
75
-
76
- namespace :deploy do
77
-
78
- desc 'Assure softwear-lib is up to date before deploying'
79
- task :update_softwear_lib do
80
- on roles(:app), in: :sequence do
81
- execute "~/.rvm/bin/rvm #{ruby} do gem install --no-ri --no-rdoc softwear-lib"
82
- end
83
- end
84
-
85
- desc 'Signal the running rails app to restart'
86
- task :restart do
87
- on roles([:web, :app]), in: :sequence, wait: 5 do
88
- execute :mkdir, '-p', "#{release_path}/tmp"
89
- execute :touch, release_path.join('tmp/restart.txt')
90
- end
91
- end
92
-
93
- after :publishing, :restart_sidekiq_manager do
94
- on roles(:sidekiq) do
95
- execute 'sudo restart sidekiq-manager'
96
- end
97
- end
98
-
99
- # This is more problematic than helpful
100
- =begin
101
- if !$LOAD_PATH.grep(/sunspot_solr/).empty? || fetch(:no_reindex)
102
- before :publishing, :reindex_solr do
103
- on roles(:db) do
104
- with rails_env: fetch(:rails_env) || fetch(:stage) do
105
- within(release_path) do
106
- execute :rake, 'sunspot:solr:reindex'
107
- end
108
- end
109
- end
110
- end
111
- end
112
- =end
113
-
114
- # This is no longer necessary
115
- # before :updating, :update_softwear_lib
116
- after :publishing, :restart
117
-
118
- desc 'Compile assets'
119
- task :compile_assets => [:set_rails_env] do
120
- invoke 'deploy:assets:precompile_local'
121
- invoke 'deploy:assets:backup_manifest'
122
- end
123
-
124
- namespace :assets do
125
-
126
- desc "Precompile assets locally and then rsync to web servers"
127
- task :precompile_local do
128
- # compile assets locally
129
- run_locally do
130
- execute "RAILS_ENV=#{fetch(:stage)} bundle exec rake assets:precompile"
131
- end
132
-
133
- # rsync to each server
134
- assets_dir = "public/#{fetch(:assets_prefix) || 'assets'}"
135
- local_dir = "./#{assets_dir}/"
136
- on roles( fetch(:assets_roles, [:web]) ) do
137
- # this needs to be done outside run_locally in order for host to exist
138
- remote_dir = "#{host.user}@#{host.hostname}:#{release_path}/#{assets_dir}"
139
-
140
- execute "mkdir -p #{release_path}/#{assets_dir}"
141
- run_locally { execute "rsync -av --delete #{local_dir} #{remote_dir}" }
142
-
143
- if fetch(:asset_sync)
144
- with rails_env: fetch(:rails_env) || fetch(:stage) do
145
- within(release_path) do
146
- with_rvm(fetch(:task_ruby_version)) { execute :rake, 'assets:sync' }
147
- end
148
- end
149
- end
150
- end
151
-
152
- # clean up
153
- run_locally { execute "rm -rf #{local_dir}" }
154
- end
155
- end
156
-
157
- end
158
- end
159
- end
160
-
161
69
  def self.fix_sort_argument_error_on_rubinius
162
70
  # Rubinius calls Enumerator#sort! within Enumerator#sort_by,
163
71
  # # and Mail::PartsList calls sort_by within sort!... See the
@@ -0,0 +1,94 @@
1
+ module Softwear
2
+ module Lib
3
+ def self.capistrano(context)
4
+ context.instance_eval do
5
+ Rake::Task["deploy:compile_assets"].clear
6
+
7
+ ruby = fetch(:rvm_ruby_string) || fetch(:rvm_ruby_version)
8
+
9
+ namespace :deploy do
10
+
11
+ desc 'Assure softwear-lib is up to date before deploying'
12
+ task :update_softwear_lib do
13
+ on roles(:app), in: :sequence do
14
+ execute "~/.rvm/bin/rvm #{ruby} do gem install --no-ri --no-rdoc softwear-lib"
15
+ end
16
+ end
17
+
18
+ desc 'Signal the running rails app to restart'
19
+ task :restart do
20
+ on roles([:web, :app]), in: :sequence, wait: 5 do
21
+ execute :mkdir, '-p', "#{release_path}/tmp"
22
+ execute :touch, release_path.join('tmp/restart.txt')
23
+ end
24
+ end
25
+
26
+ after :publishing, :restart_sidekiq_manager do
27
+ on roles(:sidekiq) do
28
+ execute 'sudo restart sidekiq-manager'
29
+ end
30
+ end
31
+
32
+ # This is more problematic than helpful
33
+ =begin
34
+ if !$LOAD_PATH.grep(/sunspot_solr/).empty? || fetch(:no_reindex)
35
+ before :publishing, :reindex_solr do
36
+ on roles(:db) do
37
+ with rails_env: fetch(:rails_env) || fetch(:stage) do
38
+ within(release_path) do
39
+ execute :rake, 'sunspot:solr:reindex'
40
+ end
41
+ end
42
+ end
43
+ end
44
+ end
45
+ =end
46
+
47
+ # This is no longer necessary
48
+ # before :updating, :update_softwear_lib
49
+ after :publishing, :restart
50
+
51
+ desc 'Compile assets'
52
+ task :compile_assets => [:set_rails_env] do
53
+ invoke 'deploy:assets:precompile_local'
54
+ invoke 'deploy:assets:backup_manifest'
55
+ end
56
+
57
+ namespace :assets do
58
+
59
+ desc "Precompile assets locally and then rsync to web servers"
60
+ task :precompile_local do
61
+ # compile assets locally
62
+ run_locally do
63
+ execute "RAILS_ENV=#{fetch(:stage)} bundle exec rake assets:precompile"
64
+ end
65
+
66
+ # rsync to each server
67
+ assets_dir = "public/#{fetch(:assets_prefix) || 'assets'}"
68
+ local_dir = "./#{assets_dir}/"
69
+ on roles( fetch(:assets_roles, [:web]) ) do
70
+ # this needs to be done outside run_locally in order for host to exist
71
+ remote_dir = "#{host.user}@#{host.hostname}:#{release_path}/#{assets_dir}"
72
+
73
+ execute "mkdir -p #{release_path}/#{assets_dir}"
74
+ run_locally { execute "rsync -av --delete #{local_dir} #{remote_dir}" }
75
+
76
+ if fetch(:asset_sync)
77
+ with rails_env: fetch(:rails_env) || fetch(:stage) do
78
+ within(release_path) do
79
+ with_rvm(fetch(:task_ruby_version)) { execute :rake, 'assets:sync' }
80
+ end
81
+ end
82
+ end
83
+ end
84
+
85
+ # clean up
86
+ run_locally { execute "rm -rf #{local_dir}" }
87
+ end
88
+ end
89
+
90
+ end
91
+ end
92
+ end
93
+ end
94
+ end
@@ -1,5 +1,5 @@
1
1
  module Softwear
2
2
  module Lib
3
- VERSION = "1.5.1"
3
+ VERSION = "1.5.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: softwear-lib
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.1
4
+ version: 1.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nigel Baillie
@@ -91,6 +91,7 @@ files:
91
91
  - lib/softwear/lib.rb
92
92
  - lib/softwear/lib/api_controller.rb
93
93
  - lib/softwear/lib/authentication.rb
94
+ - lib/softwear/lib/capistrano.rb
94
95
  - lib/softwear/lib/controller_authentication.rb
95
96
  - lib/softwear/lib/spec.rb
96
97
  - lib/softwear/lib/version.rb