capistrano-dotenv-tasks 0.1.4 → 0.1.5
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 +15 -4
- data/lib/capistrano/dotenv/config.rb +3 -5
- data/lib/capistrano/dotenv/version.rb +1 -1
- data/spec/config_spec.rb +35 -3
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1d428478e6c029b84dc870701567ccce81fc8115
|
4
|
+
data.tar.gz: 6be2707a1fa2089f32f7e78ebb67f10dd60443b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0f74451db21561e28d1c859f6c80db301f924628aa9516bc2b14f90e8bf3a028241d31c5f05d9b5e1f4d61ffda88bd4fc57981593ee28ce6ca39de40cf89f867
|
7
|
+
data.tar.gz: 265858c57740ac5311c160d596bfc51ffaa6a2980f72050522666085ed72ac279575f18914a6857193106c465a03445b40f64745fef01716255d208b88c6dd0a
|
data/README.md
CHANGED
@@ -4,9 +4,10 @@ Show, set and delete env vars in your `.env` remote file with Capistrano 3.
|
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
7
|
-
Add
|
7
|
+
Add these lines to your application's Gemfile:
|
8
8
|
|
9
9
|
```ruby
|
10
|
+
gem 'dotenv' # if you haven't added it, already
|
10
11
|
gem 'capistrano-dotenv-tasks', require: false
|
11
12
|
```
|
12
13
|
|
@@ -20,13 +21,23 @@ Or install it yourself as:
|
|
20
21
|
|
21
22
|
## Usage
|
22
23
|
|
23
|
-
Require it in your Capfile
|
24
|
+
Require it in your Capfile:
|
24
25
|
|
25
26
|
```ruby
|
26
27
|
require 'capistrano/dotenv/tasks'
|
27
28
|
```
|
28
29
|
|
29
|
-
|
30
|
+
Make the `.env` file
|
31
|
+
[a file that is shared between releases](http://capistranorb.com/documentation/getting-started/structure/)
|
32
|
+
by adding one of the following lines to your `config/deploy.rb` script:
|
33
|
+
|
34
|
+
```ruby
|
35
|
+
append :linked_files, '.env' # for capistrano >= 3.5
|
36
|
+
set :linked_files, fetch(:linked_file, []).push('.env') # for capistrano < 3.5
|
37
|
+
```
|
38
|
+
|
39
|
+
Then, access the capistrano rake tasks to edit your remote `.env` file from
|
40
|
+
the `cap` command.
|
30
41
|
|
31
42
|
|
32
43
|
### Show your config
|
@@ -61,6 +72,6 @@ $ cap production config:remove[VARNAME1,VARNAME2]
|
|
61
72
|
4. Push to the branch (`git push origin my-new-feature`)
|
62
73
|
5. Create a new Pull Request
|
63
74
|
|
64
|
-
##
|
75
|
+
## License
|
65
76
|
|
66
77
|
MIT
|
data/spec/config_spec.rb
CHANGED
@@ -4,7 +4,7 @@ RSpec.describe Capistrano::Dotenv::Config do
|
|
4
4
|
|
5
5
|
shared_examples_for '#to_s' do
|
6
6
|
subject { config.to_s }
|
7
|
-
it { is_expected.to eq(contents) }
|
7
|
+
it { is_expected.to eq(contents + "\n") }
|
8
8
|
end
|
9
9
|
|
10
10
|
subject(:config) { described_class.new(contents) }
|
@@ -15,12 +15,12 @@ RSpec.describe Capistrano::Dotenv::Config do
|
|
15
15
|
it_behaves_like '#to_s' do
|
16
16
|
describe '#add' do
|
17
17
|
before { config.add('NAME=value') }
|
18
|
-
it { is_expected.to eq("
|
18
|
+
it { is_expected.to eq("NAME=value\nVAR=foo\n")}
|
19
19
|
end
|
20
20
|
|
21
21
|
describe '#remove' do
|
22
22
|
before { config.remove('VAR') }
|
23
|
-
it { is_expected.to eq(
|
23
|
+
it { is_expected.to eq("\n") }
|
24
24
|
end
|
25
25
|
end
|
26
26
|
end
|
@@ -29,4 +29,36 @@ RSpec.describe Capistrano::Dotenv::Config do
|
|
29
29
|
let(:contents) { 'VAR=foo bar' }
|
30
30
|
it_behaves_like '#to_s'
|
31
31
|
end
|
32
|
+
|
33
|
+
context 'VAR="double#quoted#string"' do
|
34
|
+
let(:contents) {'VAR="double#quoted#string"'}
|
35
|
+
|
36
|
+
it_behaves_like '#to_s' do
|
37
|
+
describe '#add' do
|
38
|
+
before { config.add('NAME=value') }
|
39
|
+
it { is_expected.to eq("NAME=value\nVAR=\"double#quoted#string\"\n")}
|
40
|
+
end
|
41
|
+
|
42
|
+
describe '#remove' do
|
43
|
+
before { config.remove('VAR') }
|
44
|
+
it { is_expected.to eq("\n") }
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
context "VAR='single#quoted#string'" do
|
50
|
+
let(:contents) {"VAR='single#quoted#string'"}
|
51
|
+
|
52
|
+
it_behaves_like '#to_s' do
|
53
|
+
describe '#add' do
|
54
|
+
before { config.add('NAME=value') }
|
55
|
+
it { is_expected.to eq("NAME=value\nVAR='single#quoted#string'\n")}
|
56
|
+
end
|
57
|
+
|
58
|
+
describe '#remove' do
|
59
|
+
before { config.remove('VAR') }
|
60
|
+
it { is_expected.to eq("\n") }
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
32
64
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano-dotenv-tasks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Valentin Ballestrino
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-04-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capistrano
|
@@ -105,7 +105,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
105
105
|
version: '0'
|
106
106
|
requirements: []
|
107
107
|
rubyforge_project:
|
108
|
-
rubygems_version: 2.
|
108
|
+
rubygems_version: 2.6.11
|
109
109
|
signing_key:
|
110
110
|
specification_version: 4
|
111
111
|
summary: Capistrano tasks to configure your remote dotenv files
|