ratch 0.4.1 → 1.0.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 (107) hide show
  1. data/COPYING +17 -669
  2. data/HISTORY +6 -0
  3. data/MANIFEST +36 -0
  4. data/METADATA +14 -0
  5. data/NEWS +7 -0
  6. data/README +67 -17
  7. data/bin/ratch +5 -78
  8. data/demo/tryme-task.ratch +12 -0
  9. data/demo/tryme1.ratch +6 -0
  10. data/lib/ratch/core_ext.rb +6 -0
  11. data/lib/ratch/core_ext/facets.rb +1 -0
  12. data/lib/ratch/core_ext/filetest.rb +52 -0
  13. data/lib/ratch/core_ext/object.rb +8 -0
  14. data/lib/ratch/core_ext/pathname.rb +38 -0
  15. data/lib/ratch/core_ext/string.rb +44 -0
  16. data/lib/ratch/{dsl/console.rb → core_ext/to_console.rb} +2 -76
  17. data/lib/ratch/core_ext/to_list.rb +29 -0
  18. data/lib/ratch/dsl.rb +494 -49
  19. data/lib/ratch/index.rb +4 -0
  20. data/lib/ratch/io.rb +116 -0
  21. data/lib/ratch/pathglob.rb +73 -0
  22. data/lib/ratch/plugin.rb +55 -0
  23. data/lib/ratch/runmode.rb +69 -0
  24. data/lib/ratch/script.rb +52 -0
  25. data/lib/ratch/service.rb +33 -0
  26. data/lib/ratch/task.rb +249 -0
  27. data/lib/ratch/task2.rb +298 -0
  28. data/test/README +1 -0
  29. data/test/test_helper.rb +4 -0
  30. data/test/test_task.rb +46 -0
  31. metadata +90 -150
  32. data/CHANGES +0 -22
  33. data/TODO +0 -2
  34. data/bin/lt +0 -56
  35. data/bin/ludo +0 -14
  36. data/bin/manifest +0 -451
  37. data/bin/ratch-find +0 -21
  38. data/demo/WILMA +0 -1
  39. data/demo/XR +0 -9
  40. data/demo/lib/foo/foo.rb +0 -7
  41. data/demo/p.rb +0 -9
  42. data/demo/r.rb +0 -6
  43. data/demo/t.rb +0 -3
  44. data/demo/task/config.yaml +0 -4
  45. data/demo/task/one +0 -6
  46. data/demo/task/simplebuild +0 -15
  47. data/demo/task/stats +0 -4
  48. data/demo/task/task +0 -6
  49. data/demo/task/tryme +0 -10
  50. data/lib/ratch/dsl/argv.rb +0 -112
  51. data/lib/ratch/dsl/batch.rb +0 -232
  52. data/lib/ratch/dsl/build.rb +0 -174
  53. data/lib/ratch/dsl/email.rb +0 -108
  54. data/lib/ratch/dsl/file.rb +0 -205
  55. data/lib/ratch/dsl/meta.rb +0 -125
  56. data/lib/ratch/dsl/options.rb +0 -98
  57. data/lib/ratch/dsl/setup.rb +0 -124
  58. data/lib/ratch/dsl/sign.rb +0 -243
  59. data/lib/ratch/dsl/stage.rb +0 -147
  60. data/lib/ratch/dsl/task.rb +0 -139
  61. data/lib/ratch/dsl/upload.rb +0 -436
  62. data/lib/ratch/dsl/zip.rb +0 -59
  63. data/lib/ratch/extra/email.rb +0 -5
  64. data/lib/ratch/extra/stage.rb +0 -5
  65. data/lib/ratch/extra/zip.rb +0 -5
  66. data/lib/ratch/manager.rb +0 -53
  67. data/lib/ratch/manifest.rb +0 -540
  68. data/lib/ratch/metadata/information.rb +0 -258
  69. data/lib/ratch/metadata/package.rb +0 -108
  70. data/lib/ratch/metadata/project.rb +0 -523
  71. data/lib/ratch/metadata/release.rb +0 -108
  72. data/lib/ratch/support/errors.rb +0 -4
  73. data/lib/ratch/support/filename.rb +0 -18
  74. data/lib/ratch/support/filetest.rb +0 -29
  75. data/lib/ratch/toolset/ruby/announce +0 -224
  76. data/lib/ratch/toolset/ruby/compile +0 -49
  77. data/lib/ratch/toolset/ruby/install +0 -77
  78. data/lib/ratch/toolset/ruby/notes +0 -185
  79. data/lib/ratch/toolset/ruby/pack/gem +0 -93
  80. data/lib/ratch/toolset/ruby/pack/tgz +0 -46
  81. data/lib/ratch/toolset/ruby/pack/zip +0 -46
  82. data/lib/ratch/toolset/ruby/publish +0 -57
  83. data/lib/ratch/toolset/ruby/release +0 -8
  84. data/lib/ratch/toolset/ruby/setup +0 -1616
  85. data/lib/ratch/toolset/ruby/stamp +0 -33
  86. data/lib/ratch/toolset/ruby/stats +0 -138
  87. data/lib/ratch/toolset/ruby/test/crosstest +0 -305
  88. data/lib/ratch/toolset/ruby/test/extest +0 -129
  89. data/lib/ratch/toolset/ruby/test/isotest +0 -293
  90. data/lib/ratch/toolset/ruby/test/load +0 -39
  91. data/lib/ratch/toolset/ruby/test/loadtest +0 -28
  92. data/lib/ratch/toolset/ruby/test/syntax +0 -29
  93. data/lib/ratch/toolset/ruby/test/test +0 -26
  94. data/lib/ratch/toolset/sandbox/query +0 -11
  95. data/man/ratch.man +0 -73
  96. data/meta/MANIFEST +0 -130
  97. data/meta/config.yaml +0 -9
  98. data/meta/icli.yaml +0 -16
  99. data/meta/project.yaml +0 -20
  100. data/meta/ratch.roll +0 -2
  101. data/meta/xProjectInfo +0 -41
  102. data/task/clobber/package +0 -10
  103. data/task/man +0 -14
  104. data/task/publish +0 -57
  105. data/task/release +0 -9
  106. data/task/setup +0 -1616
  107. data/task/stats +0 -138
@@ -1,108 +0,0 @@
1
- # = TITLE:
2
- #
3
- # Release
4
- #
5
- # = COPYING:
6
- #
7
- # Copyright (c) 2007 Psi T Corp.
8
- #
9
- # This file is part of the ProUtils' Ratch program.
10
- #
11
- # Ratch is free software: you can redistribute it and/or modify
12
- # it under the terms of the GNU General Public License as published by
13
- # the Free Software Foundation, either version 3 of the License, or
14
- # (at your option) any later version.
15
- #
16
- # Ratch is distributed in the hope that it will be useful,
17
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
18
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
- # GNU General Public License for more details.
20
- #
21
- # You should have received a copy of the GNU General Public License
22
- # along with Ratch. If not, see <http://www.gnu.org/licenses/>.
23
-
24
- require 'ratch/metadata/information'
25
-
26
- module Ratch
27
-
28
- # = Release class
29
- #
30
-
31
- class Release < Information
32
-
33
- # Name of release package.
34
-
35
- attr_accessor :name
36
-
37
- # Version number.
38
-
39
- attr_accessor :version
40
-
41
- validate "version is required" do
42
- version
43
- end
44
-
45
- #
46
-
47
- attr_accessor :buildno do
48
- @buildno = Time.now.strftime("%y%m%d%H%M") if TrueClass === @buildno
49
- @buildno
50
- end
51
-
52
- # Status of this release: alpha, beta, RC1, etc.
53
-
54
- attr_accessor :status
55
-
56
- # Date of release (defaults to Time.now).
57
-
58
- attr_accessor :date, :released do
59
- @date || Time.now.strftime("%Y-%m-%d")
60
- end
61
-
62
- # Codename of this release.
63
-
64
- attr_accessor :codename
65
-
66
- #
67
-
68
- ROLL_FILE = '{,meta/}*.roll'
69
-
70
- # Load release information.
71
-
72
- def self.load
73
- file = Dir.glob(ROLL_FILE, File::FNM_CASEFOLD).first
74
- if file
75
- Release.new(parse_rollrc(File.open(file)))
76
- else
77
- raise LoadError, "release file required -- #{RELEASE_FILE}"
78
- end
79
- end
80
-
81
- # Parse ROLLRC file for release information.
82
-
83
- def self.parse_rollrc(io)
84
- if IO === io
85
- begin
86
- str = io.read
87
- ensure
88
- io.close
89
- end
90
- else
91
- str = io.to_s
92
- end
93
-
94
- stamp, *libpath = str.strip.split(/\n/)
95
-
96
- name, version, status, date, *null = *stamp.split(/\s+/)
97
-
98
- { :name => name,
99
- :version => version,
100
- :status => status,
101
- :date => date,
102
- :libpath => libpath
103
- }
104
- end
105
-
106
- end
107
-
108
- end
@@ -1,4 +0,0 @@
1
-
2
- class OverwriteError < Exception
3
- end
4
-
@@ -1,18 +0,0 @@
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
@@ -1,29 +0,0 @@
1
-
2
- module FileTest
3
-
4
- module_function
5
-
6
- # Is a file a command executable?
7
- # TODO: Make more robust (Windows?)
8
-
9
- def bin?(fname)
10
- @command_paths ||= ENV['PATH'].split(/[:;]/)
11
- is_bin = @command_paths.any? do |f|
12
- FileTest.exist?(File.join(f, fname))
13
- end
14
- #is_bin ? File.basename(fname) : false
15
- is_bin ? fname : false
16
- end
17
-
18
- # Is a path considered reasonably "safe"?
19
- # TODO: Make more robust.
20
-
21
- def safe?(path)
22
- case path
23
- when *[ '/', '/*', '/**/*' ]
24
- return false
25
- end
26
- true
27
- end
28
-
29
- end
@@ -1,224 +0,0 @@
1
- #!/usr/bin/env ratch
2
-
3
- # make a release annoucement
4
-
5
- # The announce task generates release announcement and
6
- # optionally emails it via your email provider. (Note
7
- # that TLS is not yet supported as of Ruby 1.8.4.)
8
- # Announcements can also have layouts defined by simple
9
- # templates.
10
- #
11
- # Make a release announcement. Generates and can email a release
12
- # announcements. These are nicely formated message and can
13
- # email the message to the specified address(es).
14
- #
15
- # The following settings apply:
16
- #
17
- # title Project title.
18
- # subtitle Brief one-line description.
19
- # version Project version.
20
- # description Long description of project.
21
- # homepage Project homepage web address.
22
- # slogan Motto for you project.
23
- # memo File that contains announcement message.
24
- # template Custom announcement template file.
25
- # mail_to Email address(es) to send announcemnt.
26
- #
27
- # If <em>mail_to</em> is set then these also apply:
28
- #
29
- # from Message FROM address [email].
30
- # subject Subject of email message ([ANN] title verison).
31
- # server Email server to route message.
32
- # port Email server's port.
33
- # domain Email server's domain name.
34
- # account Email account name [email].
35
- # login Login type: plain, cram_md5 or login.
36
- # secure Uses TLS security, true or false?
37
- #
38
- # A template file can be specified that uses "$setting" as
39
- # substitutes for poject information.
40
-
41
-
42
- # Default layout of release announcement.
43
-
44
- DEFAULT_ANNOUNCE_TEMPLATE = <<-END
45
- $title $version
46
- $subtitle
47
- $homepage
48
-
49
- $summary $description
50
-
51
- $memo
52
-
53
- $slogan
54
- END
55
-
56
-
57
- config = config_load('announce', 'mail')
58
-
59
- if projectinfo
60
- config['from'] ||= projectinfo.email
61
- config['name'] ||= projectinfo.name
62
- config['version'] ||= projectinfo.version
63
- config['title'] ||= projectinfo.title
64
- config['subtitle'] ||= projectinfo.subtitle
65
- config['description'] ||= projectinfo.description
66
- config['homepage'] ||= projectinfo.homepage
67
- config['download'] ||= projectinfo.download
68
- config['slogan'] ||= projectinfo.slogan
69
- end
70
-
71
- config['subject'] ||= "ANN: #{config['title']}, v#{config['version']}"
72
- config['account'] ||= config['mail_from']
73
- #config['mail_to'] = nil if keys['mail_to'].empty?
74
-
75
- # Generate announcement message.
76
- title = config['title']
77
- version = config['version']
78
- template = config['template']
79
- memo = config['memo']
80
-
81
- # Announce template
82
- unless template
83
- files = Dir.glob("{ANN,doc/[aA]nn,doc/ANN}{,.txt}")
84
- template = files.first
85
- end
86
- template = File.read(template) if template
87
- template = template || DEFAULT_ANNOUNCE_TEMPLATE
88
-
89
- # Announce Memo
90
- unless memo
91
- files = Dir.glob("{MEMO,doc/[mM]emo,doc/MEMO}{,.txt}")
92
- memo = files.first
93
- end
94
- memo = File.read(memo).fold(true) if memo
95
-
96
- # Validate
97
- raise ArgumentError, "missing title" unless title
98
- raise ArgumentError, "missing version" unless version
99
-
100
- # Strip tiny version zero.
101
- #if keys['version'] =~ /[.].*?[.]/
102
- # keys['version'] = keys['version'].chomp('.0')
103
- #end
104
-
105
- # Make announcement message
106
- message = template.dup
107
-
108
- message.gsub!('$memo',memo) if memo # insert memo
109
- #message.gsub!('$stamp',stamp.to_s) # insert stamp
110
-
111
- template.scan(/[$].*?\s/m) do |key|
112
- key = key.strip
113
- name = key[1..-1]
114
- value = info.send(name)
115
- message.gsub!(key, value.to_s.strip)
116
- end
117
-
118
- message.gsub!(/(^|[ ])[$].*?(?=[ ]|$)/,'') # remove unused vars
119
- message.gsub!("\n\n\n","\n") # remove any triple blank lines
120
- message.rstrip!
121
-
122
- message = release_announcement(config)
123
-
124
- puts "\n#{message}\n\n"
125
-
126
- return unless keys['to']
127
-
128
- ans = ask("Would you like to email this announcement?", "yN")
129
- case ans.downcase
130
- when 'y', 'yes'
131
- email(message, config)
132
- end
133
-
134
-
135
-
136
-
137
-
138
-
139
-
140
-
141
-
142
-
143
-
144
- # keys = {}
145
- # keys['from'] = info.email
146
- # keys.update info.gather('mail')
147
- # keys.update info.gather('announce')
148
- # keys.update info.select(
149
- # :project, :version, :title, :subtitle, :description,
150
- # :homepage, :download, :slogan
151
- # )
152
- # keys.update override if override
153
-
154
-
155
- # # Get password.
156
- #
157
- # def password( account )
158
- # @password || ENV['PASSWORD'] || ask("Password for #{account}: ")
159
- # end
160
-
161
-
162
- =begin
163
- # Name of project (ie. unix name).
164
- attr_accessor :project
165
-
166
- # Title of project.
167
- attr_accessor :title
168
-
169
- # Subtitle of project.
170
- attr_accessor :subtitle
171
-
172
- # Version number of project release.
173
- attr_accessor :version
174
-
175
- # Description of project.
176
- attr_accessor :description
177
-
178
- # Project's homepage.
179
- attr_accessor :homepage
180
-
181
- # URL to download.
182
- attr_accessor :download
183
-
184
- # Project slogan.
185
- attr_accessor :slogan
186
-
187
- # To email address(es). If this is not set then
188
- # the announcement is not emailed and instead
189
- # is only sent to stdout.
190
- attr_accessor :mail_to
191
-
192
- # From email address.
193
- attr_accessor :mail_from
194
-
195
- # Memo (personalized message for this release)
196
- attr_accessor :memo
197
-
198
- # User defined announcement template.
199
- attr_accessor :template
200
-
201
- # Subject line (default is "ANN: project version").
202
- attr_accessor :subject
203
-
204
- # Email server
205
- attr_accessor :server
206
-
207
- # Emails server port (default is usually correct).
208
- attr_accessor :port
209
-
210
- # Email account name (defaults to mail_from).
211
- attr_accessor :account
212
-
213
- # User domain (not sure why SMTP requires this?)
214
- attr_accessor :domain
215
-
216
- # Login type (plain, login)
217
- attr_accessor :login_type
218
-
219
- # Use TLS/SSL true or false?
220
- attr_accessor :secure
221
-
222
- # Password (deafults to ENV['PASSWORD']
223
- attr_accessor :password
224
- =end
@@ -1,49 +0,0 @@
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
@@ -1,77 +0,0 @@
1
- #!/usr/bin/env ratch
2
-
3
- # Install package to site_ruby.
4
- #
5
- # This script installs Facets to site_ruby location
6
- # using Ruby's defualt configuration settings.
7
- # If you want to change these, you can supply
8
- # configuration settings for 'prefix' and/or 'sitedir'.
9
-
10
- main :install do
11
-
12
- system_prefix = Config::CONFIG['prefix']
13
- system_libdir = Config::CONFIG['sitelibdir']
14
-
15
- config = configuration['install'] || {}
16
-
17
- prefix = config['prefix'] || system_prefix
18
- libdir = config['libdir']
19
-
20
- unless libdir
21
- if (prefix == system_prefix) then
22
- libdir = system_libdir
23
- else
24
- libdir = File.join(prefix, system_libdir[system_prefix.size..-1])
25
- end
26
- end
27
-
28
- # If Rolls is being used.
29
-
30
- if roll_file = File.glob('{,meta/}*.roll').first
31
- roll = Roll::Package.open
32
- lib_paths = roll.lib_paths
33
- else
34
- lib_paths = config['lib_path'] || ['lib']
35
- end
36
-
37
- # We need to copy them into site_ruby in the opposite order they
38
- # would be searched for by require.
39
-
40
- lib_paths.reverse!
41
-
42
- # Copy lib files to site_ruby location, in proper order!
43
-
44
- lib_paths.each do |loc|
45
- files = glob(File.join(loc, "**/*"))
46
- files = files.select{ |f| File.file?(f) }
47
- files.each do |file|
48
- dest = File.dirname(file)
49
- dest.sub!(loc, '')
50
- dest = File.join(libdir, dest)
51
- if noharm?
52
- puts "mkdir -p #{dest}" unless File.directory?(dest)
53
- puts "install -m 0444 #{file} #{dest}"
54
- else
55
- mkdir_p dest unless File.directory?(dest)
56
- install file, dest, :mode => 0444
57
- end
58
- end
59
- end
60
-
61
- # Copy bin files to site_ruby location.
62
-
63
- bin_files = glob("bin/*")
64
- bin_files = bin_files.select{ |f| File.file?(f) }
65
- bin_files.each do |file|
66
- dest = File.dirname(file)
67
- dest = File.join(prefix, dest)
68
- if noharm?
69
- puts "mkdir -p #{dest}" unless File.directory?(dest)
70
- puts "install -m 0555 #{file} #{dest}"
71
- else
72
- mkdir_p dest unless File.directory?(dest)
73
- install file, dest, :mode => 0555
74
- end
75
- end
76
-
77
- end