a9n 0.3.2 → 0.3.3

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: 9d73a21b7d21d7f80d8a209937f548c9bb0a05eb
4
- data.tar.gz: b7ba978f6d03444194db9a0da1a939d1a865ebfa
3
+ metadata.gz: 1bc1f0f1add367dbf4d699062435857f876e5d0e
4
+ data.tar.gz: 89d0a68d3960fcb05326c88c86c1ad3e1bad671c
5
5
  SHA512:
6
- metadata.gz: 0fad65cf52480580df5269c90530b1c767a6a77cd4525dc1e3b66fa0c22148bdc3d5761d067cfac942136892e59e5aeaae2ec84348fc25b1ef30c8dce7efcb83
7
- data.tar.gz: 3481c5165d7ac0e7a8b535ec9f9bffb098c6db6059c56a4912e00bdc44767589d3011cf7ebd28bac41837f193fd265d0c873baea34b8796f0e02fa2099985144
6
+ metadata.gz: b916f7334a6806e541a3e26b3fdc4b895db2cc3fefb931fc1dc07cc0f486c4fafece467725d5549a71cd967d79821fd508c754cc28e008f8948f4bbb94bbd418
7
+ data.tar.gz: 2700af59f2b572a92b9c4980cbb53f49c350d5fa8534dd506e32771653085107e696c8ecce536cc10fbb3b18f593814fa53fbece9a984bd9c067f97bbf5371a7
data/README.md CHANGED
@@ -75,15 +75,15 @@ You can access it by:
75
75
  A9n.mandrill.username # => `joe`
76
76
  A9n.mandrill.api_key # => `1234asdf`
77
77
 
78
-
78
+
79
79
  ## Capistrano
80
80
 
81
81
  If you use capistrano and you feel safe enough to keep all your instance ( staging, production) configuration in the repository, you may find it useful to use capistrano extensions.
82
82
  Just add an instance configuration file e.g. `configuration.yml.staging`, `configuration.yml.production` (NOTE: file extension must be consistent with the capistrano stage) and add
83
83
 
84
84
  require 'a9n/capistrano'
85
-
86
- to your deploy.rb file. This way `configuration.yml.<stage>` overrides `configuration.yml` on each deploy.
85
+
86
+ to your Capfile. This way `configuration.yml.<stage>` overrides `configuration.yml` on each deploy.
87
87
 
88
88
  ## Contributing
89
89
 
@@ -1,11 +1,5 @@
1
- Capistrano::Configuration.instance.load do
2
- after "deploy:update_code", "a9n:copy_stage_config"
3
-
4
- namespace :a9n do
5
- desc "Copy stage configuration to base file."
6
- task :copy_stage_config, roles: :app do
7
- run "cp #{fetch(:release_path)}/config/configuration.yml.#{fetch(:stage)} #{fetch(:release_path)}/config/configuration.yml"
8
- end
9
- end
1
+ if defined?(Capistrano::Configuration.instance)
2
+ require 'a9n/capistrano/ver2x.rb'
3
+ else
4
+ load File.expand_path('../capistrano/tasks.cap', __FILE__)
10
5
  end
11
-
@@ -0,0 +1,12 @@
1
+ namespace :a9n do
2
+ desc "Copy stage configuration to the base file."
3
+ task :copy_stage_config do
4
+ on roles(:app) do
5
+ within fetch(:release_path) do
6
+ execute :cp, "config/configuration.yml.#{fetch(:stage)}", "config/configuration.yml"
7
+ end
8
+ end
9
+ end
10
+ end
11
+
12
+ after "deploy:updating", "a9n:copy_stage_config"
@@ -0,0 +1,10 @@
1
+ Capistrano::Configuration.instance.load do
2
+ after "deploy:update_code", "a9n:copy_stage_config"
3
+
4
+ namespace :a9n do
5
+ desc "Copy stage configuration to base file."
6
+ task :copy_stage_config, roles: :app do
7
+ run "cp #{fetch(:release_path)}/config/configuration.yml.#{fetch(:stage)} #{fetch(:release_path)}/config/configuration.yml"
8
+ end
9
+ end
10
+ end
@@ -1,3 +1,3 @@
1
1
  module A9n
2
- VERSION = "0.3.2"
2
+ VERSION = "0.3.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: a9n
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Krzysztof Knapik
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-19 00:00:00.000000000 Z
11
+ date: 2014-12-23 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: a9n is a tool to keep ruby/rails apps extra configuration easily maintainable
14
14
  and verifiable
@@ -28,6 +28,8 @@ files:
28
28
  - a9n.gemspec
29
29
  - lib/a9n.rb
30
30
  - lib/a9n/capistrano.rb
31
+ - lib/a9n/capistrano/tasks.cap
32
+ - lib/a9n/capistrano/ver2x.rb
31
33
  - lib/a9n/ext/hash.rb
32
34
  - lib/a9n/loader.rb
33
35
  - lib/a9n/struct.rb