ratch 0.3.0 → 0.4.0
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.
- data/{log/history → CHANGES} +0 -0
- data/{log/todo → TODO} +0 -0
- data/bin/manifest +451 -0
- data/bin/ratch +3 -3
- data/demo/task/config.yaml +4 -0
- data/lib/ratch/{batch/argvutils.rb → dsl/argv.rb} +9 -4
- data/lib/ratch/dsl/batch.rb +226 -0
- data/lib/ratch/{batch → dsl}/build.rb +83 -4
- data/lib/ratch/{batch/consoleutils.rb → dsl/console.rb} +13 -5
- data/lib/ratch/{batch/emailutils.rb → dsl/email.rb} +21 -25
- data/lib/ratch/{batch/fileutils.rb → dsl/file.rb} +56 -56
- data/lib/ratch/dsl/meta.rb +132 -0
- data/lib/ratch/{batch → dsl}/options.rb +7 -5
- data/lib/ratch/dsl/setup.rb +124 -0
- data/lib/ratch/{support/signiture.rb → dsl/sign.rb} +9 -18
- data/lib/ratch/dsl/stage.rb +147 -0
- data/lib/ratch/dsl/task.rb +139 -0
- data/lib/ratch/{uploadutils.rb → dsl/upload.rb} +7 -5
- data/lib/ratch/{batch/task.rb → dsl/zip.rb} +30 -14
- data/lib/ratch/dsl.rb +52 -0
- data/lib/ratch/extra/email.rb +5 -0
- data/lib/ratch/extra/stage.rb +5 -0
- data/lib/ratch/extra/zip.rb +5 -0
- data/lib/ratch/manifest.rb +540 -0
- data/lib/ratch/{project → metadata}/information.rb +1 -0
- data/lib/ratch/{project → metadata}/package.rb +28 -2
- data/lib/ratch/{project → metadata}/project.rb +8 -16
- data/lib/ratch/{project → metadata}/release.rb +6 -6
- data/lib/ratch/support/errors.rb +4 -0
- data/lib/ratch/support/filename.rb +18 -0
- data/lib/ratch/toolset/ruby/compile +49 -0
- data/lib/ratch/toolset/ruby/pack/gem +26 -18
- data/lib/ratch/toolset/ruby/pack/tgz +25 -64
- data/lib/ratch/toolset/ruby/pack/zip +46 -0
- data/lib/ratch/toolset/ruby/publish +23 -24
- data/lib/ratch/toolset/ruby/release +8 -0
- data/lib/ratch/toolset/ruby/stamp +33 -0
- data/lib/ratch/toolset/sandbox +11 -0
- data/meta/MANIFEST +101 -23
- data/meta/ROLLRC +1 -1
- data/meta/config.yaml +10 -0
- data/meta/icli.yaml +2 -2
- data/meta/project.yaml +9 -10
- data/meta/xProjectInfo +41 -0
- data/task/release +1 -4
- metadata +82 -156
- data/demo/task/rdoc +0 -88
- data/demo/task/rdoc-old +0 -182
- data/doc/images/clipboard.jpg +0 -0
- data/doc/images/clipboard2.png +0 -0
- data/doc/images/milles-tn.jpg +0 -0
- data/doc/images/mints.png +0 -0
- data/doc/images/ratch2.png +0 -0
- data/doc/images/ruby-sm.png +0 -0
- data/doc/images/silver.gif +0 -0
- data/doc/images/toolbox.jpg +0 -0
- data/doc/index.html +0 -181
- data/doc/notes/original.rb +0 -308
- data/doc/rdoc/classes/Array.html +0 -194
- data/doc/rdoc/classes/Dir.html +0 -317
- data/doc/rdoc/classes/Hash.html +0 -217
- data/doc/rdoc/classes/Ratch/ArgvUtils/Ext.html +0 -285
- data/doc/rdoc/classes/Ratch/ArgvUtils.html +0 -173
- data/doc/rdoc/classes/Ratch/BatchFile.html +0 -207
- data/doc/rdoc/classes/Ratch/BatchManager.html +0 -250
- data/doc/rdoc/classes/Ratch/BatchScript.html +0 -127
- data/doc/rdoc/classes/Ratch/Batchable.html +0 -373
- data/doc/rdoc/classes/Ratch/Build.html +0 -321
- data/doc/rdoc/classes/Ratch/BuildManager.html +0 -319
- data/doc/rdoc/classes/Ratch/Buildable.html +0 -202
- data/doc/rdoc/classes/Ratch/ConfigUtils.html +0 -281
- data/doc/rdoc/classes/Ratch/ConsoleUtils.html +0 -189
- data/doc/rdoc/classes/Ratch/EmailUtils.html +0 -209
- data/doc/rdoc/classes/Ratch/FileUtils.html +0 -674
- data/doc/rdoc/classes/Ratch/GeneralOptions.html +0 -430
- data/doc/rdoc/classes/Ratch/Task.html +0 -201
- data/doc/rdoc/classes/Ratch/TaskManager.html +0 -330
- data/doc/rdoc/classes/Ratch/Taskable.html +0 -231
- data/doc/rdoc/classes/Ratch/UploadUtils.html +0 -566
- data/doc/rdoc/classes/Ratch.html +0 -201
- data/doc/rdoc/created.rid +0 -1
- data/doc/rdoc/files/COPYING.html +0 -1003
- data/doc/rdoc/files/README.html +0 -143
- data/doc/rdoc/files/lib/ratch/argvutils_rb.html +0 -131
- data/doc/rdoc/files/lib/ratch/batch_rb.html +0 -155
- data/doc/rdoc/files/lib/ratch/batchable_rb.html +0 -131
- data/doc/rdoc/files/lib/ratch/batchfile_rb.html +0 -148
- data/doc/rdoc/files/lib/ratch/buildable_rb.html +0 -131
- data/doc/rdoc/files/lib/ratch/consoleutils_rb.html +0 -131
- data/doc/rdoc/files/lib/ratch/emailutils_rb.html +0 -139
- data/doc/rdoc/files/lib/ratch/facets/multiglob_rb.html +0 -137
- data/doc/rdoc/files/lib/ratch/fileutils_rb.html +0 -139
- data/doc/rdoc/files/lib/ratch/options_rb.html +0 -131
- data/doc/rdoc/files/lib/ratch/taskable_rb.html +0 -131
- data/doc/rdoc/files/lib/ratch/uploadutils_rb.html +0 -150
- data/doc/rdoc/fr_class_index.html +0 -48
- data/doc/rdoc/fr_file_index.html +0 -41
- data/doc/rdoc/fr_method_index.html +0 -133
- data/doc/rdoc/index.html +0 -24
- data/doc/rdoc/rdoc-style.css +0 -208
- data/doc/scrap/flexihead-flip.jpg +0 -0
- data/doc/scrap/flexihead.jpg +0 -0
- data/doc/scrap/head1.jpg +0 -0
- data/doc/scrap/ratch.jpg +0 -0
- data/doc/scrap/ratch1.png +0 -0
- data/doc/scrap/ratch2.jpg +0 -0
- data/doc/scrap/ratch3.png +0 -0
- data/doc/scrap/red-ratch.jpg +0 -0
- data/doc/scrap/redratchet.jpg +0 -0
- data/doc/scrap/ruby-kit/ruby.png +0 -0
- data/doc/scrap/scrap.red +0 -256
- data/doc/sitemap.yaml +0 -10
- data/doc/siteparts/index.red +0 -100
- data/doc/siteparts/layout.rhtml +0 -56
- data/doc/siteparts/tutorial.red +0 -578
- data/doc/style.css +0 -112
- data/doc/tutorial.html +0 -722
- data/lib/ratch/batch.rb +0 -488
- data/lib/ratch/support/setuputils.rb +0 -124
- data/lib/ratch/support/stage.rb +0 -292
- data/lib/ratch/toolset/ruby/rdoc +0 -88
- data/task/rdoc +0 -6
- data/work/old/batchfile.rb +0 -95
- data/work/project-old.rb +0 -67
- data/work/scrap/install +0 -89
- data/work/scrap/install.0 +0 -49
- data/work/scrap/install.1 +0 -63
- data/work/scrap/ludo +0 -25
- data/work/scrap/oldtaskable.rb +0 -573
- data/work/scrap/ratch.man +0 -39
- data/work/scrap/taskable-simple.rb +0 -42
- data/work/scrap/taskable.rb +0 -120
@@ -21,8 +21,8 @@
|
|
21
21
|
# You should have received a copy of the GNU General Public License
|
22
22
|
# along with Ratch. If not, see <http://www.gnu.org/licenses/>.
|
23
23
|
|
24
|
-
require 'ratch/
|
25
|
-
require 'ratch/
|
24
|
+
require 'ratch/metadata/project'
|
25
|
+
require 'ratch/metadata/release'
|
26
26
|
|
27
27
|
|
28
28
|
module Ratch
|
@@ -42,6 +42,9 @@ module Ratch
|
|
42
42
|
package
|
43
43
|
end
|
44
44
|
|
45
|
+
# Overrides Project#name.
|
46
|
+
# TODO: Is this what we want ?
|
47
|
+
|
45
48
|
def name
|
46
49
|
@name ||= release.name
|
47
50
|
end
|
@@ -71,6 +74,29 @@ module Ratch
|
|
71
74
|
end
|
72
75
|
end
|
73
76
|
|
77
|
+
# Package name is generally in the form of +name-version+, or
|
78
|
+
# +name-version-platform+ if +platform+ is specified.
|
79
|
+
#
|
80
|
+
# Template can be used to modify the name via sprintf. The defaults
|
81
|
+
# is "%s-%s" for name-version or "%s-%s-%s for name-version-platform.
|
82
|
+
|
83
|
+
def package_name(template=nil)
|
84
|
+
unless template
|
85
|
+
template = platform ? "%s-%s-%s" : "%s-%s"
|
86
|
+
end
|
87
|
+
|
88
|
+
if buildno # TODO Make this better.
|
89
|
+
buildno = Time.now.strftime("%H*60+%M")
|
90
|
+
versnum = "#{version}.#{buildno}"
|
91
|
+
else
|
92
|
+
versnum = version
|
93
|
+
end
|
94
|
+
|
95
|
+
template % [ name, versnum, platform ]
|
96
|
+
end
|
97
|
+
|
98
|
+
alias_method :stage_name, :package_name
|
99
|
+
|
74
100
|
#
|
75
101
|
|
76
102
|
#validate "release isnt valid" do
|
@@ -22,7 +22,7 @@
|
|
22
22
|
# along with Ratch. If not, see <http://www.gnu.org/licenses/>.
|
23
23
|
|
24
24
|
require 'facets/filelist'
|
25
|
-
require 'ratch/
|
25
|
+
require 'ratch/metadata/information'
|
26
26
|
|
27
27
|
|
28
28
|
module Ratch
|
@@ -91,7 +91,13 @@ module Ratch
|
|
91
91
|
|
92
92
|
# Brief one-line description of the package (Max 80 chars.)
|
93
93
|
attr_accessor :summary, :brief do
|
94
|
-
@summary
|
94
|
+
if @summary
|
95
|
+
@summary.to_s[0..79]
|
96
|
+
else
|
97
|
+
i = @description.index('.') || 79
|
98
|
+
i = 79 if i > 79
|
99
|
+
@description[0..i]
|
100
|
+
end
|
95
101
|
end
|
96
102
|
|
97
103
|
# More detailed description of the package.
|
@@ -407,20 +413,6 @@ module Ratch
|
|
407
413
|
# Generate documentation on installation?
|
408
414
|
attr_accessor :document
|
409
415
|
|
410
|
-
# Package name is in the form of +name-version+, or
|
411
|
-
# +name-version-arch+ if +arch+ is not 'any', 'all' or nil.
|
412
|
-
#
|
413
|
-
# TODO Not sure how this can work actually. What about
|
414
|
-
# multiple architectures?
|
415
|
-
def package_name
|
416
|
-
case platform
|
417
|
-
when 'any', 'all', nil
|
418
|
-
"#{package}-#{version}"
|
419
|
-
else
|
420
|
-
"#{package}-#{version}-#{platform}"
|
421
|
-
end
|
422
|
-
end
|
423
|
-
|
424
416
|
|
425
417
|
# Distribution
|
426
418
|
#------------------------------------------------------------------------
|
@@ -21,7 +21,7 @@
|
|
21
21
|
# You should have received a copy of the GNU General Public License
|
22
22
|
# along with Ratch. If not, see <http://www.gnu.org/licenses/>.
|
23
23
|
|
24
|
-
require 'ratch/
|
24
|
+
require 'ratch/metadata/information'
|
25
25
|
|
26
26
|
module Ratch
|
27
27
|
|
@@ -69,7 +69,7 @@ module Ratch
|
|
69
69
|
|
70
70
|
#
|
71
71
|
|
72
|
-
ROLLRC_FILE = '{.,meta/}{roll}{rc,}'
|
72
|
+
ROLLRC_FILE = '{.,meta/}{roll}{.rc,rc,}'
|
73
73
|
|
74
74
|
# Load release information.
|
75
75
|
|
@@ -95,15 +95,15 @@ module Ratch
|
|
95
95
|
str = io.to_s
|
96
96
|
end
|
97
97
|
|
98
|
-
|
98
|
+
stamp, *libpath = str.strip.split(/\n/)
|
99
99
|
|
100
|
-
name, version, status, date, *null = *
|
100
|
+
name, version, status, date, *null = *stamp.split(/\s+/)
|
101
101
|
|
102
102
|
{ :name => name,
|
103
103
|
:version => version,
|
104
104
|
:status => status,
|
105
|
-
:date => date
|
106
|
-
|
105
|
+
:date => date,
|
106
|
+
:libpath => libpath
|
107
107
|
}
|
108
108
|
end
|
109
109
|
|
@@ -0,0 +1,18 @@
|
|
1
|
+
class String
|
2
|
+
|
3
|
+
# Find actual filename (casefolding) and returns it.
|
4
|
+
# Returns nil if no file is found.
|
5
|
+
|
6
|
+
def to_actual_filename
|
7
|
+
Dir.glob(self, File::FNM_CASEFOLD).first
|
8
|
+
end
|
9
|
+
|
10
|
+
# Find actual filename (casefolding) and replace string with it.
|
11
|
+
# If file not found, string remains the same and method returns nil.
|
12
|
+
|
13
|
+
def to_actual_filename!
|
14
|
+
filename = to_actual_filename
|
15
|
+
replace(filename) if filename
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
#!/usr/bin/env ratch
|
2
|
+
|
3
|
+
# compile extensions
|
4
|
+
|
5
|
+
main :compile => [ :make_config ] do
|
6
|
+
extension_directories.each do |directory|
|
7
|
+
build File.join(directory, 'Makefile')
|
8
|
+
cd(directory) do
|
9
|
+
make
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
# Setup Makefile builds
|
15
|
+
|
16
|
+
task :make_config do
|
17
|
+
extension_directories.each do |directory|
|
18
|
+
file File.join(directory, 'Makefile') do
|
19
|
+
cd(directory) do
|
20
|
+
ruby "extconf.rb"
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
#
|
27
|
+
|
28
|
+
def extension_directories
|
29
|
+
glob('ext/**/extconf.rb').map do |ext|
|
30
|
+
File.dirname(ext)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
|
35
|
+
|
36
|
+
|
37
|
+
# Eric Hodel said NOT to copy the compiled libs.
|
38
|
+
#
|
39
|
+
#task :copy_files do
|
40
|
+
# cp "ext/**/*.#{dlext}", "lib/**/#{arch}/"
|
41
|
+
#end
|
42
|
+
#
|
43
|
+
#def dlext
|
44
|
+
# Config::CONFIG['DLEXT']
|
45
|
+
#end
|
46
|
+
#
|
47
|
+
#def arch
|
48
|
+
# Config::CONFIG['arch']
|
49
|
+
#end
|
@@ -2,6 +2,8 @@
|
|
2
2
|
|
3
3
|
# generate gem package
|
4
4
|
|
5
|
+
# TODO: Should this use staging too, like zip/tgz?
|
6
|
+
|
5
7
|
begin
|
6
8
|
require 'rubygems/specification'
|
7
9
|
Gem::manage_gems
|
@@ -9,29 +11,43 @@ rescue LoadError
|
|
9
11
|
raise LoadError, "RubyGems is not installed?"
|
10
12
|
end
|
11
13
|
|
12
|
-
|
13
|
-
|
14
|
-
#
|
14
|
+
# Create a Gem package.
|
15
15
|
|
16
16
|
main 'pack/gem' do
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
17
|
+
status "Creating .gem package"
|
18
|
+
|
19
|
+
config = configuration['pack'] || {}
|
20
|
+
config = config['gem'] || {}
|
21
|
+
|
22
|
+
package = package().clone
|
23
|
+
package.update(config)
|
24
|
+
|
25
|
+
store = config[:store] || 'pkg'
|
26
|
+
|
27
|
+
#dir = Dir.pwd
|
28
|
+
|
22
29
|
file = nil
|
23
|
-
#cd(
|
30
|
+
#cd(dir) do
|
24
31
|
#status "vi #{metadata.name}.gemspec"
|
25
32
|
builder = ::Gem::Builder.new(gemspec(package))
|
26
|
-
|
33
|
+
status "gem build #{package.name}"
|
27
34
|
unless dryrun?
|
28
35
|
file = builder.build
|
29
36
|
file = File.expand_path(file)
|
30
37
|
end
|
31
38
|
#end
|
39
|
+
|
32
40
|
transfer(file, store)
|
33
41
|
end
|
34
42
|
|
43
|
+
# Transfer package file to storage location.
|
44
|
+
|
45
|
+
def transfer(file, store)
|
46
|
+
dest = File.join(store, File.basename(file)) # move to store, unless already there
|
47
|
+
dest = File.expand_path(dest)
|
48
|
+
mv(file, store) unless file == dest
|
49
|
+
end
|
50
|
+
|
35
51
|
# Create Gem::Specification.
|
36
52
|
|
37
53
|
def gemspec(package)
|
@@ -75,11 +91,3 @@ def gemspec(package)
|
|
75
91
|
spec.test_files = distribute.select{ |f| f =~ /^test\// } # TODO make test_files configurable
|
76
92
|
end
|
77
93
|
end
|
78
|
-
|
79
|
-
# Transfer package file to storage location.
|
80
|
-
|
81
|
-
def transfer(file, store)
|
82
|
-
dest = File.join(store, File.basename(file)) # move to store, unless already there
|
83
|
-
dest = File.expand_path(dest)
|
84
|
-
mv(file, store) unless file == dest
|
85
|
-
end
|
@@ -1,85 +1,46 @@
|
|
1
1
|
#!/usr/bin/env ratch
|
2
2
|
|
3
|
-
# generate
|
3
|
+
# generate tar gzip package
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
Gem::manage_gems
|
8
|
-
rescue LoadError
|
9
|
-
raise LoadError, "RubyGems is not installed?"
|
10
|
-
end
|
11
|
-
|
12
|
-
require 'ratch/project/package'
|
13
|
-
|
14
|
-
#
|
5
|
+
require 'ratch/extra/stage'
|
6
|
+
require 'ratch/extra/zip'
|
15
7
|
|
16
|
-
|
17
|
-
# load config (TODO)
|
18
|
-
#source = Dir.pwd
|
19
|
-
store = 'pkg'
|
20
|
-
package = Ratch::Package.load
|
21
|
-
#status "Creating RubyGem(s)"
|
22
|
-
file = nil
|
23
|
-
#cd(source) do
|
24
|
-
#status "vi #{metadata.name}.gemspec"
|
25
|
-
builder = ::Gem::Builder.new(gemspec(package))
|
26
|
-
#status "gem build #{package.name}"
|
27
|
-
unless dryrun?
|
28
|
-
file = builder.build
|
29
|
-
file = File.expand_path(file)
|
30
|
-
end
|
31
|
-
#end
|
32
|
-
transfer(file, store)
|
33
|
-
end
|
8
|
+
# Create a Tar'd Gzip package.
|
34
9
|
|
35
|
-
|
10
|
+
main 'pack/tgz' do
|
11
|
+
status "Creating .tgz package"
|
36
12
|
|
37
|
-
|
38
|
-
|
39
|
-
#distribute = Dir.multiglob_with_default( '**/*', distribute )
|
13
|
+
config = configuration['pack'] || {}
|
14
|
+
config = config['tgz'] || {}
|
40
15
|
|
41
|
-
|
42
|
-
|
43
|
-
spec.version = package.version
|
44
|
-
spec.summary = package.brief
|
45
|
-
spec.description = package.description
|
46
|
-
spec.author = package.author
|
47
|
-
spec.email = package.email
|
48
|
-
spec.rubyforge_project = package.development if /rubyforge.org/ =~ package.development
|
49
|
-
spec.homepage = package.homepage
|
16
|
+
package = package.clone
|
17
|
+
package.update(config)
|
50
18
|
|
51
|
-
|
52
|
-
|
19
|
+
store = config[:store] || 'pkg'
|
20
|
+
templ = config[:template]
|
53
21
|
|
54
|
-
|
22
|
+
name = package.stage_name(templ)
|
23
|
+
stage = File.join(store, name)
|
24
|
+
files = package.filelist
|
55
25
|
|
56
|
-
|
57
|
-
# spec.require_paths.concat(spec.require_paths.collect{ |d| File.join(d, platform) })
|
58
|
-
#end
|
26
|
+
stage(stage, files)
|
59
27
|
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
package.dependencies.each do |d,v|
|
67
|
-
spec.add_dependency(*[d,v].compact)
|
68
|
-
end
|
28
|
+
if dryrun?
|
29
|
+
status "tar -cxf #{name}.tgz"
|
30
|
+
else
|
31
|
+
file = nil
|
32
|
+
cd(store) do
|
33
|
+
file = tgz(name)
|
69
34
|
end
|
70
|
-
|
71
|
-
spec.extensions = package.compile
|
72
|
-
|
73
|
-
spec.files = distribute
|
74
|
-
|
75
|
-
spec.test_files = distribute.select{ |f| f =~ /^test\// } # TODO make test_files configurable
|
35
|
+
transfer(file, store)
|
76
36
|
end
|
77
37
|
end
|
78
38
|
|
79
39
|
# Transfer package file to storage location.
|
80
40
|
|
81
41
|
def transfer(file, store)
|
82
|
-
|
42
|
+
# move to store, unless already there
|
43
|
+
dest = File.join(store, File.basename(file))
|
83
44
|
dest = File.expand_path(dest)
|
84
45
|
mv(file, store) unless file == dest
|
85
46
|
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
#!/usr/bin/env ratch
|
2
|
+
|
3
|
+
# generate zip package
|
4
|
+
|
5
|
+
require 'ratch/extra/stage'
|
6
|
+
require 'ratch/extra/zip'
|
7
|
+
|
8
|
+
# Create Zip package.
|
9
|
+
|
10
|
+
main 'pack/zip' do
|
11
|
+
status "Creating .zip package"
|
12
|
+
|
13
|
+
config = configuration['pack'] || {}
|
14
|
+
config = config['zip'] || {}
|
15
|
+
|
16
|
+
package = package().clone
|
17
|
+
package.update(config)
|
18
|
+
|
19
|
+
store = config[:store] || 'pkg'
|
20
|
+
templ = config[:template]
|
21
|
+
|
22
|
+
name = package.stage_name(templ)
|
23
|
+
stage = File.join(store, name)
|
24
|
+
files = package.filelist
|
25
|
+
|
26
|
+
stage(stage, files)
|
27
|
+
|
28
|
+
if dryrun?
|
29
|
+
status "tar -cxf #{name}.zip"
|
30
|
+
else
|
31
|
+
file = nil
|
32
|
+
cd(store) do
|
33
|
+
file = zip(name)
|
34
|
+
end
|
35
|
+
transfer(file, store)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
# Transfer package file to storage location.
|
40
|
+
|
41
|
+
def transfer(file, store)
|
42
|
+
# move to store, unless already there
|
43
|
+
dest = File.join(store, File.basename(file))
|
44
|
+
dest = File.expand_path(dest)
|
45
|
+
mv(file, store) unless file == dest
|
46
|
+
end
|
@@ -1,8 +1,8 @@
|
|
1
1
|
#!/usr/bin/env ratch
|
2
2
|
|
3
|
-
#
|
3
|
+
# publish website to rubyforge
|
4
4
|
#
|
5
|
-
# This task publishes the source dir (deafult 'doc
|
5
|
+
# This task publishes the source dir (deafult 'doc')
|
6
6
|
# to a rubyforge website.
|
7
7
|
|
8
8
|
main :publish do
|
@@ -10,10 +10,17 @@ main :publish do
|
|
10
10
|
|
11
11
|
project = config['project']
|
12
12
|
subdir = config['subdir']
|
13
|
-
source = config['source'] || "doc
|
14
|
-
username = config['username']
|
15
|
-
|
16
|
-
|
13
|
+
source = config['source'] || "doc"
|
14
|
+
username = config['username'] || ENV['RUBYFORGE_USERNAME']
|
15
|
+
clear = config['clear']
|
16
|
+
|
17
|
+
if clear
|
18
|
+
protect = config['protect'].to_a
|
19
|
+
exclude = config['exclude'].to_a
|
20
|
+
else
|
21
|
+
protect = %w{usage statcvs statsvn robot.txt wiki} + config['protect'].to_a
|
22
|
+
exclude = %w{.svn} + config['exclude'].to_a
|
23
|
+
end
|
17
24
|
|
18
25
|
abort "no project" unless project
|
19
26
|
abort "no username" unless username
|
@@ -27,32 +34,24 @@ main :publish do
|
|
27
34
|
dir = source.chomp('/') + '/'
|
28
35
|
url = "#{username}@rubyforge.org:/var/www/gforge-projects/#{destination}"
|
29
36
|
|
30
|
-
op = ['-rLvz', '--delete'] # maybe -p ?
|
37
|
+
op = ['-rLvz', '--delete-after'] # maybe -p ?
|
31
38
|
|
32
|
-
#
|
39
|
+
# Using commandline filter options didn't seem
|
33
40
|
# to work, so I opted for creating an .rsync_filter file for
|
34
41
|
# all cases.
|
35
42
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
43
|
+
unless protect.empty? && exclude.empty?
|
44
|
+
rsync_file = File.join(source,'.rsync-filter')
|
45
|
+
unless file?(rsync_file)
|
46
|
+
File.open(rsync_file, 'w') do |f|
|
47
|
+
exclude.each{|e| f << "- #{e}\n"}
|
48
|
+
protect.each{|e| f << "P #{e}\n"}
|
49
|
+
end
|
42
50
|
end
|
51
|
+
op << "--filter='dir-merge #{rsync_file}'"
|
43
52
|
end
|
44
53
|
|
45
|
-
op << "--filter='dir-merge #{filter_file}'"
|
46
|
-
|
47
|
-
#if file?(filter_file)
|
48
|
-
# op << "--filter='dir-merge #{filter_file}'"
|
49
|
-
#else # NOT WORKING?
|
50
|
-
# op.concat exclude.map{|e| "--filter='- #{e}'"}
|
51
|
-
# op.concat protect.map{|e| "--filter='P #{e}'"}
|
52
|
-
#end
|
53
|
-
|
54
54
|
args = op + [dir, url]
|
55
55
|
|
56
56
|
rsync(*args.to_params)
|
57
57
|
end
|
58
|
-
|
@@ -0,0 +1,33 @@
|
|
1
|
+
#!/usr/bin/env ratch
|
2
|
+
|
3
|
+
# update version stamps
|
4
|
+
|
5
|
+
# You can change these via the command line.
|
6
|
+
version = commandline['version'] || rollrc.version
|
7
|
+
status = commandline['status'] || rollrc.status
|
8
|
+
|
9
|
+
# Update ROLLRC file.
|
10
|
+
|
11
|
+
main :stamp do
|
12
|
+
if version != rollrc.version or status != rollrc.status
|
13
|
+
build rollrc.file
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
#
|
18
|
+
|
19
|
+
file rollrc.file do
|
20
|
+
w = ''
|
21
|
+
w << "#{rollrc.name} #{version} #{status} #{Time.now.strftime('%Y-%m-%d')}"
|
22
|
+
w << " #{rollrc.default}" if rollrc.default
|
23
|
+
w << "\n"
|
24
|
+
w << rollrc.libpath.join("\n")
|
25
|
+
|
26
|
+
if dryrun?
|
27
|
+
puts rollrc.file + ":"
|
28
|
+
puts w
|
29
|
+
else
|
30
|
+
File.open(rollrc.file, 'w'){|f| f << w}
|
31
|
+
puts "#{rollrc.file} updated."
|
32
|
+
end
|
33
|
+
end
|