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.
Files changed (132) hide show
  1. data/{log/history → CHANGES} +0 -0
  2. data/{log/todo → TODO} +0 -0
  3. data/bin/manifest +451 -0
  4. data/bin/ratch +3 -3
  5. data/demo/task/config.yaml +4 -0
  6. data/lib/ratch/{batch/argvutils.rb → dsl/argv.rb} +9 -4
  7. data/lib/ratch/dsl/batch.rb +226 -0
  8. data/lib/ratch/{batch → dsl}/build.rb +83 -4
  9. data/lib/ratch/{batch/consoleutils.rb → dsl/console.rb} +13 -5
  10. data/lib/ratch/{batch/emailutils.rb → dsl/email.rb} +21 -25
  11. data/lib/ratch/{batch/fileutils.rb → dsl/file.rb} +56 -56
  12. data/lib/ratch/dsl/meta.rb +132 -0
  13. data/lib/ratch/{batch → dsl}/options.rb +7 -5
  14. data/lib/ratch/dsl/setup.rb +124 -0
  15. data/lib/ratch/{support/signiture.rb → dsl/sign.rb} +9 -18
  16. data/lib/ratch/dsl/stage.rb +147 -0
  17. data/lib/ratch/dsl/task.rb +139 -0
  18. data/lib/ratch/{uploadutils.rb → dsl/upload.rb} +7 -5
  19. data/lib/ratch/{batch/task.rb → dsl/zip.rb} +30 -14
  20. data/lib/ratch/dsl.rb +52 -0
  21. data/lib/ratch/extra/email.rb +5 -0
  22. data/lib/ratch/extra/stage.rb +5 -0
  23. data/lib/ratch/extra/zip.rb +5 -0
  24. data/lib/ratch/manifest.rb +540 -0
  25. data/lib/ratch/{project → metadata}/information.rb +1 -0
  26. data/lib/ratch/{project → metadata}/package.rb +28 -2
  27. data/lib/ratch/{project → metadata}/project.rb +8 -16
  28. data/lib/ratch/{project → metadata}/release.rb +6 -6
  29. data/lib/ratch/support/errors.rb +4 -0
  30. data/lib/ratch/support/filename.rb +18 -0
  31. data/lib/ratch/toolset/ruby/compile +49 -0
  32. data/lib/ratch/toolset/ruby/pack/gem +26 -18
  33. data/lib/ratch/toolset/ruby/pack/tgz +25 -64
  34. data/lib/ratch/toolset/ruby/pack/zip +46 -0
  35. data/lib/ratch/toolset/ruby/publish +23 -24
  36. data/lib/ratch/toolset/ruby/release +8 -0
  37. data/lib/ratch/toolset/ruby/stamp +33 -0
  38. data/lib/ratch/toolset/sandbox +11 -0
  39. data/meta/MANIFEST +101 -23
  40. data/meta/ROLLRC +1 -1
  41. data/meta/config.yaml +10 -0
  42. data/meta/icli.yaml +2 -2
  43. data/meta/project.yaml +9 -10
  44. data/meta/xProjectInfo +41 -0
  45. data/task/release +1 -4
  46. metadata +82 -156
  47. data/demo/task/rdoc +0 -88
  48. data/demo/task/rdoc-old +0 -182
  49. data/doc/images/clipboard.jpg +0 -0
  50. data/doc/images/clipboard2.png +0 -0
  51. data/doc/images/milles-tn.jpg +0 -0
  52. data/doc/images/mints.png +0 -0
  53. data/doc/images/ratch2.png +0 -0
  54. data/doc/images/ruby-sm.png +0 -0
  55. data/doc/images/silver.gif +0 -0
  56. data/doc/images/toolbox.jpg +0 -0
  57. data/doc/index.html +0 -181
  58. data/doc/notes/original.rb +0 -308
  59. data/doc/rdoc/classes/Array.html +0 -194
  60. data/doc/rdoc/classes/Dir.html +0 -317
  61. data/doc/rdoc/classes/Hash.html +0 -217
  62. data/doc/rdoc/classes/Ratch/ArgvUtils/Ext.html +0 -285
  63. data/doc/rdoc/classes/Ratch/ArgvUtils.html +0 -173
  64. data/doc/rdoc/classes/Ratch/BatchFile.html +0 -207
  65. data/doc/rdoc/classes/Ratch/BatchManager.html +0 -250
  66. data/doc/rdoc/classes/Ratch/BatchScript.html +0 -127
  67. data/doc/rdoc/classes/Ratch/Batchable.html +0 -373
  68. data/doc/rdoc/classes/Ratch/Build.html +0 -321
  69. data/doc/rdoc/classes/Ratch/BuildManager.html +0 -319
  70. data/doc/rdoc/classes/Ratch/Buildable.html +0 -202
  71. data/doc/rdoc/classes/Ratch/ConfigUtils.html +0 -281
  72. data/doc/rdoc/classes/Ratch/ConsoleUtils.html +0 -189
  73. data/doc/rdoc/classes/Ratch/EmailUtils.html +0 -209
  74. data/doc/rdoc/classes/Ratch/FileUtils.html +0 -674
  75. data/doc/rdoc/classes/Ratch/GeneralOptions.html +0 -430
  76. data/doc/rdoc/classes/Ratch/Task.html +0 -201
  77. data/doc/rdoc/classes/Ratch/TaskManager.html +0 -330
  78. data/doc/rdoc/classes/Ratch/Taskable.html +0 -231
  79. data/doc/rdoc/classes/Ratch/UploadUtils.html +0 -566
  80. data/doc/rdoc/classes/Ratch.html +0 -201
  81. data/doc/rdoc/created.rid +0 -1
  82. data/doc/rdoc/files/COPYING.html +0 -1003
  83. data/doc/rdoc/files/README.html +0 -143
  84. data/doc/rdoc/files/lib/ratch/argvutils_rb.html +0 -131
  85. data/doc/rdoc/files/lib/ratch/batch_rb.html +0 -155
  86. data/doc/rdoc/files/lib/ratch/batchable_rb.html +0 -131
  87. data/doc/rdoc/files/lib/ratch/batchfile_rb.html +0 -148
  88. data/doc/rdoc/files/lib/ratch/buildable_rb.html +0 -131
  89. data/doc/rdoc/files/lib/ratch/consoleutils_rb.html +0 -131
  90. data/doc/rdoc/files/lib/ratch/emailutils_rb.html +0 -139
  91. data/doc/rdoc/files/lib/ratch/facets/multiglob_rb.html +0 -137
  92. data/doc/rdoc/files/lib/ratch/fileutils_rb.html +0 -139
  93. data/doc/rdoc/files/lib/ratch/options_rb.html +0 -131
  94. data/doc/rdoc/files/lib/ratch/taskable_rb.html +0 -131
  95. data/doc/rdoc/files/lib/ratch/uploadutils_rb.html +0 -150
  96. data/doc/rdoc/fr_class_index.html +0 -48
  97. data/doc/rdoc/fr_file_index.html +0 -41
  98. data/doc/rdoc/fr_method_index.html +0 -133
  99. data/doc/rdoc/index.html +0 -24
  100. data/doc/rdoc/rdoc-style.css +0 -208
  101. data/doc/scrap/flexihead-flip.jpg +0 -0
  102. data/doc/scrap/flexihead.jpg +0 -0
  103. data/doc/scrap/head1.jpg +0 -0
  104. data/doc/scrap/ratch.jpg +0 -0
  105. data/doc/scrap/ratch1.png +0 -0
  106. data/doc/scrap/ratch2.jpg +0 -0
  107. data/doc/scrap/ratch3.png +0 -0
  108. data/doc/scrap/red-ratch.jpg +0 -0
  109. data/doc/scrap/redratchet.jpg +0 -0
  110. data/doc/scrap/ruby-kit/ruby.png +0 -0
  111. data/doc/scrap/scrap.red +0 -256
  112. data/doc/sitemap.yaml +0 -10
  113. data/doc/siteparts/index.red +0 -100
  114. data/doc/siteparts/layout.rhtml +0 -56
  115. data/doc/siteparts/tutorial.red +0 -578
  116. data/doc/style.css +0 -112
  117. data/doc/tutorial.html +0 -722
  118. data/lib/ratch/batch.rb +0 -488
  119. data/lib/ratch/support/setuputils.rb +0 -124
  120. data/lib/ratch/support/stage.rb +0 -292
  121. data/lib/ratch/toolset/ruby/rdoc +0 -88
  122. data/task/rdoc +0 -6
  123. data/work/old/batchfile.rb +0 -95
  124. data/work/project-old.rb +0 -67
  125. data/work/scrap/install +0 -89
  126. data/work/scrap/install.0 +0 -49
  127. data/work/scrap/install.1 +0 -63
  128. data/work/scrap/ludo +0 -25
  129. data/work/scrap/oldtaskable.rb +0 -573
  130. data/work/scrap/ratch.man +0 -39
  131. data/work/scrap/taskable-simple.rb +0 -42
  132. 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/project/project'
25
- require 'ratch/project/release'
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/project/information'
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.to_s[0..79]
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/project/information'
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
- str = str.strip.split(/\n/).first
98
+ stamp, *libpath = str.strip.split(/\n/)
99
99
 
100
- name, version, status, date, *null = *str.split(/\s+/)
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
- #:codename => codename
105
+ :date => date,
106
+ :libpath => libpath
107
107
  }
108
108
  end
109
109
 
@@ -0,0 +1,4 @@
1
+
2
+ class OverwriteError < Exception
3
+ end
4
+
@@ -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
- require 'ratch/project/package'
13
-
14
- #
14
+ # Create a Gem package.
15
15
 
16
16
  main 'pack/gem' do
17
- # load config (TODO)
18
- #source = Dir.pwd
19
- store = 'pkg'
20
- package = Ratch::Package.load
21
- #status "Creating RubyGem(s)"
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(source) do
30
+ #cd(dir) do
24
31
  #status "vi #{metadata.name}.gemspec"
25
32
  builder = ::Gem::Builder.new(gemspec(package))
26
- #status "gem build #{package.name}"
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 gem package
3
+ # generate tar gzip package
4
4
 
5
- begin
6
- require 'rubygems/specification'
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
- main 'pack/gem' do
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
- # Create Gem::Specification.
10
+ main 'pack/tgz' do
11
+ status "Creating .tgz package"
36
12
 
37
- def gemspec(package)
38
- distribute = package.filelist
39
- #distribute = Dir.multiglob_with_default( '**/*', distribute )
13
+ config = configuration['pack'] || {}
14
+ config = config['tgz'] || {}
40
15
 
41
- ::Gem::Specification.new do |spec|
42
- spec.name = package.name
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
- # Platform: ruby, mswin32, i586-linux, powerpc-darwin, current
52
- spec.platform = 'ruby' # TODO current support!
19
+ store = config[:store] || 'pkg'
20
+ templ = config[:template]
53
21
 
54
- spec.require_paths = [package.gem_path].flatten.reverse
22
+ name = package.stage_name(templ)
23
+ stage = File.join(store, name)
24
+ files = package.filelist
55
25
 
56
- #if package.platform != 'ruby'
57
- # spec.require_paths.concat(spec.require_paths.collect{ |d| File.join(d, platform) })
58
- #end
26
+ stage(stage, files)
59
27
 
60
- spec.bindir = "bin"
61
- spec.executables = package.executables
62
- spec.requirements = package.requirements
63
- spec.has_rdoc = package.document
64
-
65
- if package.dependencies
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
- dest = File.join(store, File.basename(file)) # move to store, unless already there
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
- # Publish website to rubyforge
3
+ # publish website to rubyforge
4
4
  #
5
- # This task publishes the source dir (deafult 'doc/site')
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/site"
14
- username = config['username']
15
- protect = %w{usage statcvs statsvn robot.txt wiki}
16
- exclude = %w{.svn}
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
- # add filter options. The commandline version didn't seem
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
- filter_file = File.join(source,'.rsync-filter')
37
-
38
- unless file?(filter_file)
39
- File.open(filter_file, 'w') do |f|
40
- exclude.map{|e| f << "- #{e}\n"}
41
- protect.map{|e| f << "P #{e}\n"}
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,8 @@
1
+ #!/usr/bin/env ratch
2
+
3
+ # release packages to rubyforge (with icli)
4
+
5
+ main :release do
6
+ name, version = rollrc.name, rollrc.version
7
+ icli "rubyforge release --version=#{version}"
8
+ end
@@ -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
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env ratch
2
+
3
+ puts
4
+ puts "[Directories]"
5
+ puts "root: " + root_directory
6
+ puts "call: " + call_directory
7
+ puts "batch: " + batch_directory
8
+ puts
9
+ puts "[Configuration]"
10
+ y configuration
11
+ puts