vault-tools 0.3.6 → 0.3.7

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Vault::Tools
2
2
 
3
- Tooling for the Heroku Vault team to enable faster bootstrapping for
4
- Ruby projects.
3
+ Tools is the English word for ツール. Tooling for the Heroku Vault
4
+ team to enable faster bootstrapping for Ruby projects.
5
5
 
6
6
  ## Setting up a development environment
7
7
 
@@ -48,6 +48,10 @@ module Vault
48
48
  env(key) ? env(key).to_i : nil
49
49
  end
50
50
 
51
+ def bool?(key)
52
+ ENV[key] == 'true'
53
+ end
54
+
51
55
  def sidekiq_concurrency
52
56
  int('SIDEKIQ_CONCURRENCY') || 25
53
57
  end
@@ -1,5 +1,5 @@
1
1
  module Vault
2
2
  module Tools
3
- VERSION = '0.3.6'
3
+ VERSION = '0.3.7'
4
4
  end
5
5
  end
data/test/config_test.rb CHANGED
@@ -89,4 +89,16 @@ class ConfigTest < Vault::TestCase
89
89
  set_env 'SIDEKIQ_CONCURRENCY', '10'
90
90
  assert_equal(10, Vault::Config.sidekiq_concurrency)
91
91
  end
92
+
93
+ # Config.bool?(var) is only true if the value of var is the string 'true'.
94
+ # If the var is absent or any other value, it evaluates to false.
95
+ def test_bool_returns_true
96
+ assert_equal(false, Vault::Config.bool?('VAULT_BOOLEAN_VAR'))
97
+ set_env 'VAULT_BOOLEAN_VAR', 'true'
98
+ assert_equal(true, Vault::Config.bool?('VAULT_BOOLEAN_VAR'))
99
+ set_env 'VAULT_BOOLEAN_VAR', 'false'
100
+ assert_equal(false, Vault::Config.bool?('VAULT_BOOLEAN_VAR'))
101
+ set_env 'VAULT_BOOLEAN_VAR', 'foo'
102
+ assert_equal(false, Vault::Config.bool?('VAULT_BOOLEAN_VAR'))
103
+ end
92
104
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vault-tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.6
4
+ version: 0.3.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-04-02 00:00:00.000000000 Z
13
+ date: 2013-04-30 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: scrolls
@@ -144,23 +144,16 @@ required_ruby_version: !ruby/object:Gem::Requirement
144
144
  - - ! '>='
145
145
  - !ruby/object:Gem::Version
146
146
  version: '0'
147
- segments:
148
- - 0
149
- hash: 1120623186219143644
150
147
  required_rubygems_version: !ruby/object:Gem::Requirement
151
148
  none: false
152
149
  requirements:
153
150
  - - ! '>='
154
151
  - !ruby/object:Gem::Version
155
152
  version: '0'
156
- segments:
157
- - 0
158
- hash: 1120623186219143644
159
153
  requirements: []
160
154
  rubyforge_project:
161
- rubygems_version: 1.8.23
155
+ rubygems_version: 1.8.25
162
156
  signing_key:
163
157
  specification_version: 3
164
158
  summary: Test classes, base web classes, and helpers - oh my!
165
159
  test_files: []
166
- has_rdoc: