config_for 0.3.0 → 0.3.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/CHANGELOG.md +6 -1
- data/lib/config_for/capistrano.rb +10 -5
- data/lib/config_for/version.rb +1 -1
- 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: 47203d1d3914bd8c5ce03b7f182630c3e21f989e
|
4
|
+
data.tar.gz: 47169353397cc1d1165e6b8480b2715d7702c36a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e0ecae59e81e4db5aba5123baea6256b8f8ffbff6c58cd50e49b9f74a1a98528f79c1e7fa3ee61215c984e2c8cefec536bb48fec2710ed4054289621db98eea9
|
7
|
+
data.tar.gz: 833606e004f20015f53531b22f00c1d06c46677a4945e586aa874b9f5aed102d36b72c96ba15df384b38735a43c28dfff887ff2f39c12057d86fee8175382857
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,11 @@ All notable changes to this project will be documented in this file.
|
|
3
3
|
|
4
4
|
## master - unreleased
|
5
5
|
### Changed
|
6
|
+
### Added
|
7
|
+
|
8
|
+
## 0.3.1 - 2016-12-09
|
9
|
+
### Added
|
10
|
+
- `:override` option to `ConfigFor::Capistrano::Task` to upload file every time
|
6
11
|
|
7
12
|
## 0.3.0 - 2016-11-09
|
8
13
|
### Changed
|
@@ -20,7 +25,7 @@ All notable changes to this project will be documented in this file.
|
|
20
25
|
|
21
26
|
### Changed
|
22
27
|
- Passing a Symbol as env works
|
23
|
-
- Loads
|
28
|
+
- Loads indifferent\_access core extension
|
24
29
|
|
25
30
|
## 0.1.0 - 2014-10-03
|
26
31
|
|
@@ -25,10 +25,12 @@ module ConfigFor
|
|
25
25
|
# @param [Pathname, String] path the path of the file to be uploaded
|
26
26
|
# @param [Hash] options the options
|
27
27
|
# @option options [Array<Symbol>,Symbol] :roles (:all) the roles of servers to apply to
|
28
|
+
# @option options [true,false] :override (false) upload file on every run
|
28
29
|
# @yieldparam [Tempfile] file yields the tempfile so you generate the file to be uploaded
|
29
30
|
def initialize(path, options = {}, &block)
|
30
31
|
@path = path
|
31
32
|
@roles = options.fetch(:roles, :all)
|
33
|
+
@override = options.fetch(:override, false)
|
32
34
|
@tempfile = ::Tempfile.new(File.basename(@path))
|
33
35
|
@generator = block || ->(_file){ puts 'Did not passed file generator' }
|
34
36
|
|
@@ -41,7 +43,7 @@ module ConfigFor
|
|
41
43
|
|
42
44
|
def define
|
43
45
|
desc "Upload file to #{path}"
|
44
|
-
remote_file(path => @tempfile.path, roles: @roles)
|
46
|
+
remote_file(path => @tempfile.path, roles: @roles, override: @override)
|
45
47
|
desc "Generate file #{@path} to temporary location"
|
46
48
|
|
47
49
|
generate_file(@tempfile.path, &method(:generate))
|
@@ -65,13 +67,14 @@ module ConfigFor
|
|
65
67
|
|
66
68
|
def remote_file(task)
|
67
69
|
target_roles = task.delete(:roles)
|
70
|
+
override = task.delete(:override)
|
68
71
|
|
69
72
|
UploadTask.define_task(task) do |t|
|
70
73
|
prerequisite_file = t.prerequisites.first
|
71
74
|
file = shared_path.join(t.name).to_s.shellescape
|
72
75
|
|
73
76
|
on roles(target_roles) do
|
74
|
-
|
77
|
+
if override || !test("[ -f #{file} ]")
|
75
78
|
info "Uploading #{prerequisite_file} to #{file}"
|
76
79
|
upload! File.open(prerequisite_file), file
|
77
80
|
end
|
@@ -104,17 +107,19 @@ module ConfigFor
|
|
104
107
|
# Generates new tasks with for uploading #name
|
105
108
|
# @param [String, Symbol] name name of this tasks and subtasks
|
106
109
|
# @param &block gets evaluated before defining the tasks
|
110
|
+
# @option options [true,false] :override (false) upload file on every run
|
107
111
|
# @yieldparam [Task] task the task itself so you can modify it before it gets defined
|
108
|
-
def initialize(name, &block)
|
112
|
+
def initialize(name, options = {}, &block)
|
109
113
|
@name = name
|
110
114
|
@folder = 'config'
|
111
115
|
@file = "#{name}.yml"
|
112
116
|
@variable = "#{name}_yml".to_sym
|
113
|
-
@roles = :all
|
117
|
+
@roles = options.fetch(:roles, :all)
|
118
|
+
@override = options.fetch(:override, false)
|
114
119
|
|
115
120
|
yield(self) if block_given?
|
116
121
|
|
117
|
-
@config = ConfigFor::Capistrano::UploadFileTask.new(path, roles: @roles, &method(:generate))
|
122
|
+
@config = ConfigFor::Capistrano::UploadFileTask.new(path, roles: @roles, override: @override, &method(:generate))
|
118
123
|
|
119
124
|
desc "Generate #{name} uploader" unless ::Rake.application.last_description
|
120
125
|
define
|
data/lib/config_for/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: config_for
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michal Cichra
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-12-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|