capistrano-figaro 1.0.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.codeclimate.yml +7 -0
- data/.gitignore +16 -0
- data/.rubocop.yml +6 -0
- data/.travis.yml +10 -0
- data/CHANGELOG.md +6 -0
- data/Gemfile +3 -0
- data/Gemfile.lock +65 -0
- data/LICENSE +21 -0
- data/README.md +64 -0
- data/Rakefile +9 -0
- data/VERSION +1 -0
- data/capistrano-figaro.gemspec +30 -0
- data/config/application.yml +1 -0
- data/lib/capistrano-figaro.rb +0 -0
- data/lib/capistrano/figaro.rb +1 -0
- data/lib/capistrano/tasks/figaro.rake +20 -0
- data/test/figaro_test.rb +29 -0
- data/test/test_helper.rb +21 -0
- metadata +163 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 5eac98fc5805e637bc4e552b4077b93831d9155b
|
4
|
+
data.tar.gz: e773475fb12c9998a9d71568c3db9f2fba164e05
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: d055d3533cea8b62df042f30265a18929428d8243570f6ac6e413ac2999e99b64afd483ece61e790f2dca59ee8f9ed08f79bcae4ae4e73720f085679f681942f
|
7
|
+
data.tar.gz: 0a4c756d639d83be2c147441cd1d03e12bda68c18c3abe40224e0545b83d6a901d9a8480da8633ca09ccbe0b080659702722194736383a21745760650edb2a30
|
data/.codeclimate.yml
ADDED
data/.gitignore
ADDED
data/.rubocop.yml
ADDED
data/.travis.yml
ADDED
data/CHANGELOG.md
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,65 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
capistrano-figaro (1.0.0)
|
5
|
+
capistrano (~> 3.1)
|
6
|
+
figaro (~> 1.1)
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: https://rubygems.org/
|
10
|
+
specs:
|
11
|
+
ast (2.0.0)
|
12
|
+
astrolabe (1.3.1)
|
13
|
+
parser (~> 2.2)
|
14
|
+
capistrano (3.4.0)
|
15
|
+
i18n
|
16
|
+
rake (>= 10.0.0)
|
17
|
+
sshkit (~> 1.3)
|
18
|
+
codeclimate-test-reporter (0.4.7)
|
19
|
+
simplecov (>= 0.7.1, < 1.0.0)
|
20
|
+
colorize (0.7.7)
|
21
|
+
docile (1.1.5)
|
22
|
+
figaro (1.1.1)
|
23
|
+
thor (~> 0.14)
|
24
|
+
i18n (0.7.0)
|
25
|
+
json (1.8.3)
|
26
|
+
minitest (5.7.0)
|
27
|
+
net-scp (1.2.1)
|
28
|
+
net-ssh (>= 2.6.5)
|
29
|
+
net-ssh (2.9.2)
|
30
|
+
parser (2.2.2.6)
|
31
|
+
ast (>= 1.1, < 3.0)
|
32
|
+
powerpack (0.1.1)
|
33
|
+
rainbow (2.0.0)
|
34
|
+
rake (10.4.2)
|
35
|
+
rubocop (0.32.1)
|
36
|
+
astrolabe (~> 1.3)
|
37
|
+
parser (>= 2.2.2.5, < 3.0)
|
38
|
+
powerpack (~> 0.1)
|
39
|
+
rainbow (>= 1.99.1, < 3.0)
|
40
|
+
ruby-progressbar (~> 1.4)
|
41
|
+
ruby-progressbar (1.7.5)
|
42
|
+
simplecov (0.10.0)
|
43
|
+
docile (~> 1.1.0)
|
44
|
+
json (~> 1.8)
|
45
|
+
simplecov-html (~> 0.10.0)
|
46
|
+
simplecov-html (0.10.0)
|
47
|
+
sshkit (1.7.1)
|
48
|
+
colorize (>= 0.7.0)
|
49
|
+
net-scp (>= 1.1.2)
|
50
|
+
net-ssh (>= 2.8.0)
|
51
|
+
thor (0.19.1)
|
52
|
+
|
53
|
+
PLATFORMS
|
54
|
+
ruby
|
55
|
+
|
56
|
+
DEPENDENCIES
|
57
|
+
bundler (~> 1.10)
|
58
|
+
capistrano-figaro!
|
59
|
+
codeclimate-test-reporter (~> 0.4)
|
60
|
+
minitest (~> 5.7)
|
61
|
+
rake (~> 10.4)
|
62
|
+
rubocop (~> 0.32)
|
63
|
+
|
64
|
+
BUNDLED WITH
|
65
|
+
1.10.5
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2015 Runar Skaare Tveiten
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,64 @@
|
|
1
|
+
# capistrano-figaro
|
2
|
+
|
3
|
+
Capistrano plugin that integrates with Figaro, loading your configuration for
|
4
|
+
use during deployment.
|
5
|
+
|
6
|
+
[![Gem Version](https://img.shields.io/gem/v/capistrano-figaro.svg?style=flat-square)](http://badge.fury.io/rb/capistrano-figaro)
|
7
|
+
[![Build Status](https://img.shields.io/travis/runar/capistrano-figaro/master.svg?style=flat-square)](https://travis-ci.org/runar/capistrano-figaro)
|
8
|
+
[![Code Climate](https://img.shields.io/codeclimate/github/runar/capistrano-figaro.svg?style=flat-square)](https://codeclimate.com/github/runar/capistrano-figaro)
|
9
|
+
[![Coverage Status](https://img.shields.io/codeclimate/coverage/github/runar/capistrano-figaro.svg?style=flat-square)](https://codeclimate.com/github/runar/capistrano-figaro/coverage)
|
10
|
+
[![Dependency Status](https://img.shields.io/gemnasium/runar/capistrano-figaro.svg?style=flat-square)](https://gemnasium.com/runar/capistrano-figaro)
|
11
|
+
|
12
|
+
## Installation
|
13
|
+
|
14
|
+
Add the gem to your `Gemfile` and run `bundle install`:
|
15
|
+
|
16
|
+
```ruby
|
17
|
+
group :development do
|
18
|
+
gem 'capistrano-figaro'
|
19
|
+
end
|
20
|
+
```
|
21
|
+
|
22
|
+
Then add the gem to your `Capfile`:
|
23
|
+
|
24
|
+
```ruby
|
25
|
+
require 'capistrano/figaro'
|
26
|
+
```
|
27
|
+
|
28
|
+
## Usage
|
29
|
+
|
30
|
+
There is nothing else you need to do. All your configuration values from
|
31
|
+
`application.yml` will be automatically loaded as environment variables when
|
32
|
+
you invoke a Capistrano task.
|
33
|
+
|
34
|
+
Your configuration values will be available as either `ENV['setting']` or
|
35
|
+
`Figaro.env.setting`:
|
36
|
+
|
37
|
+
```ruby
|
38
|
+
set :some_option, ENV['some_option']
|
39
|
+
set :other_option, Figaro.env.other_option
|
40
|
+
```
|
41
|
+
|
42
|
+
## Configuring
|
43
|
+
|
44
|
+
The default location of the configuration file used by Figaro is
|
45
|
+
`config/application.yml`. You may change this location by setting the
|
46
|
+
`:figaro_path` variable:
|
47
|
+
|
48
|
+
```ruby
|
49
|
+
set :figaro_path, 'path/to/file.yml'
|
50
|
+
```
|
51
|
+
|
52
|
+
## Contributing
|
53
|
+
|
54
|
+
1. Fork it
|
55
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
56
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
57
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
58
|
+
5. Create a new Pull Request
|
59
|
+
|
60
|
+
## License
|
61
|
+
|
62
|
+
The capistrano-figaro plugin is free software released under the MIT License.
|
63
|
+
See [LICENSE](https://github.com/runar/capistrano-figaro/blob/master/LICENSE)
|
64
|
+
for details.
|
data/Rakefile
ADDED
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
1.0.0.0
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'English'
|
2
|
+
|
3
|
+
lib = File.expand_path('../lib', __FILE__)
|
4
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = 'capistrano-figaro'
|
8
|
+
s.version = File.read('VERSION').strip
|
9
|
+
s.summary = 'Capistrano integration with Figaro'
|
10
|
+
s.description = 'Capistrano plugin that integrates with Figaro, loading '\
|
11
|
+
'your configuration for use during deployment.'
|
12
|
+
|
13
|
+
s.authors = ['Runar Skaare Tveiten']
|
14
|
+
s.email = ['runar@tveiten.io']
|
15
|
+
s.homepage = 'https://github.com/runar/capistrano-figaro'
|
16
|
+
s.license = 'MIT'
|
17
|
+
|
18
|
+
s.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
|
19
|
+
s.test_files = s.files.grep(/^test/)
|
20
|
+
s.require_paths = ['lib']
|
21
|
+
|
22
|
+
s.add_dependency 'capistrano', '~> 3.1'
|
23
|
+
s.add_dependency 'figaro', '~> 1.1'
|
24
|
+
|
25
|
+
s.add_development_dependency 'bundler', '~> 1.10'
|
26
|
+
s.add_development_dependency 'codeclimate-test-reporter', '~> 0.4'
|
27
|
+
s.add_development_dependency 'minitest', '~> 5.7'
|
28
|
+
s.add_development_dependency 'rake', '~> 10.4'
|
29
|
+
s.add_development_dependency 'rubocop', '~> 0.32'
|
30
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
foo: bar
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
load File.expand_path('../tasks/figaro.rake', __FILE__)
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'figaro'
|
2
|
+
|
3
|
+
namespace :load do
|
4
|
+
task :defaults do
|
5
|
+
set :figaro_path, -> { 'config/application.yml' }
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
9
|
+
namespace :figaro do
|
10
|
+
task :load do
|
11
|
+
unless File.exist?(fetch(:figaro_path))
|
12
|
+
fail LoadError, 'Configuration file not found!'
|
13
|
+
end
|
14
|
+
|
15
|
+
Figaro.application = Figaro::Application.new(path: fetch(:figaro_path))
|
16
|
+
Figaro.load
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
after 'load:defaults', 'figaro:load'
|
data/test/figaro_test.rb
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
require_relative 'test_helper'
|
2
|
+
|
3
|
+
class FigaroTest < UnitTest
|
4
|
+
def test_that_default_path_is_set
|
5
|
+
assert_equal 'config/application.yml', fetch(:figaro_path)
|
6
|
+
end
|
7
|
+
|
8
|
+
def test_that_figaro_loads_after_defaults
|
9
|
+
Rake::Task['load:defaults'].invoke
|
10
|
+
assert_equal 'bar', ENV['foo']
|
11
|
+
end
|
12
|
+
|
13
|
+
def test_that_configuration_loads_as_env_variable
|
14
|
+
Rake::Task['figaro:load'].execute
|
15
|
+
assert_equal 'bar', ENV['foo']
|
16
|
+
end
|
17
|
+
|
18
|
+
def test_that_configuration_loads_as_figaro_method
|
19
|
+
Rake::Task['figaro:load'].execute
|
20
|
+
assert_equal 'bar', Figaro.env.foo
|
21
|
+
end
|
22
|
+
|
23
|
+
def test_that_non_existent_configuration_file_raises_error
|
24
|
+
set :figaro_path, 'does/not/exist.yml'
|
25
|
+
assert_raises LoadError do
|
26
|
+
Rake::Task['figaro:load'].execute
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
data/test/test_helper.rb
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'codeclimate-test-reporter'
|
2
|
+
CodeClimate::TestReporter.start
|
3
|
+
|
4
|
+
require 'rubygems'
|
5
|
+
require 'rubygems/specification'
|
6
|
+
require 'bundler/setup'
|
7
|
+
require 'capistrano/all'
|
8
|
+
require 'capistrano/figaro'
|
9
|
+
require 'capistrano/setup'
|
10
|
+
require 'minitest/autorun'
|
11
|
+
require 'rake'
|
12
|
+
|
13
|
+
class UnitTest < Minitest::Test
|
14
|
+
def setup
|
15
|
+
set :figaro_path, 'config/application.yml'
|
16
|
+
end
|
17
|
+
|
18
|
+
def teardown
|
19
|
+
ENV['foo'] = nil
|
20
|
+
end
|
21
|
+
end
|
metadata
ADDED
@@ -0,0 +1,163 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: capistrano-figaro
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Runar Skaare Tveiten
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-07-14 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: capistrano
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '3.1'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '3.1'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: figaro
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.1'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.1'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: bundler
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '1.10'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1.10'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: codeclimate-test-reporter
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0.4'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0.4'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: minitest
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '5.7'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '5.7'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rake
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '10.4'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '10.4'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rubocop
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0.32'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0.32'
|
111
|
+
description: Capistrano plugin that integrates with Figaro, loading your configuration
|
112
|
+
for use during deployment.
|
113
|
+
email:
|
114
|
+
- runar@tveiten.io
|
115
|
+
executables: []
|
116
|
+
extensions: []
|
117
|
+
extra_rdoc_files: []
|
118
|
+
files:
|
119
|
+
- ".codeclimate.yml"
|
120
|
+
- ".gitignore"
|
121
|
+
- ".rubocop.yml"
|
122
|
+
- ".travis.yml"
|
123
|
+
- CHANGELOG.md
|
124
|
+
- Gemfile
|
125
|
+
- Gemfile.lock
|
126
|
+
- LICENSE
|
127
|
+
- README.md
|
128
|
+
- Rakefile
|
129
|
+
- VERSION
|
130
|
+
- capistrano-figaro.gemspec
|
131
|
+
- config/application.yml
|
132
|
+
- lib/capistrano-figaro.rb
|
133
|
+
- lib/capistrano/figaro.rb
|
134
|
+
- lib/capistrano/tasks/figaro.rake
|
135
|
+
- test/figaro_test.rb
|
136
|
+
- test/test_helper.rb
|
137
|
+
homepage: https://github.com/runar/capistrano-figaro
|
138
|
+
licenses:
|
139
|
+
- MIT
|
140
|
+
metadata: {}
|
141
|
+
post_install_message:
|
142
|
+
rdoc_options: []
|
143
|
+
require_paths:
|
144
|
+
- lib
|
145
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
146
|
+
requirements:
|
147
|
+
- - ">="
|
148
|
+
- !ruby/object:Gem::Version
|
149
|
+
version: '0'
|
150
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
151
|
+
requirements:
|
152
|
+
- - ">="
|
153
|
+
- !ruby/object:Gem::Version
|
154
|
+
version: '0'
|
155
|
+
requirements: []
|
156
|
+
rubyforge_project:
|
157
|
+
rubygems_version: 2.2.2
|
158
|
+
signing_key:
|
159
|
+
specification_version: 4
|
160
|
+
summary: Capistrano integration with Figaro
|
161
|
+
test_files:
|
162
|
+
- test/figaro_test.rb
|
163
|
+
- test/test_helper.rb
|