capistrano-contao 0.0.5 → 0.0.6

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.
@@ -13,7 +13,7 @@ Gem::Specification.new do |gem|
13
13
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
14
14
  gem.name = 'capistrano-contao'
15
15
  gem.require_paths = ['lib']
16
- gem.version = '0.0.5'
16
+ gem.version = '0.0.6'
17
17
 
18
18
  # Runtime dependencies
19
19
  gem.add_dependency 'rake'
@@ -45,32 +45,25 @@ Capistrano::Configuration.instance(:must_exist).load do
45
45
  db_credentials = fetch :db_credentials
46
46
 
47
47
  localconfig = File.read('config/examples/localconfig.php.erb')
48
-
49
- config = TechnoGate::Contao::Application.config.contao_global_config
50
-
51
- if !config || config.install_password.blank? || config.encryption_key.blank?
52
- message = <<-EOS
53
- You did not set the install password, and the encryption key in your
54
- #{ENV['HOME']}/.contao/config.yml, I cannot generate a localconfig
55
- since the required configuration keys are missing.
56
- EOS
57
- message.gsub!(/ [ ]+/, ' ').gsub!(/\n/, '').gsub!(/^ /, '')
58
- logger.important message if logger
59
- abort 'Required configurations are not set'
60
- else
61
- config = config.clone
62
- config.application_name = TechnoGate::Contao::Application.name
63
- config.db_server_app = fetch :db_server_app
64
- config.db_database = fetch :db_database_name
65
-
66
- [:hostname, :port, :username, :password].each do |item|
67
- if db_credentials[item].present?
68
- config.send "db_#{item}=", db_credentials[item]
69
- end
70
- end
71
-
72
- write ERB.new(localconfig).result(binding), localconfig_php_config_path
48
+ load 'config/initializers/contao.rb'
49
+ TechnoGate::Contao::Application.load_global_config!
50
+
51
+ config = TechnoGate::Contao::Application.config.dup
52
+
53
+ db_credentials_for_config = {
54
+ 'host' => db_credentials[:hostname],
55
+ 'port' => db_credentials[:port].present? ? db_credentials[:port] : nil,
56
+ 'user' => db_credentials[:username],
57
+ 'pass' => db_credentials[:password],
58
+ 'database' => fetch(:db_database_name),
59
+ }
60
+
61
+ config.contao.global.send("#{fetch :db_server_app}=", ActiveSupport::OrderedOptions.new)
62
+ db_credentials_for_config.each do |k, v|
63
+ config.contao.global.send("#{fetch :db_server_app}").send("#{k}=", v)
73
64
  end
65
+
66
+ write ERB.new(localconfig, nil, '-').result(binding), localconfig_php_config_path
74
67
  end
75
68
 
76
69
  desc '[internal] Link files from contao to inside public folder'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-contao
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-07-01 00:00:00.000000000 Z
12
+ date: 2012-07-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -179,7 +179,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
179
179
  version: '0'
180
180
  segments:
181
181
  - 0
182
- hash: -2574736369799232917
182
+ hash: -3757429442387583918
183
183
  requirements: []
184
184
  rubyforge_project:
185
185
  rubygems_version: 1.8.23