envied 0.9.3 → 0.10.0.alpha1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.envrc.sample +9 -0
- data/.github/pull_request_template.md +2 -0
- data/.gitignore +1 -0
- data/.gitlab-ci.yml +4 -3
- data/.rspec +1 -0
- data/CHANGELOG.md +13 -1
- data/LICENSE.txt +1 -1
- data/README.md +154 -54
- data/bin/bundle +105 -0
- data/bin/console +2 -6
- data/bin/envied +3 -2
- data/bin/rspec +29 -0
- data/envied.gemspec +15 -5
- data/examples/extensive_envfile +0 -2
- data/exe/envied +4 -0
- data/lib/envied.rb +17 -0
- data/lib/envied/cli.rb +9 -0
- data/lib/envied/coercer.rb +1 -1
- data/lib/envied/coercer/envied_string.rb +4 -0
- data/lib/envied/configuration.rb +14 -32
- data/lib/envied/env_interceptor.rb +19 -0
- data/lib/envied/env_proxy.rb +8 -5
- data/lib/envied/templates/Envfile.tt +5 -3
- data/lib/envied/variable.rb +2 -11
- data/lib/envied/version.rb +1 -1
- metadata +32 -27
- data/spec/coercer_spec.rb +0 -274
- data/spec/configuration_spec.rb +0 -113
- data/spec/env_var_extractor_spec.rb +0 -22
- data/spec/envied_spec.rb +0 -339
- data/spec/gemspec_spec.rb +0 -17
- data/spec/spec_helper.rb +0 -74
- data/spec/variable_spec.rb +0 -25
data/spec/gemspec_spec.rb
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
require "open3"
|
2
|
-
|
3
|
-
RSpec.describe 'envied.gemspec' do
|
4
|
-
let!(:build) { Open3.capture3("gem build envied.gemspec") }
|
5
|
-
|
6
|
-
after do
|
7
|
-
Dir.glob("envied-*.gem").each { |f| File.delete(f) }
|
8
|
-
end
|
9
|
-
|
10
|
-
it 'builds without warnings' do
|
11
|
-
expect(build[1]).to_not match(/WARNING/)
|
12
|
-
end
|
13
|
-
|
14
|
-
it 'builds successfully' do
|
15
|
-
expect(build[2].success?).to eq true
|
16
|
-
end
|
17
|
-
end
|
data/spec/spec_helper.rb
DELETED
@@ -1,74 +0,0 @@
|
|
1
|
-
require "bundler/setup"
|
2
|
-
require "envied"
|
3
|
-
|
4
|
-
RSpec.configure do |config|
|
5
|
-
# rspec-expectations config goes here. You can use an alternate
|
6
|
-
# assertion/expectation library such as wrong or the stdlib/minitest
|
7
|
-
# assertions if you prefer.
|
8
|
-
config.expect_with :rspec do |expectations|
|
9
|
-
# This option will default to `true` in RSpec 4. It makes the `description`
|
10
|
-
# and `failure_message` of custom matchers include text for helper methods
|
11
|
-
# defined using `chain`, e.g.:
|
12
|
-
# be_bigger_than(2).and_smaller_than(4).description
|
13
|
-
# # => "be bigger than 2 and smaller than 4"
|
14
|
-
# ...rather than:
|
15
|
-
# # => "be bigger than 2"
|
16
|
-
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
17
|
-
end
|
18
|
-
|
19
|
-
# rspec-mocks config goes here. You can use an alternate test double
|
20
|
-
# library (such as bogus or mocha) by changing the `mock_with` option here.
|
21
|
-
config.mock_with :rspec do |mocks|
|
22
|
-
# Prevents you from mocking or stubbing a method that does not exist on
|
23
|
-
# a real object. This is generally recommended, and will default to
|
24
|
-
# `true` in RSpec 4.
|
25
|
-
mocks.verify_partial_doubles = true
|
26
|
-
end
|
27
|
-
|
28
|
-
# These two settings work together to allow you to limit a spec run
|
29
|
-
# to individual examples or groups you care about by tagging them with
|
30
|
-
# `:focus` metadata. When nothing is tagged with `:focus`, all examples
|
31
|
-
# get run.
|
32
|
-
# config.filter_run :focus
|
33
|
-
# config.run_all_when_everything_filtered = true
|
34
|
-
|
35
|
-
# Allows RSpec to persist some state between runs in order to support
|
36
|
-
# the `--only-failures` and `--next-failure` CLI options. We recommend
|
37
|
-
# you configure your source control system to ignore this file.
|
38
|
-
config.example_status_persistence_file_path = "spec/examples.txt"
|
39
|
-
|
40
|
-
# Limits the available syntax to the non-monkey patched syntax that is
|
41
|
-
# recommended. For more details, see:
|
42
|
-
# - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/
|
43
|
-
# - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
|
44
|
-
# - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode
|
45
|
-
config.disable_monkey_patching!
|
46
|
-
|
47
|
-
# Many RSpec users commonly either run the entire suite or an individual
|
48
|
-
# file, and it's useful to allow more verbose output when running an
|
49
|
-
# individual spec file.
|
50
|
-
if config.files_to_run.one?
|
51
|
-
# Use the documentation formatter for detailed output,
|
52
|
-
# unless a formatter has already been configured
|
53
|
-
# (e.g. via a command-line flag).
|
54
|
-
config.default_formatter = 'doc'
|
55
|
-
end
|
56
|
-
|
57
|
-
# Print the 10 slowest examples and example groups at the
|
58
|
-
# end of the spec run, to help surface which specs are running
|
59
|
-
# particularly slow.
|
60
|
-
# config.profile_examples = 10
|
61
|
-
|
62
|
-
# Run specs in random order to surface order dependencies. If you find an
|
63
|
-
# order dependency and want to debug it, you can fix the order by providing
|
64
|
-
# the seed, which is printed after each run.
|
65
|
-
# --seed 1234
|
66
|
-
config.order = :random
|
67
|
-
|
68
|
-
# Seed global randomization in this process using the `--seed` CLI option.
|
69
|
-
# Setting this allows you to use `--seed` to deterministically reproduce
|
70
|
-
# test failures related to randomization by passing the same `--seed` value
|
71
|
-
# as the one that triggered the failure.
|
72
|
-
Kernel.srand config.seed
|
73
|
-
|
74
|
-
end
|
data/spec/variable_spec.rb
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
RSpec.describe ENVied::Variable do
|
2
|
-
def variable(*args)
|
3
|
-
described_class.new(*args)
|
4
|
-
end
|
5
|
-
|
6
|
-
describe 'an instance' do
|
7
|
-
subject { variable(:A, :string) }
|
8
|
-
it { is_expected.to respond_to :name }
|
9
|
-
it { is_expected.to respond_to :type }
|
10
|
-
it { is_expected.to respond_to :group }
|
11
|
-
it { is_expected.to respond_to :default }
|
12
|
-
it { is_expected.to respond_to :== }
|
13
|
-
it { is_expected.to respond_to :default_value }
|
14
|
-
end
|
15
|
-
|
16
|
-
describe 'defaults' do
|
17
|
-
it 'returns the default value as it is' do
|
18
|
-
expect(variable(:A, :string, default: 'A').default_value).to eq 'A'
|
19
|
-
end
|
20
|
-
|
21
|
-
it 'returns the default value from calling the proc provided' do
|
22
|
-
expect(variable(:A, :string, default: ->{ 'A' * 2 }).default_value).to eq 'AA'
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|