sunzi-rails 0.2.11 → 0.2.12

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: 7572af43fdfea476d9ac7cf5ccc3fd4732ab75bd
4
- data.tar.gz: f7f62a3213426b21ab5e6e643dd470975fa921dc
3
+ metadata.gz: 935d6dcf19b2d56f74469bfcaba57a49263a6c3f
4
+ data.tar.gz: 38fb57c30f82279de72203fbe1a11bb6d3922c06
5
5
  SHA512:
6
- metadata.gz: d778c32a9ef0b6439be64cff4b23d50b71d89a3b54429a4b05f6ab9c64cb9630d640d78a920804b4af21f8b2d42d1c6f3493183a673d17d548ec1dc6625c51f5
7
- data.tar.gz: 8630877ead10584ef2713d30291d291228ecd432e14127cfd9536dc77ef54a27aa26c0c898f5815f5271a752a56a875ea5193d3edb2a46cf5985ed8bf766920b
6
+ metadata.gz: ad9b0425c11f0de6d32887be01709524514f7653fb2d799ef8f77c79a6d738112530c7c41bd3a05287a2f4e9351695a0efedc00bcc29ae6701ce6fb40d415f2d
7
+ data.tar.gz: c7c027053f4d26b3e4ed25b5171c5e5b59b3e5109956621e3be8e7b1fd256a6f59ee38ae73716342ea97cc98d286eaf5c2339b1d119dae83770bc70f1a558f66
data/README.md CHANGED
@@ -60,6 +60,17 @@ Finally, add `/compiled` to your `.gitignore` file.
60
60
 
61
61
  All those settings can be overriden in your `sunzi.yml` file within `attributes`.
62
62
 
63
+ Also, contextual attributes are available through `@attributes`:
64
+
65
+ ```ruby
66
+ @attributes.env_stage
67
+ @attributes.env_role
68
+ @attributes.env_sudo
69
+ @attributes.env_user
70
+ @attributes.env_host
71
+ @attributes.env_port
72
+ ```
73
+
63
74
  Go into the project directory, then run `sunzi-cap deploy`:
64
75
 
65
76
  ```bash
data/lib/sunzi/cli.rb CHANGED
@@ -106,6 +106,14 @@ module Sunzi
106
106
  @attributes = Database.load_env(@stage)
107
107
  .merge(cap.slice(:ruby_version, :deployer_name))
108
108
  .merge(Secrets.load_env(@stage).slice(:deployer_password, :deployer_public_key))
109
+ .merge(
110
+ env_stage: @stage,
111
+ env_role: @role,
112
+ env_sudo: options.sudo?,
113
+ env_user: @user,
114
+ env_host: @host,
115
+ env_port: @port
116
+ )
109
117
  .merge(@config['attributes'] || {})
110
118
  end
111
119
 
data/lib/sunzi/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Sunzi
2
- VERSION = "0.2.11"
2
+ VERSION = "0.2.12"
3
3
  RUBY_VERSION = IO.read("#{File.dirname(__FILE__)}/../../.ruby-version").strip
4
4
  RAILS_VERSION = "4.2"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sunzi-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.11
4
+ version: 0.2.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kenn Ejima
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-01-17 00:00:00.000000000 Z
12
+ date: 2016-01-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport