ratch 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +7 -1
- data/bin/ratch +23 -8
- data/lib/ratch/dsl/batch.rb +7 -1
- data/lib/ratch/dsl/build.rb +1 -1
- data/lib/ratch/dsl/meta.rb +2 -9
- data/lib/ratch/manager.rb +33 -14
- data/lib/ratch/metadata/release.rb +2 -6
- data/lib/ratch/toolset/{sandbox → sandbox/query} +0 -0
- data/meta/MANIFEST +6 -60
- data/meta/config.yaml +1 -2
- data/meta/ratch.roll +2 -0
- data/task/publish +20 -14
- metadata +4 -3
- data/meta/ROLLRC +0 -2
data/CHANGES
CHANGED
@@ -1,6 +1,12 @@
|
|
1
1
|
= Ratch Revision History
|
2
2
|
|
3
|
-
== 0.
|
3
|
+
== 0.4.1 / 2007-12-18
|
4
|
+
|
5
|
+
* #rollrc will be deprecated, it is now just an alias of #release.
|
6
|
+
* #release gets it's data from the .roll file (no longer ROLLRC).
|
7
|
+
* Split ruby/svn/log task into two; one for text log and the other for xml log.
|
8
|
+
|
9
|
+
== 0.4.0 / 2007-12-14
|
4
10
|
|
5
11
|
* Reorganized batch scripts --eventually to simplify the code a bit more.
|
6
12
|
* Made bin? and safe? functions of FileTest.
|
data/bin/ratch
CHANGED
@@ -1,21 +1,36 @@
|
|
1
1
|
#! /usr/bin/env ruby
|
2
2
|
|
3
|
+
# TODO Create a more robust parser.
|
4
|
+
|
3
5
|
if ARGV[0] == '-s'
|
4
6
|
require 'ratch/manager'
|
5
7
|
manager = Ratch::Manager.new
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
8
|
+
|
9
|
+
set = ARGV[1]
|
10
|
+
path = ARGV[2]
|
11
|
+
|
12
|
+
if set
|
13
|
+
if setdirectory = manager.toolset?(set)
|
14
|
+
if path
|
15
|
+
if batchfile = manager.tool?(set, path)
|
16
|
+
require 'ratch/dsl'
|
17
|
+
self.batch_directory = setdirectory
|
18
|
+
load($0 = batchfile)
|
19
|
+
else
|
20
|
+
puts "no #{set} tool -- #{path}"
|
21
|
+
end
|
22
|
+
else
|
23
|
+
puts manager.tools(set).join("\n")
|
24
|
+
end
|
12
25
|
else
|
13
|
-
puts "no
|
26
|
+
puts "no toolset -- #{set}"
|
14
27
|
end
|
15
28
|
else
|
16
|
-
puts manager.
|
29
|
+
puts manager.toolsets.join("\n")
|
17
30
|
end
|
31
|
+
|
18
32
|
elsif ARGV.empty?
|
33
|
+
|
19
34
|
# TODO read stdin for ratch script
|
20
35
|
|
21
36
|
else
|
data/lib/ratch/dsl/batch.rb
CHANGED
@@ -62,15 +62,21 @@ module Dsl
|
|
62
62
|
@call_directory ||= File.expand_path(File.dirname($0))
|
63
63
|
end
|
64
64
|
|
65
|
-
# TODO Better name?
|
65
|
+
# TODO Better name? (system_directory ?)
|
66
66
|
|
67
67
|
def batch_directory
|
68
|
+
# TODO: Better definition?
|
68
69
|
@batch_directory ||= (
|
69
70
|
dir = call_directory.sub(root_directory + '/', '').split('/').first
|
70
71
|
File.join(root_directory, dir)
|
71
72
|
)
|
72
73
|
end
|
73
74
|
|
75
|
+
# If a system directory is used (as opposed to a local project directory)
|
76
|
+
# then the batch directory will need to be set explicitly.
|
77
|
+
|
78
|
+
attr_writer :batch_directory
|
79
|
+
|
74
80
|
# Current batch file, relative to the batch directory.
|
75
81
|
|
76
82
|
def batch_file
|
data/lib/ratch/dsl/build.rb
CHANGED
data/lib/ratch/dsl/meta.rb
CHANGED
@@ -40,17 +40,10 @@ module Dsl
|
|
40
40
|
|
41
41
|
# Roll file information.
|
42
42
|
|
43
|
-
def
|
43
|
+
def release
|
44
44
|
@rollrc ||= Release.load
|
45
|
-
# @rollrc ||= (
|
46
|
-
# file = Dir.glob('{meta/,}rollrc', File::FNM_CASEFOLD).first
|
47
|
-
# data = File.read(file).split(/\n/)
|
48
|
-
# data, *libpath = *data
|
49
|
-
# name, version, status, date, default, *null = *data.split(/\s+/)
|
50
|
-
# klass = Struct.new("ROLLRC", :file, :name, :version, :status, :date, :default, :libpath)
|
51
|
-
# klass.new(file, name, version, status, date, default, libpath)
|
52
|
-
# )
|
53
45
|
end
|
46
|
+
alias_method :rollrc, :release
|
54
47
|
|
55
48
|
# Load configuration data from a file. The file will
|
56
49
|
# be looked for in the current script directory then
|
data/lib/ratch/manager.rb
CHANGED
@@ -1,34 +1,53 @@
|
|
1
|
-
|
2
1
|
module Ratch
|
3
2
|
|
4
3
|
class Manager
|
5
4
|
|
6
|
-
|
7
|
-
|
5
|
+
# Return master toolset directory. If toolset if given then
|
6
|
+
# return that toolsets directory.
|
7
|
+
|
8
|
+
def toolset_directory(toolset=nil)
|
9
|
+
if toolset
|
10
|
+
File.join(File.dirname(__FILE__), 'toolset', toolset)
|
11
|
+
else
|
12
|
+
File.join(File.dirname(__FILE__), 'toolset')
|
13
|
+
end
|
8
14
|
end
|
9
15
|
|
10
|
-
#
|
16
|
+
# List toolsets.
|
11
17
|
|
12
|
-
def
|
18
|
+
def toolsets
|
13
19
|
files = []
|
14
20
|
Dir.chdir(toolset_directory) do
|
15
|
-
files = Dir.glob('
|
21
|
+
files = Dir.glob('*/').map{ |d| d.chomp('/') }
|
16
22
|
end
|
17
23
|
files
|
18
24
|
end
|
19
25
|
|
20
|
-
#
|
26
|
+
# List tools for a give toolset.
|
21
27
|
|
22
|
-
def
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
false
|
28
|
+
def tools(toolset=nil)
|
29
|
+
files = []
|
30
|
+
direc = toolset ? File.join(toolset_directory, toolset) : toolset_directory
|
31
|
+
Dir.chdir(direc) do
|
32
|
+
files = Dir.glob('**/*') - Dir.glob('**/*/').map{ |d| d.chomp('/') }
|
28
33
|
end
|
34
|
+
files
|
35
|
+
end
|
36
|
+
|
37
|
+
# Verify a toolset exists?
|
38
|
+
|
39
|
+
def toolset?(toolset)
|
40
|
+
path = File.join(toolset_directory, toolset)
|
41
|
+
File.exist?(path) ? path : false
|
42
|
+
end
|
43
|
+
|
44
|
+
# Verify a tool exists for a given toolset.
|
45
|
+
|
46
|
+
def tool?(toolset, batchfile)
|
47
|
+
path = File.join(toolset_directory, toolset, batchfile)
|
48
|
+
File.exist?(path) ? path : false
|
29
49
|
end
|
30
50
|
|
31
51
|
end
|
32
52
|
|
33
53
|
end
|
34
|
-
|
@@ -34,10 +34,6 @@ module Ratch
|
|
34
34
|
|
35
35
|
attr_accessor :name
|
36
36
|
|
37
|
-
validate "name is required" do
|
38
|
-
name
|
39
|
-
end
|
40
|
-
|
41
37
|
# Version number.
|
42
38
|
|
43
39
|
attr_accessor :version
|
@@ -69,12 +65,12 @@ module Ratch
|
|
69
65
|
|
70
66
|
#
|
71
67
|
|
72
|
-
|
68
|
+
ROLL_FILE = '{,meta/}*.roll'
|
73
69
|
|
74
70
|
# Load release information.
|
75
71
|
|
76
72
|
def self.load
|
77
|
-
file = Dir.glob(
|
73
|
+
file = Dir.glob(ROLL_FILE, File::FNM_CASEFOLD).first
|
78
74
|
if file
|
79
75
|
Release.new(parse_rollrc(File.open(file)))
|
80
76
|
else
|
File without changes
|
data/meta/MANIFEST
CHANGED
@@ -67,7 +67,8 @@ lib/ratch/toolset/ruby/announce
|
|
67
67
|
lib/ratch/toolset/ruby/clobber
|
68
68
|
lib/ratch/toolset/ruby/clobber/rdoc
|
69
69
|
lib/ratch/toolset/ruby/compile
|
70
|
-
lib/ratch/toolset/ruby/
|
70
|
+
lib/ratch/toolset/ruby/doc
|
71
|
+
lib/ratch/toolset/ruby/doc/zip
|
71
72
|
lib/ratch/toolset/ruby/install
|
72
73
|
lib/ratch/toolset/ruby/notes
|
73
74
|
lib/ratch/toolset/ruby/pack
|
@@ -83,6 +84,7 @@ lib/ratch/toolset/ruby/stats
|
|
83
84
|
lib/ratch/toolset/ruby/svn
|
84
85
|
lib/ratch/toolset/ruby/svn/log
|
85
86
|
lib/ratch/toolset/ruby/svn/tag
|
87
|
+
lib/ratch/toolset/ruby/svn/xlog
|
86
88
|
lib/ratch/toolset/ruby/test
|
87
89
|
lib/ratch/toolset/ruby/test/crosstest
|
88
90
|
lib/ratch/toolset/ruby/test/extest
|
@@ -92,15 +94,16 @@ lib/ratch/toolset/ruby/test/loadtest
|
|
92
94
|
lib/ratch/toolset/ruby/test/syntax
|
93
95
|
lib/ratch/toolset/ruby/test/test
|
94
96
|
lib/ratch/toolset/sandbox
|
97
|
+
lib/ratch/toolset/sandbox/query
|
95
98
|
man
|
96
99
|
man/ratch.man
|
97
100
|
meta
|
98
101
|
meta/MANIFEST
|
99
|
-
meta/ProjectInfo
|
100
|
-
meta/ROLLRC
|
101
102
|
meta/config.yaml
|
102
103
|
meta/icli.yaml
|
103
104
|
meta/project.yaml
|
105
|
+
meta/ratch.roll
|
106
|
+
meta/xProjectInfo
|
104
107
|
task
|
105
108
|
task/clobber
|
106
109
|
task/clobber/package
|
@@ -112,63 +115,6 @@ task/setup
|
|
112
115
|
task/stats
|
113
116
|
test
|
114
117
|
test/fixtures
|
115
|
-
website
|
116
|
-
website/images
|
117
|
-
website/images/appendix.png
|
118
|
-
website/images/clipboard2.png
|
119
|
-
website/images/flexihead-flip.jpg
|
120
|
-
website/images/flexihead.jpg
|
121
|
-
website/images/head1.jpg
|
122
|
-
website/images/icon
|
123
|
-
website/images/icon/book.jpg
|
124
|
-
website/images/icon/development.png
|
125
|
-
website/images/icon/download_arrow.gif
|
126
|
-
website/images/icon/license.png
|
127
|
-
website/images/icon/logohover.png
|
128
|
-
website/images/icon/source.png
|
129
|
-
website/images/process.gif
|
130
|
-
website/images/radio_earth.jpg
|
131
|
-
website/images/ready.png
|
132
|
-
website/images/redratchet.jpg
|
133
|
-
website/images/rivet
|
134
|
-
website/images/rivet/board-blue.png
|
135
|
-
website/images/rivet/board-gray.png
|
136
|
-
website/images/rivet/board-green.png
|
137
|
-
website/images/rivet/board-red.png
|
138
|
-
website/images/rivet/folder-blue.png
|
139
|
-
website/images/rivet/folder-gray.png
|
140
|
-
website/images/rivet/folder-green.png
|
141
|
-
website/images/rivet/folder-red.png
|
142
|
-
website/images/rivet/paper-blue.png
|
143
|
-
website/images/rivet/paper-gray.png
|
144
|
-
website/images/rivet/paper-green.png
|
145
|
-
website/images/rivet/paper-red.png
|
146
|
-
website/images/ruby.gif
|
147
|
-
website/images/runneth.png
|
148
|
-
website/images/scrap
|
149
|
-
website/images/scrap/_mat.jpg
|
150
|
-
website/images/scrap/clipboard.jpg
|
151
|
-
website/images/scrap/cubeYellow.jpg
|
152
|
-
website/images/scrap/dove.jpg
|
153
|
-
website/images/scrap/drink.png
|
154
|
-
website/images/scrap/masu.jpg
|
155
|
-
website/images/scrap/package.png
|
156
|
-
website/images/scrap/ptyid879.jpg
|
157
|
-
website/images/scrap/ratch.jpg
|
158
|
-
website/images/scrap/ratch2.jpg
|
159
|
-
website/images/scrap/ready.svg
|
160
|
-
website/images/scrap/red-ratch.jpg
|
161
|
-
website/images/scrap/red_book.gif
|
162
|
-
website/images/scrap/takara.gif
|
163
|
-
website/images/silver.gif
|
164
|
-
website/images/test.jpg
|
165
|
-
website/index.html
|
166
|
-
website/javascript
|
167
|
-
website/javascript/jquery.js
|
168
|
-
website/javascript/jquery.tabs.js
|
169
|
-
website/library.html
|
170
|
-
website/manual.html
|
171
|
-
website/style.css
|
172
118
|
work
|
173
119
|
work/old
|
174
120
|
work/old/batchfile.rb
|
data/meta/config.yaml
CHANGED
data/meta/ratch.roll
ADDED
data/task/publish
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
#!/usr/bin/env ratch
|
2
2
|
|
3
|
-
#
|
3
|
+
# publish website to rubyforge
|
4
4
|
#
|
5
5
|
# This task publishes the source dir (deafult 'doc')
|
6
6
|
# to a rubyforge website.
|
@@ -12,8 +12,15 @@ main :publish do
|
|
12
12
|
subdir = config['subdir']
|
13
13
|
source = config['source'] || "doc"
|
14
14
|
username = config['username'] || ENV['RUBYFORGE_USERNAME']
|
15
|
-
|
16
|
-
|
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,25 +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}' --delete-after"
|
46
|
-
|
47
54
|
args = op + [dir, url]
|
48
55
|
|
49
56
|
rsync(*args.to_params)
|
50
57
|
end
|
51
|
-
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.4.6
|
|
3
3
|
specification_version: 2
|
4
4
|
name: ratch
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.4.
|
7
|
-
date: 2007-12-
|
6
|
+
version: 0.4.1
|
7
|
+
date: 2007-12-18 00:00:00 -05:00
|
8
8
|
summary: Ruby Batch Files
|
9
9
|
require_paths:
|
10
10
|
- lib
|
@@ -89,6 +89,7 @@ files:
|
|
89
89
|
- lib/ratch/toolset/ruby/release
|
90
90
|
- lib/ratch/toolset/ruby/stamp
|
91
91
|
- lib/ratch/toolset/sandbox
|
92
|
+
- lib/ratch/toolset/sandbox/query
|
92
93
|
- lib/ratch/support
|
93
94
|
- lib/ratch/support/filetest.rb
|
94
95
|
- lib/ratch/support/filename.rb
|
@@ -126,8 +127,8 @@ files:
|
|
126
127
|
- meta/icli.yaml
|
127
128
|
- meta/config.yaml
|
128
129
|
- meta/MANIFEST
|
129
|
-
- meta/ROLLRC
|
130
130
|
- meta/project.yaml
|
131
|
+
- meta/ratch.roll
|
131
132
|
- meta/xProjectInfo
|
132
133
|
- README
|
133
134
|
- task
|
data/meta/ROLLRC
DELETED