a9n 0.4.4 → 0.4.5

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: e26963e72142a6b717bee52c98356270c4385f12
4
- data.tar.gz: 52915f48fde1854aae35e1bdf1d010cac5fefb3f
3
+ metadata.gz: c22d5e7310407cb2773dc933fadaec4edeb9cc29
4
+ data.tar.gz: 074a49169e7a1c25ae6123f8b6fe82a3326da2d6
5
5
  SHA512:
6
- metadata.gz: 1f41314a77eb6e3c47ecdc25caf3211673b3df93ac5e9bb65b77a52ddc59faa94b1419a3c6401d3cc7600ce588007a82bb7c205ff7f946a79c7012d8594f95a6
7
- data.tar.gz: 86e0840d6bf52eaeb2763040491b84f104c5d8add1a84382d7b2005f02a954ecac3b3c4d2c84dad88e7f7b655c85d5429ec29dc2494803192ecc099d6cd5de36
6
+ metadata.gz: 0b473d6dd3647dff4a443d80b86604cfb30268f18a46429d4d559267b77917c99b75ee0596bb3325e5a6615626949d1365d5bb31c5c872645fb9956052494688
7
+ data.tar.gz: 942b478f1f5fe7f76d686de2e2852d5290183c9ed79613803bf65018f43d220fff9cca161a51b9d00864616ec622306e7e830c78285cf4e914b82e758382f43c
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.2.2@a9n
1
+ 2.2.3@a9n
data/.travis.yml CHANGED
@@ -1,8 +1,7 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.0.0
4
- - 2.1.6
5
- - 2.2.2
3
+ - 2.1.7
4
+ - 2.2.3
6
5
  addons:
7
6
  code_climate:
8
7
  repo_token: 9aa2aa2432639c57772b6917ad9da468709e5536b75617575b02b35201a2eaf8
data/README.md CHANGED
@@ -10,7 +10,7 @@
10
10
  [codeclimate]: https://codeclimate.com/github/knapo/a9n
11
11
  [coverage]: https://codeclimate.com/github/knapo/a9n
12
12
 
13
- A9n is a simple tool to keep ruby/rails apps configuration maintanable and verifiable. It supports Rails 2.x, 3.x, 4.x and Ruby 2.0. 2.1, 2.2. Ruby 1.8 is not supported since version 0.1.2. Ruby 1.9 is not supported since version 0.4.0.
13
+ A9n is a simple tool to keep ruby/rails apps configuration maintanable and verifiable. It supports Rails 3.x, 4.x and Ruby 2.0. 2.1, 2.2. Ruby 1.8 and Rails 2.x are not supported since version 0.1.2. Ruby 1.9 is not supported since version 0.4.0.
14
14
 
15
15
  Why it's named a9n? It's a numeronym for application (where 9 stands for the number of letters between the first **a** and last **n**, similar to i18n or l10n).
16
16
 
@@ -75,6 +75,12 @@ You can access it by:
75
75
  A9n.mandrill.username # => `joe`
76
76
  A9n.mandrill.api_key # => `1234asdf`
77
77
 
78
+ ## Mapping ENV variables
79
+
80
+ Sometimes, you don't want to store a single secret value in the repo and you prefer having it in ENV variable. You can easily map it using `:env` symbol as a value:
81
+
82
+ production:
83
+ access_token: :env
78
84
 
79
85
  ## Capistrano
80
86
 
data/lib/a9n.rb CHANGED
@@ -34,7 +34,11 @@ module A9n
34
34
  end
35
35
 
36
36
  def root
37
- @root ||= app.root
37
+ @root ||= app_root
38
+ end
39
+
40
+ def app_root
41
+ app.root if app && app.respond_to?(:root)
38
42
  end
39
43
 
40
44
  def root=(path)
data/lib/a9n/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module A9n
2
- VERSION = "0.4.4"
2
+ VERSION = "0.4.5"
3
3
  end
@@ -72,25 +72,53 @@ describe A9n do
72
72
  end
73
73
 
74
74
  describe ".root" do
75
- let(:app) { double(env: "test", root: "/apps/a9n") }
76
-
77
- before do
78
- subject.app = app
79
- end
75
+ context "when app is set" do
76
+ let(:app) { double(env: "test", root: "/apps/a9n") }
80
77
 
81
- context "with custom path" do
82
78
  before do
83
- subject.root = "/home/knapo/workspace/a9n"
79
+ subject.app = app
84
80
  end
85
81
 
86
- it do
87
- expect(subject.root).to eq(Pathname.new("/home/knapo/workspace/a9n"))
82
+ context "with custom path" do
83
+ before do
84
+ subject.root = "/home/knapo/workspace/a9n"
85
+ end
86
+
87
+ it do
88
+ expect(subject.root).to eq(Pathname.new("/home/knapo/workspace/a9n"))
89
+ end
90
+ end
91
+
92
+ context "with local app path" do
93
+ it do
94
+ expect(subject.root).to eq("/apps/a9n")
95
+ end
88
96
  end
89
97
  end
90
98
 
91
- context "with local app path" do
99
+ context "when app is not set" do
92
100
  it do
93
- expect(subject.root).to eq("/apps/a9n")
101
+ expect(subject.root).to eq(nil)
102
+ end
103
+
104
+ context "when setting a custom path when is falsy" do
105
+ before do
106
+ subject.root ||= "/home/knapo/workspace/a9n"
107
+ end
108
+
109
+ it do
110
+ expect(subject.root).to eq(Pathname.new("/home/knapo/workspace/a9n"))
111
+ end
112
+ end
113
+
114
+ context "when setting a custom path" do
115
+ before do
116
+ subject.root = "/home/knapo/workspace/a9n"
117
+ end
118
+
119
+ it do
120
+ expect(subject.root).to eq(Pathname.new("/home/knapo/workspace/a9n"))
121
+ end
94
122
  end
95
123
  end
96
124
  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.4.4
4
+ version: 0.4.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Krzysztof Knapik
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-19 00:00:00.000000000 Z
11
+ date: 2015-08-26 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: a9n - ruby/rails apps configuration manager
14
14
  email:
@@ -66,7 +66,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
66
66
  version: '0'
67
67
  requirements: []
68
68
  rubyforge_project:
69
- rubygems_version: 2.4.6
69
+ rubygems_version: 2.4.5.1
70
70
  signing_key:
71
71
  specification_version: 4
72
72
  summary: a9n is a tool to keep ruby/rails apps extra configuration easily maintainable