zentest-without-autotest 4.3.2 → 4.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.
@@ -1,3 +1,26 @@
1
+ === 4.4.0 / 2010-09-01
2
+
3
+ * 1 major enhancement:
4
+
5
+ * Removed git building. I'm dropping direct support for rubinius.
6
+
7
+ * 3 minor enhancements:
8
+
9
+ * Added multiruby mri:list:x.y.z command so you can see what's available.
10
+ * Enabled installing specific patch versions of ruby.
11
+ * multiruby rubygems:update now forces a build to be less confusing.
12
+
13
+ * 1 bug fix:
14
+
15
+ * Removed redundant test_to_normal, now in zentest_mappings
16
+
17
+ === 4.3.3 / 2010-06-17
18
+
19
+ * 2 minor enhancements:
20
+
21
+ * Added options and removed pattern from Autotest::RCov
22
+ * update_rubygems now deletes cached rubygems installs
23
+
1
24
  === 4.3.2 / 2010-06-02
2
25
 
3
26
  * 1 minor enhancement:
data/VERSION CHANGED
@@ -1 +1 @@
1
- 4.3.2
1
+ 4.4.0
@@ -30,6 +30,7 @@ ARGV.each do |spec|
30
30
  Multiruby.merge_rubygems
31
31
  when "rubygems:update", "update:rubygems" then
32
32
  Multiruby.update_rubygems
33
+ ARGV << "build"
33
34
  when "update" then
34
35
  Multiruby.update
35
36
  when "tags" then
@@ -57,6 +58,12 @@ ARGV.each do |spec|
57
58
  ARGV << "build"
58
59
  when /mri:svn:tag:(.*)/ then
59
60
  ARGV << "mri:svn:tag:#{$1}:#{$1}" << "build"
61
+ when /mri:list:(.*)/ then
62
+ v = $1
63
+ ver = v[/\d+\.\d+/]
64
+ url = "#{Multiruby::RUBY_URL}/#{ver}/"
65
+
66
+ puts Multiruby.matching_versions(url, v).join("\n")
60
67
  when /mri:tar:(.*)/ then
61
68
  Multiruby.fetch_tar $1
62
69
  ARGV << "build"
@@ -10,12 +10,7 @@ if defined? $v then
10
10
  end
11
11
 
12
12
  if defined? $h then
13
- puts "usage: #{File.basename $0} [-h -v] test-and-implementation-files..."
14
- puts " -h display this information"
15
- puts " -v display version information"
16
- puts " -r Reverse mapping (ClassTest instead of TestClass)"
17
- puts " -e (Rapid XP) eval the code generated instead of printing it"
18
- exit 0
13
+ ZenTest.usage_with_exit
19
14
  end
20
15
 
21
16
  code = ZenTest.fix(*ARGV)
@@ -123,7 +123,7 @@ module Multiruby
123
123
  def self.clean
124
124
  self.each_scm_build_dir do |style|
125
125
  case style
126
- when :svn, :git then
126
+ when :svn then
127
127
  if File.exist? "Rakefile" then
128
128
  run "rake clean"
129
129
  elsif File.exist? "Makefile" then
@@ -140,9 +140,8 @@ module Multiruby
140
140
  Dir["*"].each do |dir|
141
141
  next unless File.directory? dir
142
142
  Dir.chdir dir do
143
- if File.exist?(".svn") || File.exist?(".git") then
144
- scm = File.exist?(".svn") ? :svn : :git
145
- yield scm
143
+ if File.exist?(".svn") then
144
+ yield :svn
146
145
  else
147
146
  yield :none
148
147
  end
@@ -151,23 +150,31 @@ module Multiruby
151
150
  end
152
151
  end
153
152
 
154
- def self.extract_latest_version url, matching=nil
153
+ def self.matching_versions url, matching=nil
155
154
  file = URI.parse(url).read
156
- versions = file.scan(/href="(ruby.*tar.gz)"/).flatten.reject { |s|
157
- s =~ /-rc\d/
158
- }.sort_by { |s|
159
- s.split(/\D+/).map { |i| i.to_i }
160
- }.flatten
155
+
156
+ map = {
157
+ "preview" => "beta",
158
+ "rc" => "beta2",
159
+ "p" => "release",
160
+ "tar" => "aargh",
161
+ "gz" => "aargh",
162
+ }
163
+
164
+ versions = file.scan(/href="(ruby.*tar.gz)"/).flatten.sort_by { |s|
165
+ s.scan(/\d+|[a-z]+/).map { |a| Integer(a) rescue map[a] || a }
166
+ }
161
167
 
162
168
  versions = versions.grep(/#{Regexp.escape(matching)}/) if matching
163
- versions.last
169
+
170
+ versions
164
171
  end
165
172
 
166
173
  def self.fetch_tar v
167
174
  in_versions_dir do
168
175
  warn " Determining latest version for #{v}"
169
176
  ver = v[/\d+\.\d+/]
170
- base = extract_latest_version("#{RUBY_URL}/#{ver}/", v)
177
+ base = matching_versions("#{RUBY_URL}/#{ver}/", v).last
171
178
  abort "Could not determine release for #{v}" unless base
172
179
  url = File.join RUBY_URL, ver, base
173
180
  unless File.file? base then
@@ -181,13 +188,6 @@ module Multiruby
181
188
  end
182
189
  end
183
190
 
184
- def self.git_clone url, dir
185
- Multiruby.in_versions_dir do
186
- Multiruby.run "git clone #{url} #{dir}" unless File.directory? dir
187
- FileUtils.ln_sf "../versions/#{dir}", "../build/#{dir}"
188
- end
189
- end
190
-
191
191
  def self.gnu_utils_build inst_dir
192
192
  run "autoconf" unless test ?f, "configure"
193
193
  run "./configure --enable-shared --prefix #{inst_dir}", "log.configure" unless
@@ -201,31 +201,31 @@ module Multiruby
201
201
  end
202
202
 
203
203
  def self.in_build_dir
204
- Dir.chdir File.join(self.root_dir, "build") do
204
+ in_root_dir "build" do
205
205
  yield
206
206
  end
207
207
  end
208
208
 
209
209
  def self.in_install_dir
210
- Dir.chdir File.join(self.root_dir, "install") do
210
+ in_root_dir "install" do
211
211
  yield
212
212
  end
213
213
  end
214
214
 
215
- def self.in_root_dir
216
- Dir.chdir self.root_dir do
215
+ def self.in_root_dir subdir = ""
216
+ Dir.chdir File.join(self.root_dir, subdir) do
217
217
  yield
218
218
  end
219
219
  end
220
220
 
221
221
  def self.in_tmp_dir
222
- Dir.chdir File.join(self.root_dir, "tmp") do
222
+ in_root_dir "tmp" do
223
223
  yield
224
224
  end
225
225
  end
226
226
 
227
227
  def self.in_versions_dir
228
- Dir.chdir File.join(self.root_dir, "versions") do
228
+ in_root_dir "versions" do
229
229
  yield
230
230
  end
231
231
  end
@@ -370,13 +370,6 @@ module Multiruby
370
370
  else
371
371
  warn " update in this svn dir not supported yet: #{dir}"
372
372
  end
373
- when :git then
374
- case dir
375
- when /rubinius/ then
376
- run "rake git:update build" # minor cheat by building here
377
- else
378
- warn " update in this git dir not supported yet: #{dir}"
379
- end
380
373
  else
381
374
  warn " update in non-svn dir not supported yet: #{dir}"
382
375
  end
@@ -419,20 +419,6 @@ class ZenTest
419
419
  end # @klasses[klassname]
420
420
  end
421
421
 
422
- def test_to_normal(_name, klassname=nil)
423
- super do |name|
424
- if defined? @inherited_methods then
425
- known_methods = (@inherited_methods[klassname] || {}).keys.sort.reverse
426
- known_methods_re = known_methods.map {|s| Regexp.escape(s) }.join("|")
427
-
428
- name = name.sub(/^(#{known_methods_re})(_.*)?$/) { $1 } unless
429
- known_methods_re.empty?
430
-
431
- name
432
- end
433
- end
434
- end
435
-
436
422
  # create a given method at a given
437
423
  # indentation. Returns an array containing
438
424
  # the lines of the method.
@@ -538,10 +524,51 @@ class ZenTest
538
524
  return @result.join("\n")
539
525
  end
540
526
 
527
+ # Provide a certain amount of help.
528
+ def self.usage
529
+ puts <<-EO_USAGE
530
+ usage: #{File.basename $0} [options] test-and-implementation-files...
531
+
532
+ ZenTest scans your target and unit-test code and writes your missing
533
+ code based on simple naming rules, enabling XP at a much quicker
534
+ pace. ZenTest only works with Ruby and Test::Unit.
535
+
536
+ ZenTest uses the following rules to figure out what code should be
537
+ generated:
538
+
539
+ * Definition:
540
+ * CUT = Class Under Test
541
+ * TC = Test Class (for CUT)
542
+ * TC's name is the same as CUT w/ "Test" prepended at every scope level.
543
+ * Example: TestA::TestB vs A::B.
544
+ * CUT method names are used in CT, with "test_" prependend and optional "_ext" extensions for differentiating test case edge boundaries.
545
+ * Example:
546
+ * A::B#blah
547
+ * TestA::TestB#test_blah_normal
548
+ * TestA::TestB#test_blah_missing_file
549
+ * All naming conventions are bidirectional with the exception of test extensions.
550
+
551
+ options:
552
+ -h display this information
553
+ -v display version information
554
+ -r Reverse mapping (ClassTest instead of TestClass)
555
+ -e (Rapid XP) eval the code generated instead of printing it
556
+
557
+ EO_USAGE
558
+ end
559
+
560
+ # Give help, then quit.
561
+ def self.usage_with_exit
562
+ self.usage
563
+ exit 0
564
+ end
565
+
541
566
  # Runs ZenTest over all the supplied files so that
542
567
  # they are analysed and the missing methods have
543
568
  # skeleton code written.
569
+ # If no files are supplied, splutter out some help.
544
570
  def self.fix(*files)
571
+ ZenTest.usage_with_exit if files.empty?
545
572
  zentest = ZenTest.new
546
573
  zentest.scan_files(*files)
547
574
  zentest.analyze
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{zentest-without-autotest}
8
- s.version = "4.3.2"
8
+ s.version = "4.4.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Ryan Davis"]
12
- s.date = %q{2010-06-06}
12
+ s.date = %q{2010-09-29}
13
13
  s.executables = ["multigem", "zentest", "multiruby", "multiruby_setup"]
14
14
  s.extra_rdoc_files = [
15
15
  "README.markdown"
metadata CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 4
7
- - 3
8
- - 2
9
- version: 4.3.2
7
+ - 4
8
+ - 0
9
+ version: 4.4.0
10
10
  platform: ruby
11
11
  authors:
12
12
  - Ryan Davis
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-06-06 00:00:00 +02:00
17
+ date: 2010-09-29 00:00:00 +02:00
18
18
  default_executable:
19
19
  dependencies: []
20
20