envied 0.6.0 → 0.6.1

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: dea71b6724a7a89b51486ea15c3149ce380b171b
4
- data.tar.gz: da45f75d1b3a18765f8bc05e43a321c1c140906f
3
+ metadata.gz: 1f7249d9e47e9fb7837322ca6d5c4c13da3a0b71
4
+ data.tar.gz: 5d7946abccb41ae923c3730fddef68c4e7dde5be
5
5
  SHA512:
6
- metadata.gz: bb5e335de481a06773babe4c479df4b2c7ea7b19d427961a91fdb3187f4c14470628d3bcca27c652c5a01743682840b9e95722ef6eefd45e7b3602ea46a7988c
7
- data.tar.gz: 82a4c9d0f3b30cc807d27038ef6f1b48ddc601d9d650e8457d6ff8b1bb25848e51ce8d6ffcab9fc5faea5eb168e55439be2187564459aa6972d05a0bef6880cd
6
+ metadata.gz: e3174fce263d5f6b1580e5fba893c9c690ed07091b1ab859b389ae6e9f2f8201b7004b8d283ce690376a7fefca3833576811b9c72cdaab3c1192473b59f9f4a5
7
+ data.tar.gz: f5be4b540310a362c9c19558049745b851eed7b8757bb0e3af016bd1d4cc11075b9d6dd55919e0277b723a25273f01c125f027605ac71b8b23251158bf32bccd
data/README.md CHANGED
@@ -47,7 +47,7 @@ ENVied.FORCE_SSL # => false
47
47
  The following types are supported:
48
48
 
49
49
  * `:String` (implied)
50
- * `:Boolean` (e.g. '0'/'1', 'f'/'t', 'false'/'true', 'off'/'on', 'yes','no' for resp. true or false)
50
+ * `:Boolean` (e.g. '0'/'1', 'f'/'t', 'false'/'true', 'off'/'on', 'no'/'yes' for resp. false and true)
51
51
  * `:Integer`
52
52
  * `:Symbol`
53
53
  * `:Date` (e.g. '2014-3-26')
@@ -103,7 +103,7 @@ As a rule of thumb you should only use defaults:
103
103
  * for local development
104
104
  * for ENV-variables that your application introduces (i.e. for `ENV['STAFF_EMAILS']` not for `ENV['REDIS_URL']`)
105
105
 
106
- ### A more extensive example:
106
+ ### A more extensive example
107
107
 
108
108
  ```ruby
109
109
  # Envfile
@@ -112,7 +112,7 @@ As a rule of thumb you should only use defaults:
112
112
  # New developers that don't have RACK_ENV set, will in this way not be presented with a huge
113
113
  # list of missing variables, as defaults are still enabled.
114
114
  not_production_nor_ci = ->{ !(ENV['RACK_ENV'] == 'production' || ENV['CI']) }
115
- enable_defaults(&not_production_nor_ci)
115
+ enable_defaults!(&not_production_nor_ci)
116
116
 
117
117
  # Your code will likely not use ENVied.RACK_ENV (better use Rails.env),
118
118
  # we want it to be present though; heck, we're using it in this file!
@@ -154,6 +154,15 @@ ENVied.require(:default, :test, :ci)
154
154
  ENVied.require(:default, ENV['RACK_ENV'], (ENV['CI'] ? :ci : :not_ci))
155
155
  ```
156
156
 
157
+ ## command-line interface
158
+
159
+ ```bash
160
+ $ envied help
161
+ Commands:
162
+ envied check # Checks whether all ENV-variables are present and valid
163
+ envied help [COMMAND] # Describe available commands or one specific command
164
+ envied init # Generates a default Envfile in the current working directory
165
+ ```
157
166
 
158
167
  ## Installation
159
168
 
@@ -161,11 +170,11 @@ Add this line to your application's Gemfile:
161
170
 
162
171
  gem 'envied'
163
172
 
164
- Then bundle:
173
+ ...then bundle:
165
174
 
166
175
  $ bundle
167
176
 
168
- And generate the `Envfile`:
177
+ ...and generate the `Envfile`:
169
178
 
170
179
  $ bundle exec envied init
171
180
 
data/lib/envied/cli.rb CHANGED
@@ -5,10 +5,23 @@ class ENVied
5
5
  include Thor::Actions
6
6
  source_root File.expand_path('../templates', __FILE__)
7
7
 
8
- desc "init", "Generate a default Envfile in the current working directory."
8
+ desc "init", "Generates a default Envfile in the current working directory"
9
9
  def init
10
10
  puts "Writing new Envfile to #{File.expand_path('Envfile')}"
11
11
  template("Envfile.tt")
12
12
  end
13
+
14
+ desc "check", "Checks whether all ENV-variables are present and valid"
15
+ long_desc <<-LONG
16
+ Checks whether all ENV-variables are present and valid.
17
+
18
+ On success the process will exit with status 0.
19
+ Else the missing/invalid variables will be shown, and the process will exit with status 1.
20
+ LONG
21
+ option :groups, type: :array, default: %w(default), banner: 'default production'
22
+ def check
23
+ ENVied.require(*options[:groups])
24
+ puts "All ENV-variables for group(s) #{options[:groups]} are ok!"
25
+ end
13
26
  end
14
27
  end
@@ -1,3 +1,3 @@
1
1
  class ENVied
2
- VERSION = '0.6.0'
2
+ VERSION = '0.6.1'
3
3
  end
data/spec/envied_spec.rb CHANGED
@@ -27,12 +27,12 @@ describe ENVied do
27
27
  end
28
28
 
29
29
  def configure(options = {}, &block)
30
- described_class.configure(options, &block)
30
+ described_class.configuration(options, &block)
31
31
  self
32
32
  end
33
33
 
34
34
  def configured_with(hash = {})
35
- described_class.configure do
35
+ described_class.configuration do
36
36
  hash.each do |name, type|
37
37
  variable(name, *type)
38
38
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: envied
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gert Goet
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-13 00:00:00.000000000 Z
11
+ date: 2014-08-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: virtus