promotion 1.2.0 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +7 -2
- data/README +4 -1
- data/lib/promotion/generator.rb +3 -7
- metadata +6 -8
data/CHANGELOG
CHANGED
@@ -1,9 +1,14 @@
|
|
1
|
+
== Version 1.2.1
|
2
|
+
- Added Clear attribute to Folder.
|
3
|
+
- Fixed crontab generation. crontabs are generated completely - prior
|
4
|
+
contents is not preserved (due to the nature of crontabs)
|
5
|
+
|
1
6
|
== Version 1.2.0
|
2
7
|
- Make Promotion a better gem citizen by making the installation of executables
|
3
|
-
an explicit command, as shown in the post-installation message.
|
8
|
+
an explicit command, as shown in the post-installation message.
|
4
9
|
|
5
10
|
=== Version 1.1.0
|
6
|
-
- Added dependency on log4r.
|
11
|
+
- Added dependency on log4r.
|
7
12
|
- Fixed several broken dependencies caused by converting to a gem.
|
8
13
|
|
9
14
|
=== Version 1.0.9
|
data/README
CHANGED
@@ -174,7 +174,7 @@ Before we can move files into place, we need the Folders set up:
|
|
174
174
|
<Folders Mode="0750" Owner="root" Group="wheel">
|
175
175
|
<Folder Owner="_mysql" Group="_mysql">/var/mysql</Folder>
|
176
176
|
<Folder>/home/myapp</Folder>
|
177
|
-
<Folder>/var/myapp</Folder>
|
177
|
+
<Folder Clear="true">/var/myapp</Folder>
|
178
178
|
</Folders>
|
179
179
|
You can have several +Folders+ elements, if desired. The defaults for all +Folder+
|
180
180
|
child elements may be set as attributes of the parent +Folders+ element. In this example,
|
@@ -182,6 +182,9 @@ all the folders will have permissions <code>rwxr-x---</code>, and ownership of <
|
|
182
182
|
Note that the folder <code>/var/mysql</code> has a different owner and group. Any Folder can
|
183
183
|
override the default Mode, Owner, and Group.
|
184
184
|
|
185
|
+
The optional +Clear+ attribute will clear the contents of the folder (actually it completely
|
186
|
+
removes the folder and recreates it). This happens before files are copied to it of course.
|
187
|
+
|
185
188
|
=== +Files+
|
186
189
|
Finally we can specify how to move the files into place:
|
187
190
|
<Files Owner="root" Group="wheel" Mode="0644" Source="conf">
|
data/lib/promotion/generator.rb
CHANGED
@@ -175,16 +175,12 @@ class Generator
|
|
175
175
|
schedules.each { |user, crontablist|
|
176
176
|
generatedContents = generator.result(binding)
|
177
177
|
userCrontab = File.expand_path(user, Folders::Crontabs)
|
178
|
-
begin
|
179
|
-
originalContents = IO.readlines(userCrontab,"")[0].split(@marker)[0]
|
180
|
-
rescue
|
181
|
-
originalContents = ""
|
182
|
-
end
|
183
|
-
newContents = [originalContents, @marker, generatedContents].join("\n")
|
184
178
|
begin
|
185
179
|
tempFilename = user + ".tmp"
|
186
180
|
tempFile = File.new(tempFilename, File::WRONLY | File::CREAT | File::TRUNC)
|
187
|
-
tempFile.puts(
|
181
|
+
tempFile.puts(generatedContents)
|
182
|
+
# previous cron jobs are *NOT* preserved - the tab is competely generated!
|
183
|
+
# otherwise we'll double the crontab each time we run.
|
188
184
|
ensure
|
189
185
|
tempFile.close unless tempFile.nil? || tempFile.closed?
|
190
186
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: promotion
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 29
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 1.2.
|
9
|
+
- 1
|
10
|
+
version: 1.2.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Richard Kernahan
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-09-
|
18
|
+
date: 2012-09-25 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: log4r
|
@@ -76,10 +76,8 @@ files:
|
|
76
76
|
homepage: http://rubygems.org/gems/promotion
|
77
77
|
licenses: []
|
78
78
|
|
79
|
-
post_install_message: "\n\
|
80
|
-
\t
|
81
|
-
\t$ sudo ruby -rubygems -e \"require 'promotion/install'\"\n\
|
82
|
-
\t\n "
|
79
|
+
post_install_message: "\n\n To install the executables (promote, evolve, devolve, mkdeploy)\n issue the following command:\n\
|
80
|
+
\t$ sudo ruby -rubygems -e \"require 'promotion/install'\"\n\n "
|
83
81
|
rdoc_options:
|
84
82
|
- --title
|
85
83
|
- Promotion
|