config_curator 0.2.1 → 0.2.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9753c5a06c3b4ee8154f677ee19e096c31503646
4
- data.tar.gz: b7b258c1b60446f82a5c8db2731d85ca0573329f
3
+ metadata.gz: 5263cfbd7c7ece8e543723b99bd670e8a7cd614e
4
+ data.tar.gz: 9338e9254ec5cca6f8b3cbf5ac0eb682b69475c8
5
5
  SHA512:
6
- metadata.gz: 129f1da431c6d4afab659dbca31bf5b11523b6e21033d3508b0e3b3c51d7f2528f39d65f4282ac6c3399c7d6037919f9b6988c4078dd08eebf9188724a01f14a
7
- data.tar.gz: efba699dc4727c0bb018ea4cd8afa20d17eb0007a9ae04e5b53a3dbb386943077d1bd6feff16640044b625428296b9a33ae354e3edf7d6b0389d2e5406ef5478
6
+ metadata.gz: c2a92f1df9aab781816fcf7c4e8a6b4e4d4ff1565a2b4d001dfd8ad16596d48f30c1aacb00502779cad4e9f79386f038246304c330253fb8e8075890f50cc2fd
7
+ data.tar.gz: c8020790230fdebadbe86266840bb9b95dbdcbf7af9ecadcc8d723e7bee65788de73467f99af2c4ec3c74cddd4507377c3626d814fcc08c7599082f7c7c7a497
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # ChangeLog
2
2
 
3
+ ## 0.2.2
4
+
5
+ - Copy system links in components when using rsync.
6
+
3
7
  ## 0.2.1
4
8
 
5
9
  - Allow all keys in manifest to be strings or symbols.
data/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2014 Evan Boyd Sosenko
3
+ Copyright (c) 2014-2015 Evan Boyd Sosenko
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy of
6
6
  this software and associated documentation files (the "Software"), to deal in
data/README.md CHANGED
@@ -13,8 +13,194 @@ _Simple and intelligent configuration file management._
13
13
 
14
14
  ## Description
15
15
 
16
+ Config Curator is a flexible configuration and dotfile manager.
17
+ Simply define what to manage in `manifest.yml`,
18
+ then run `curate` to install and update your **configuration units**.
19
+
20
+ Currently, Config Curator supports installing
21
+ directories, files, and symbolic links.
22
+ It also handles setting other properties such as
23
+ permissions and ownership.
24
+ Additionally, configuration units can be installed per-host
25
+ or only if certain packages are installed.
26
+
27
+ Config Curator is written to be extensible:
28
+ each type of configuration unit,
29
+ e.g., file, directory, symbolic link, etc.,
30
+ is actually a subclass of the more generic `Unit` type.
31
+ Other types can be added simply by adding more subclasses.
32
+
33
+ ## Usage
34
+
35
+ ### The `manifest.yml` file
36
+
37
+ The `manifest.yml` file is a YAML file that defines
38
+ the configuration units to install.
39
+
40
+ Each key is either a global setting, `default`,
41
+ or a unit type: `components`, `config_files`, or `symlinks`.
42
+
43
+ #### Settings
44
+
45
+ Optional global Config Curator settings.
46
+ Defaults listed below.
47
+
48
+ ````yaml
49
+ # All units installed relative to the root.
50
+ root: "~/"
51
+
52
+ # Package tool to use.
53
+ # Will automatically detect if not explicitly set.
54
+ # Available tools: pacman, dpkg, pkgng.
55
+ package_tool:
56
+ ````
57
+
58
+ #### `defaults`
59
+
60
+ Optional key that sets the default attribute values for each unit.
61
+
62
+ Any per-unit attribute will override the value here.
63
+
64
+ Any attribute not set here will use
65
+ the Config Curator defined defaults below.
66
+
67
+ ````yaml
68
+ defaults:
69
+ # File and directory permissions.
70
+ # Empty values will not change permissions.
71
+ fmode:
72
+ dmode:
73
+
74
+ # File and directory owner and group.
75
+ # Empty values will not change ownership.
76
+ owner:
77
+ group:
78
+
79
+ # Hosts to install this unit on.
80
+ # Empty array will install on all hosts.
81
+ hosts: []
82
+
83
+ # Only install this unit if packages are present.
84
+ # Empty array will not check for any packages.
85
+ packages: []
86
+ ````
87
+
88
+ #### Units
89
+
90
+ Each unit must have a `src` which defines the source file or directory.
91
+
92
+ You may give a `dst` to override the install location.
93
+ Otherwise the destination will mimic the source path relative to the `root` path.
94
+ This is required for symlinks.
95
+
96
+ You can define an array of `hosts` to control what hostnames the unit will install on.
97
+ Similarly you can give a list of packages that must be present to install the unit.
98
+ You can also use any other attribute in the `defaults` key listed in the previous section.
99
+
100
+ Best to see some examples.
101
+ Note in the examples below how some units are installed from the `bower_components` directory:
102
+ external configuration is thus managed as a Bower dependency and installed using `curate`.
103
+ You can always visit [my dotfiles for a real-world example](https://github.com/razor-x/dotfiles).
104
+
105
+ ##### Components are entire directories
106
+
107
+ Components are installed before other units.
108
+
109
+ The source will be mirrored to the destination.
110
+ **Any existing files in the destination will be lost.**
111
+
112
+ ````yaml
113
+ components:
114
+ - src: .config/terminator
115
+
116
+ - src: bower_components/tmuxinator-profiles
117
+ dst: .tmuxinator
118
+ fmode: 640
119
+ dmode: 0750
120
+ packages: [ tmux ]
121
+ ````
122
+
123
+ ##### Config files are copied individually
124
+
125
+ Files are installed after components.
126
+
127
+ Subdirectories are created as needed.
128
+
129
+ In this example, the files `.tmux.conf` and `.tmux.baz.conf` both exist:
130
+ the first will be installed on hosts `foo` and `bar`,
131
+ while the second will be installed on host `baz`.
132
+
133
+ ````yaml
134
+ config_files:
135
+ - src: .gitconfig
136
+ - src: .bundle/config
137
+
138
+ - src: bower_components/ssh-config/config
139
+ dst: .ssh/config
140
+ fmode: 600
141
+ dmode: 0700
142
+
143
+ - src: .tmux.conf
144
+ hosts: [ foo, bar, baz ]
145
+ ````
146
+
147
+ ##### Symlinks
148
+
149
+ Symlinks create a symbolic link to the `src` at the `dst`.
150
+
151
+ They are installed last.
152
+
153
+ ````yaml
154
+ symlinks:
155
+ - src: ~/Wallpaper/tux.png
156
+ dst: .config/awesome/wall.png
157
+ packages: [ awesome ]
158
+ ````
159
+
160
+ ### The `curate` command
161
+
162
+ Once you have prepared your manifest, simply run
163
+
164
+ ````bash
165
+ $ curate
166
+ ````
167
+
168
+ Or if you prefer more verbose feedback
169
+
170
+ ````bash
171
+ $ curate -v
172
+ ````
173
+
174
+ You can always get help with
175
+
176
+ ```
177
+ $ curate help
178
+
179
+ Commands:
180
+ curate help [COMMAND] # Describe available commands or one specific command
181
+ curate install # Installs all units in collection.
182
+
183
+ Options:
184
+ v, [--verbose], [--no-verbose]
185
+ q, [--quiet], [--no-quiet]
186
+ [--debug], [--no-debug]
187
+ ```
188
+
189
+ ### Scripting
190
+
191
+ Config Curator is fully scriptable for easy inclusion into other Ruby programs.
192
+ The API is well documented for this purpose
193
+ (see [Documentation](#documentation) above).
194
+
16
195
  ## Installation
17
196
 
197
+ You can install the gem either with Bundler or directly.
198
+ Bundler is preferred, however the direct method may be convenient
199
+ when initially bootstrapping a system with an initial configuration.
200
+
201
+ The recommend setup is to check your configuration
202
+ along with `manifest.yml` into version control.
203
+
18
204
  Add this line to your application's Gemfile:
19
205
 
20
206
  ````ruby
@@ -42,14 +228,6 @@ YARD documentation for all gem versions is hosted on the
42
228
  Documentation for the latest commits is hosted on
43
229
  [the RubyDoc.info project page](http://rubydoc.info/github/razor-x/config_curator/frames).
44
230
 
45
- ## Usage
46
-
47
- ### Scripting
48
-
49
- Config Curator is fully scriptable for easy inclusion into other Ruby programs.
50
- The API is well documented for this purpose
51
- (see [Documentation](#documentation) above).
52
-
53
231
  ## Development and Testing
54
232
 
55
233
  ### Source Code
@@ -36,7 +36,7 @@ module ConfigCurator
36
36
  def install_component
37
37
  if command? 'rsync'
38
38
  FileUtils.mkdir_p destination_path
39
- cmd = [command?('rsync'), '-rt', '--del', "#{source_path}/", destination_path]
39
+ cmd = [command?('rsync'), '-rt', '--del', '--links', "#{source_path}/", destination_path]
40
40
  logger.debug { "Running command: #{cmd.join ' '}" }
41
41
  system(*cmd)
42
42
  else
@@ -1,5 +1,5 @@
1
1
  # Simple and intelligent configuration file management.
2
2
  module ConfigCurator
3
3
  # Config Curator version.
4
- VERSION = '0.2.1'
4
+ VERSION = '0.2.2'
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.2.1
4
+ version: 0.2.2
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-02-14 00:00:00.000000000 Z
11
+ date: 2015-04-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport