capistrano-exfel 0.0.6 → 0.0.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d93c7a1c63f291d582abe4f3cafc84f415ab1607
4
- data.tar.gz: 4b05eff2f7548c9ff5e1f34d864c3368f72adb46
3
+ metadata.gz: f057b3710c0708a8e73cc930a552a4d55d213c03
4
+ data.tar.gz: 319c23cf4d843db2ee45343b9cc23ffc06635ba0
5
5
  SHA512:
6
- metadata.gz: 98d013889bbeaf37ba85a1d6bfc015eb3dcd818c5ac1252a4fe6a45db1450c30511ce1d6c5ea449075214a58aebf09d453a7c39d02e812cf7838cd0f6d76d73a
7
- data.tar.gz: 4eb5dcfb0c204617eaa8329bc5c04904e10b6677ff83f9b5ae38df460e015d718091d4f50ac53345982c1a28dfacfb038d5b1a6bf48af73d7e2adf2aea3c3370
6
+ metadata.gz: f5e7e3103fe2dba6b5bccc93baca2e3f21f302ef6afff067e560915f0fc39cfcd96e924131f65dcdf583dfa69767a19eb70adb3a03035a40d1425c4f4a345ba9
7
+ data.tar.gz: 3d758192be25dfd0f923216122bc0df70424fd936c793187e98fabcb36d944c9dc57a9e0116eb85bdac8e07d120ab8e8d199a36760e750d27e10ab480bb17009
data/README.md CHANGED
@@ -12,7 +12,7 @@ Add these lines to your application's Gemfile:
12
12
  gem 'capistrano', '~> 3.4.0'
13
13
  gem 'capistrano-rails', '~> 1.1.2'
14
14
  gem 'capistrano-rvm', '~> 0.1.2'
15
- gem 'capistrano-exfel', '~> 0.0.6'
15
+ gem 'capistrano-exfel', '~> 0.0.7'
16
16
 
17
17
  And then execute:
18
18
 
@@ -1,6 +1,6 @@
1
1
  module Capistrano
2
2
  # Capistrano::Exfel version information
3
3
  module Exfel
4
- VERSION = '0.0.6'
4
+ VERSION = '0.0.7'
5
5
  end
6
6
  end
@@ -36,13 +36,13 @@ namespace :application do
36
36
 
37
37
  invoke :deploy
38
38
  invoke 'app_home:correct_shared_permissions'
39
+ invoke 'app_home:clear_tmp_files'
39
40
  invoke 'application:restart'
40
41
  end
41
42
  end
42
43
 
43
44
  desc 'Restarts the application, including reloading server cache'
44
45
  task :restart do
45
- invoke 'app_home:clear_tmp_files'
46
46
  # invoke 'app_home:restart'
47
47
  invoke 'apache:restart'
48
48
  invoke 'app_home:reload_server_cache'
@@ -103,10 +103,7 @@ namespace :load do
103
103
  end
104
104
 
105
105
  # Build default application URI
106
- set :default_app_uri, -> do
107
- "#{fetch(:app_name)}" if get_rails_env_abbr.blank?
108
- "#{get_rails_env_abbr}_#{fetch(:app_name)}" unless get_rails_env_abbr.blank?
109
- end
106
+ set :default_app_uri, -> { get_rails_default_app_name }
110
107
 
111
108
  set :app_name_uri, -> do
112
109
  ask("Please specify the application URI (i.e. #{fetch(:default_app_uri)})", fetch(:default_app_uri))
@@ -48,8 +48,8 @@ namespace :database do
48
48
  debug 'Create and configure database.yml file'
49
49
 
50
50
  default_host = '127.0.0.1'
51
- default_database = "#{fetch(:app_name)}_#{get_rails_env_abbr}"
52
- default_username = "#{fetch(:app_name)}_#{get_rails_env_abbr}"
51
+ default_database = get_rails_default_db_name
52
+ default_username = get_rails_default_db_name
53
53
  default_password = ''
54
54
 
55
55
  set :db_orig_file_path, File.expand_path("../../recipes/config/#{fetch(:database_original_file_name)}", __FILE__)
@@ -10,6 +10,16 @@ def get_command_output(command)
10
10
  capture("#{command}").strip
11
11
  end
12
12
 
13
+ def get_rails_default_app_name
14
+ return "#{fetch(:app_name)}" if get_rails_env_abbr == 'prod'
15
+ "#{get_rails_env_abbr}_#{fetch(:app_name)}"
16
+ end
17
+
18
+ def get_rails_default_db_name
19
+ return "#{fetch(:app_name)}" if get_rails_env_abbr == 'prod'
20
+ "#{fetch(:app_name)}_#{get_rails_env_abbr}"
21
+ end
22
+
13
23
  def get_rails_env_abbr(rails_env_abbr = nil)
14
24
  return rails_env_abbr unless rails_env_abbr.nil?
15
25
 
@@ -19,7 +29,7 @@ def get_rails_env_abbr(rails_env_abbr = nil)
19
29
  when 'test'
20
30
  'test'
21
31
  else
22
- ''
32
+ 'prod'
23
33
  end
24
34
  end
25
35
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-exfel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luis Maia