env_lint 0.0.2 → 0.0.3

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: d97b9eb15d6f46c00fa255bd0f6d36aae0c9580e
4
- data.tar.gz: 2aa03c2a3f48fbfc51d746a3d4bcb405bfb4d70d
3
+ metadata.gz: 6fd240de9e5e9e0ac7af95569c5b53be92d3e053
4
+ data.tar.gz: d6a635c729e9f4204bbb55becd4285867ae8e6ab
5
5
  SHA512:
6
- metadata.gz: ce4f1dc800421c254c9c4f6235f6796d220d42693fe36cbe1c1ca538fb4b8c8988bd7ed9f31ef65810dedb5f33f7f7a8b1dd40ea0eb4862e8551863206578c93
7
- data.tar.gz: 60ac00cbf5e694d2353f0cd8825259b5f2baa2efc885801f95f1b3eeff8acbed20455c42b746e5d1e4fd5fc1d3d9bbe59f74cf248f6fb8eecdf50e7724262396
6
+ metadata.gz: e0fc2ab83fd65c552e272c1a100cedb9af0ede1b7136fb84d00856b2b7196331c88a7c6bceb5ab81dc69afcc5b3915998f304b470e77c7aac9fc2c6a4c789dea
7
+ data.tar.gz: e674ab0cd397ddc9b8a671f72467545c9043ef86f5d711be393f029171af623a29083323cadc092527527b61458a9d7c1a875447e0c6656fb77b14a4c15c0ca5
data/README.md CHANGED
@@ -13,10 +13,10 @@ according to to a `.env.example` file.
13
13
  deploying a new version of an app
14
14
  * Ease setting up a new development machine
15
15
 
16
- # Status
16
+ ## Status
17
17
 
18
- Only tested with [recap](https://github.com/tomafro/recap) capistrano
19
- tasks.
18
+ Still young, but used in production. Only tested with
19
+ [recap](https://github.com/tomafro/recap) capistrano tasks.
20
20
 
21
21
  ## Installation
22
22
 
@@ -49,7 +49,18 @@ Now you can check your environment:
49
49
  $ rake env:lint
50
50
  => Complains if non optional variables are missing
51
51
 
52
- If special steps are needed
52
+ If special steps are needed to setup your env, you can define a
53
+ `env:load` task. For example to integrate with
54
+ [Dotenv](https://github.com/bkeepers/dotenv):
55
+
56
+ require 'env_lint/tasks'
57
+ require 'dotenv'
58
+
59
+ namespace :env do
60
+ task :load do
61
+ Dotenv.load
62
+ end
63
+ end
53
64
 
54
65
  ### Capistrano Task
55
66
 
@@ -63,10 +74,15 @@ Now you can check your servers:
63
74
  => Complains if non optional variables are missing
64
75
 
65
76
  You might want to lint the environment automatically before each
66
- deploy.
77
+ deploy:
67
78
 
68
79
  before 'deploy', 'env:lint'
69
80
 
81
+ By default, env_lint tries to run `export` as your recap application
82
+ user. The probe command can be configured:
83
+
84
+ set(:env_probe_command, "su - deploy -c 'export'")
85
+
70
86
  Lint variable names before setting them:
71
87
 
72
88
  before 'env:set', 'env:lint_args'
@@ -47,5 +47,5 @@ end
47
47
 
48
48
  if Capistrano::Configuration.instance
49
49
  EnvLint::Capistrano.load_into(Capistrano::Configuration.instance(:must_exist),
50
- Formatter.new)
50
+ EnvLint::Formatter.new)
51
51
  end
@@ -1,14 +1,16 @@
1
1
  namespace :env do
2
2
  desc 'Ensure every non optional ENV variable is defined.'
3
3
  task :lint => :load do
4
+ formatter = EnvLint::Formatter.new
5
+
4
6
  begin
5
7
  EnvLint.verify_hash(env_definition_file, ENV)
6
- EnvLint.formatter.ok('env looks ok')
8
+ formatter.ok('env looks ok')
7
9
  rescue EnvLint::MissingVariables => e
8
- EnvLint.formatter.missing_variables(e.dot_env_file, e.missing_variables)
10
+ formatter.missing_variables(e.dot_env_file, e.missing_variables)
9
11
  abort
10
12
  rescue EnvLint::Error => e
11
- EnvLint.formatter.error(e.message)
13
+ formatter.error(e.message)
12
14
  end
13
15
  end
14
16
 
@@ -1,3 +1,3 @@
1
1
  module EnvLint
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: env_lint
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Fischbach