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 +4 -4
 - data/README.md +14 -5
 - data/lib/envied/cli.rb +14 -1
 - data/lib/envied/version.rb +1 -1
 - data/spec/envied_spec.rb +2 -2
 - metadata +2 -2
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 1f7249d9e47e9fb7837322ca6d5c4c13da3a0b71
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 5d7946abccb41ae923c3730fddef68c4e7dde5be
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 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', ' 
     | 
| 
      
 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(¬_production_nor_ci)
         
     | 
| 
      
 115 
     | 
    
         
            +
            enable_defaults!(¬_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 
     | 
    
         
            -
             
     | 
| 
      
 173 
     | 
    
         
            +
            ...then bundle:
         
     | 
| 
       165 
174 
     | 
    
         | 
| 
       166 
175 
     | 
    
         
             
                $ bundle
         
     | 
| 
       167 
176 
     | 
    
         | 
| 
       168 
     | 
    
         
            -
             
     | 
| 
      
 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", " 
     | 
| 
      
 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
         
     | 
    
        data/lib/envied/version.rb
    CHANGED
    
    
    
        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. 
     | 
| 
      
 30 
     | 
    
         
            +
                  described_class.configuration(options, &block)
         
     | 
| 
       31 
31 
     | 
    
         
             
                  self
         
     | 
| 
       32 
32 
     | 
    
         
             
                end
         
     | 
| 
       33 
33 
     | 
    
         | 
| 
       34 
34 
     | 
    
         
             
                def configured_with(hash = {})
         
     | 
| 
       35 
     | 
    
         
            -
                  described_class. 
     | 
| 
      
 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. 
     | 
| 
      
 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- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2014-08-16 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: virtus
         
     |