config_curator 0.3.0 → 0.4.0

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: 60147ff36c757ecf906de200cfee1119dc440f33
4
- data.tar.gz: fee2526348a940b0c24868f3cbb70c0a5ff52179
3
+ metadata.gz: 2511894af0fcc9e59c648a7621496f663853dded
4
+ data.tar.gz: b119e02051dc69e31be6c8b6b2d31a3e5c64aaa3
5
5
  SHA512:
6
- metadata.gz: e38e6a073ea040e258bddcd6d768e1c874dc13487cbc0f8fef0d1d0c46c32e6eacc3fe8c4d55900ff2aca8a1ce74b7f9bf14f749a6461bd6218dfcc8f9af0ad2
7
- data.tar.gz: d7b8d47e299d248d4d9e29e6e693a9ee04920ae9482036eb614f6811ec7791d5a8b1b5a542a7c4d650a4fafa176d8b76b1e4cf0fdeb545ff559a915b2f972dc6
6
+ metadata.gz: f26f480a7fb7a41eac2d84482ed5d1cc8551db0808fcb52f0b0f4c6121fc9fe2ed7abe2628a4df454dd0ff2621bf16c2d9047cb44df2f3ea2ff666f921dc9167
7
+ data.tar.gz: 7ee456743ea8d74726b8311896ee375c5392e6ccdb5570bf963f31414693f871b8bab6f5ca1d10a439d0735b7cb5a5a40898de4513e792c05cec646e81f0f899
@@ -1,5 +1,9 @@
1
1
  # ChangeLog
2
2
 
3
+ ## 0.4.0
4
+
5
+ - Add `backend` option for components.
6
+
3
7
  ## 0.3.0
4
8
 
5
9
  - Force rsync to use checksums when installing components.
data/README.md CHANGED
@@ -101,6 +101,12 @@ defaults:
101
101
  # Only install this unit if packages are present.
102
102
  # Empty array will not check for any packages.
103
103
  packages: []
104
+
105
+ # Default backend to use for filesystem operations.
106
+ # Only affects components.
107
+ # Choices: :stdlib or :rsync.
108
+ # Empty will autoselect rsync if available and fallback to stdlib otherwise.
109
+ backend:
104
110
  ```
105
111
 
106
112
  #### Units
@@ -16,7 +16,7 @@ module ConfigCurator
16
16
  # such as {Unit#source} and {Unit#destination}.
17
17
  UNIT_ATTRIBUTES = {
18
18
  unit: %i(hosts packages),
19
- component: %i(hosts packages fmode dmode owner group),
19
+ component: %i(hosts packages fmode dmode owner group backend),
20
20
  config_file: %i(hosts packages fmode owner group),
21
21
  symlink: %i(hosts packages)
22
22
  }
@@ -139,7 +139,7 @@ module ConfigCurator
139
139
  def install_unit(unit, type, quiet = false)
140
140
  success = unit.install
141
141
  logger.info do
142
- "Installed #{type_name(type)}: #{unit.source} #{unit.destination_path}"
142
+ "Installed #{type_name(type)}: #{unit.source} => #{unit.destination_path}"
143
143
  end unless quiet || !success
144
144
  return true
145
145
 
@@ -157,7 +157,7 @@ module ConfigCurator
157
157
  unit.install?
158
158
  logger.info do
159
159
  "Testing install for #{type_name(type)}:" \
160
- " #{unit.source} #{unit.destination_path}"
160
+ " #{unit.source} => #{unit.destination_path}"
161
161
  end unless quiet
162
162
  return true
163
163
 
@@ -6,7 +6,7 @@ module ConfigCurator
6
6
  # The contents of the {#destination_path} is
7
7
  # completely replaced by the contents of the {#source_path}.
8
8
  class Component < Unit
9
- attr_accessor :fmode, :dmode, :owner, :group
9
+ attr_accessor :fmode, :dmode, :owner, :group, :backend
10
10
 
11
11
  # (see Unit#uninstall)
12
12
  def uninstall(*args)
@@ -47,7 +47,7 @@ module ConfigCurator
47
47
  # Any files in the install directory not in the source directory are removed.
48
48
  # Use rsync if available.
49
49
  def install_component
50
- if command? 'rsync'
50
+ if (backend != :stdlib && command?('rsync')) || backend == :rsync
51
51
  FileUtils.mkdir_p destination_path
52
52
  cmd = [command?('rsync'), '-rtc', '--del', '--links', "#{source_path}/", destination_path]
53
53
  logger.debug { "Running command: #{cmd.join ' '}" }
@@ -1,5 +1,5 @@
1
1
  # Simple and intelligent configuration file management.
2
2
  module ConfigCurator
3
3
  # Config Curator version.
4
- VERSION = '0.3.0'
4
+ VERSION = '0.4.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: config_curator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evan Boyd Sosenko
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-23 00:00:00.000000000 Z
11
+ date: 2015-09-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -324,7 +324,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
324
324
  version: '0'
325
325
  requirements: []
326
326
  rubyforge_project:
327
- rubygems_version: 2.4.5
327
+ rubygems_version: 2.4.5.1
328
328
  signing_key:
329
329
  specification_version: 4
330
330
  summary: Simple and intelligent configuration file management.