turn 0.4.0 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,6 @@
1
+ == 0.5.1 / 2009-03-25
2
+ * fixed a "convert nil into String" error
3
+
1
4
  == 0.4.0 / 2008-09-18
2
5
  * add solo and cross runners
3
6
  * move Colorize into separate file
data/Rakefile CHANGED
@@ -3,7 +3,11 @@ begin
3
3
  require 'bones'
4
4
  Bones.setup
5
5
  rescue LoadError
6
- load 'tasks/setup.rb'
6
+ begin
7
+ load 'tasks/setup.rb'
8
+ rescue LoadError
9
+ raise RuntimeError, '### please install the "bones" gem ###'
10
+ end
7
11
  end
8
12
 
9
13
  task :default => 'test'
@@ -13,12 +17,15 @@ PROJ.summary = 'Test::Unit Reporter (New) -- new output format for Test::Unit'
13
17
  PROJ.authors = 'Tim Pease'
14
18
  PROJ.email = 'tim.pease@gmail.com'
15
19
  PROJ.url = 'http://codeforpeople.rubyforge.org/turn'
16
- PROJ.description = paragraphs_of('README.txt', 1).join("\n\n")
17
- PROJ.version = '0.4.0'
20
+ PROJ.version = '0.5.1'
18
21
 
19
22
  PROJ.rubyforge.name = 'codeforpeople'
20
23
 
21
24
  PROJ.rdoc.exclude << '^lib/'
22
25
  PROJ.rdoc.remote_dir = PROJ.name
23
26
 
27
+ PROJ.ann.email[:server] = 'smtp.gmail.com'
28
+ PROJ.ann.email[:port] = 587
29
+ PROJ.ann.email[:from] = 'Tim Pease'
30
+
24
31
  # EOF
data/VERSION CHANGED
@@ -1 +1 @@
1
- turn 0.5.0 stable (2008-10-13)
1
+ turn 0.5.1 stable (2009-03-25)
@@ -64,7 +64,7 @@ module Console
64
64
  msg << fault.to_s.split("\n")[2..-1].join("\n\t")
65
65
  when ::Test::Unit::Failure
66
66
  @io.puts " #{FAIL}"
67
- msg << fault.location[0] << "\n\t"
67
+ msg << fault.location[0].to_s << "\n\t"
68
68
  msg << fault.message.gsub("\n","\n\t")
69
69
  end
70
70
 
@@ -42,7 +42,7 @@ namespace :ann do
42
42
  desc "Send an email announcement"
43
43
  task :email => ['ann:prereqs', PROJ.ann.file] do
44
44
  ann = PROJ.ann
45
- from = ann.email[:from] || PROJ.email
45
+ from = ann.email[:from] || Array(PROJ.authors).first || PROJ.email
46
46
  to = Array(ann.email[:to])
47
47
 
48
48
  ### build a mail header for RFC 822
@@ -37,8 +37,6 @@ class GemPackageTask < Rake::PackageTask
37
37
  local_setup = File.join(Dir.pwd, %w[tasks setup.rb])
38
38
  if !test(?e, local_setup)
39
39
  Dir.glob(::Bones.path(%w[lib bones tasks *])).each {|fn| bones_files << fn}
40
- gem_spec.files = (gem_spec.files +
41
- bones_files.map {|fn| File.join('tasks', File.basename(fn))}).sort
42
40
  end
43
41
  end
44
42
 
@@ -63,6 +61,10 @@ class GemPackageTask < Rake::PackageTask
63
61
 
64
62
  file package_dir_path => bones_files do
65
63
  mkdir_p package_dir rescue nil
64
+
65
+ gem_spec.files = (gem_spec.files +
66
+ bones_files.map {|fn| File.join('tasks', File.basename(fn))}).sort
67
+
66
68
  bones_files.each do |fn|
67
69
  base_fn = File.join('tasks', File.basename(fn))
68
70
  f = File.join(package_dir_path, base_fn)
@@ -157,6 +159,13 @@ namespace :gem do
157
159
  puts PROJ.gem._spec.to_ruby
158
160
  end
159
161
 
162
+ desc 'Write the gemspec '
163
+ task :spec => 'gem:prereqs' do
164
+ File.open("#{PROJ.name}.gemspec", 'w') do |f|
165
+ f.write PROJ.gem._spec.to_ruby
166
+ end
167
+ end
168
+
160
169
  desc 'Install the gem'
161
170
  task :install => [:clobber, 'gem:package'] do
162
171
  sh "#{SUDO} #{GEM} install --local pkg/#{PROJ.gem._spec.full_name}"
@@ -2,8 +2,8 @@
2
2
  # This file does not define any rake tasks. It is used to load some project
3
3
  # settings if they are not defined by the user.
4
4
 
5
- PROJ.rdoc.exclude << "^#{Regexp.escape(PROJ.manifest_file)}$"
6
5
  PROJ.exclude << ["^#{Regexp.escape(PROJ.ann.file)}$",
6
+ "^#{Regexp.escape(PROJ.ignore_file)}$",
7
7
  "^#{Regexp.escape(PROJ.rdoc.dir)}/",
8
8
  "^#{Regexp.escape(PROJ.rcov.dir)}/"]
9
9
 
@@ -25,12 +25,7 @@ PROJ.description ||= paragraphs_of(PROJ.readme_file, 'description').join("\n\n")
25
25
 
26
26
  PROJ.summary ||= PROJ.description.split('.').first
27
27
 
28
- PROJ.gem.files ||=
29
- if test(?f, PROJ.manifest_file)
30
- files = File.readlines(PROJ.manifest_file).map {|fn| fn.chomp.strip}
31
- files.delete ''
32
- files
33
- else [] end
28
+ PROJ.gem.files ||= manifest
34
29
 
35
30
  PROJ.gem.executables ||= PROJ.gem.files.find_all {|fn| fn =~ %r/^bin/}
36
31
 
@@ -19,10 +19,11 @@ namespace :doc do
19
19
  end
20
20
  rd.rdoc_files.push(*files)
21
21
 
22
- title = "#{PROJ.name}-#{PROJ.version} Documentation"
23
-
22
+ name = PROJ.name
24
23
  rf_name = PROJ.rubyforge.name
25
- title = "#{rf_name}'s " + title if rf_name.valid? and rf_name != title
24
+
25
+ title = "#{name}-#{PROJ.version} Documentation"
26
+ title = "#{rf_name}'s " + title if rf_name.valid? and rf_name != name
26
27
 
27
28
  rd.options << "-t #{title}"
28
29
  rd.options.concat(rdoc.opts)
@@ -4,8 +4,9 @@ require 'rake'
4
4
  require 'rake/clean'
5
5
  require 'fileutils'
6
6
  require 'ostruct'
7
+ require 'find'
7
8
 
8
- class OpenStruct; undef :gem; end
9
+ class OpenStruct; undef :gem if defined? :gem; end
9
10
 
10
11
  # TODO: make my own openstruct type object that includes descriptions
11
12
  # TODO: use the descriptions to output help on the available bones options
@@ -27,8 +28,8 @@ PROJ = OpenStruct.new(
27
28
  :ruby_opts => %w(-w),
28
29
  :libs => [],
29
30
  :history_file => 'History.txt',
30
- :manifest_file => 'Manifest.txt',
31
31
  :readme_file => 'README.txt',
32
+ :ignore_file => '.bnsignore',
32
33
 
33
34
  # Announce
34
35
  :ann => OpenStruct.new(
@@ -62,7 +63,7 @@ PROJ = OpenStruct.new(
62
63
  # File Annotations
63
64
  :notes => OpenStruct.new(
64
65
  :exclude => %w(^tasks/setup\.rb$),
65
- :extensions => %w(.txt .rb .erb) << '',
66
+ :extensions => %w(.txt .rb .erb .rdoc) << '',
66
67
  :tags => %w(FIXME OPTIMIZE TODO)
67
68
  ),
68
69
 
@@ -77,7 +78,7 @@ PROJ = OpenStruct.new(
77
78
  # Rdoc
78
79
  :rdoc => OpenStruct.new(
79
80
  :opts => [],
80
- :include => %w(^lib/ ^bin/ ^ext/ \.txt$),
81
+ :include => %w(^lib/ ^bin/ ^ext/ \.txt$ \.rdoc$),
81
82
  :exclude => %w(extconf\.rb$),
82
83
  :main => nil,
83
84
  :dir => 'doc',
@@ -123,9 +124,7 @@ import(*rakefiles)
123
124
  %w(lib ext).each {|dir| PROJ.libs << dir if test ?d, dir}
124
125
 
125
126
  # Setup some constants
126
- WIN32 = %r/djgpp|(cyg|ms|bcc)win|mingw/ =~ RUBY_PLATFORM unless defined? WIN32
127
-
128
- DEV_NULL = WIN32 ? 'NUL:' : '/dev/null'
127
+ DEV_NULL = File.exist?('/dev/null') ? '/dev/null' : 'NUL:'
129
128
 
130
129
  def quiet( &block )
131
130
  io = [STDOUT.dup, STDERR.dup]
@@ -138,21 +137,15 @@ ensure
138
137
  $stdout, $stderr = STDOUT, STDERR
139
138
  end
140
139
 
141
- DIFF = if WIN32 then 'diff.exe'
142
- else
143
- if quiet {system "gdiff", __FILE__, __FILE__} then 'gdiff'
144
- else 'diff' end
145
- end unless defined? DIFF
140
+ DIFF = if system("gdiff '#{__FILE__}' '#{__FILE__}' > #{DEV_NULL} 2>&1") then 'gdiff'
141
+ else 'diff' end unless defined? DIFF
146
142
 
147
- SUDO = if WIN32 then ''
148
- else
149
- if quiet {system 'which sudo'} then 'sudo'
150
- else '' end
151
- end
143
+ SUDO = if system("which sudo > #{DEV_NULL} 2>&1") then 'sudo'
144
+ else '' end unless defined? SUDO
152
145
 
153
- RCOV = WIN32 ? 'rcov.bat' : 'rcov'
154
- RDOC = WIN32 ? 'rdoc.bat' : 'rdoc'
155
- GEM = WIN32 ? 'gem.bat' : 'gem'
146
+ RCOV = "#{RUBY} -S rcov"
147
+ RDOC = "#{RUBY} -S rdoc"
148
+ GEM = "#{RUBY} -S gem"
156
149
 
157
150
  %w(rcov spec/rake/spectask rubyforge bones facets/ansicode).each do |lib|
158
151
  begin
@@ -254,9 +247,29 @@ end
254
247
  # Scans the current working directory and creates a list of files that are
255
248
  # candidates to be in the manifest.
256
249
  #
257
- def manifest_files
250
+ def manifest
258
251
  files = []
259
- exclude = Regexp.new(PROJ.exclude.join('|'))
252
+ exclude = PROJ.exclude.dup
253
+ comment = %r/^\s*#/
254
+
255
+ # process the ignore file and add the items there to the exclude list
256
+ if test(?f, PROJ.ignore_file)
257
+ ary = []
258
+ File.readlines(PROJ.ignore_file).each do |line|
259
+ next if line =~ comment
260
+ line.chomp!
261
+ line.strip!
262
+ next if line.nil? or line.empty?
263
+
264
+ glob = line =~ %r/\*\./ ? File.join('**', line) : line
265
+ Dir.glob(glob).each {|fn| ary << "^#{Regexp.escape(fn)}"}
266
+ end
267
+ exclude.concat ary
268
+ end
269
+
270
+ # generate a regular expression from the exclude list
271
+ exclude = Regexp.new(exclude.join('|'))
272
+
260
273
  Find.find '.' do |path|
261
274
  path.sub! %r/^(\.\/|\/)/o, ''
262
275
  next unless test ?f, path
@@ -0,0 +1,37 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = %q{turn}
5
+ s.version = "0.5.1"
6
+
7
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
+ s.authors = ["Tim Pease"]
9
+ s.date = %q{2009-03-25}
10
+ s.default_executable = %q{turn}
11
+ s.description = %q{TURN is a new way to view Test::Unit results. With longer running tests, it can be very frustrating to see a failure (....F...) and then have to wait till all the tests finish before you can see what the exact failure was. TURN displays each test on a separate line with failures being displayed immediately instead of at the end of the tests. If you have the 'facets' gem installed, then TURN output will be displayed in wonderful technicolor (but only if your terminal supports ANSI color codes). Well, the only colors are green and red, but that is still color.}
12
+ s.email = %q{tim.pease@gmail.com}
13
+ s.executables = ["turn"]
14
+ s.extra_rdoc_files = ["History.txt", "README.txt", "Release.txt", "bin/turn"]
15
+ s.files = [".gitignore", "History.txt", "README.txt", "Rakefile", "Release.txt", "VERSION", "bin/turn", "lib/turn.rb", "lib/turn/colorize.rb", "lib/turn/command.rb", "lib/turn/components/case.rb", "lib/turn/components/method.rb", "lib/turn/components/suite.rb", "lib/turn/controller.rb", "lib/turn/reporter.rb", "lib/turn/reporters/dot_reporter.rb", "lib/turn/reporters/marshal_reporter.rb", "lib/turn/reporters/outline_reporter.rb", "lib/turn/reporters/progress_reporter.rb", "lib/turn/runners/crossrunner.rb", "lib/turn/runners/isorunner.rb", "lib/turn/runners/loadrunner.rb", "lib/turn/runners/solorunner.rb", "lib/turn/runners/testrunner.rb", "test/test_example.rb", "test/test_sample.rb", "turn.gemspec", "work/quicktest.rb", "work/turn.rb"]
16
+ s.has_rdoc = true
17
+ s.homepage = %q{http://codeforpeople.rubyforge.org/turn}
18
+ s.rdoc_options = ["--main", "README.txt"]
19
+ s.require_paths = ["lib"]
20
+ s.rubyforge_project = %q{codeforpeople}
21
+ s.rubygems_version = %q{1.3.1}
22
+ s.summary = %q{Test::Unit Reporter (New) -- new output format for Test::Unit}
23
+ s.test_files = ["test/test_example.rb", "test/test_sample.rb"]
24
+
25
+ if s.respond_to? :specification_version then
26
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
27
+ s.specification_version = 2
28
+
29
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
30
+ s.add_development_dependency(%q<bones>, [">= 2.4.2"])
31
+ else
32
+ s.add_dependency(%q<bones>, [">= 2.4.2"])
33
+ end
34
+ else
35
+ s.add_dependency(%q<bones>, [">= 2.4.2"])
36
+ end
37
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: turn
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Pease
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-11-27 00:00:00 -07:00
12
+ date: 2009-03-25 00:00:00 -06:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -20,9 +20,9 @@ dependencies:
20
20
  requirements:
21
21
  - - ">="
22
22
  - !ruby/object:Gem::Version
23
- version: 2.1.0
23
+ version: 2.4.2
24
24
  version:
25
- description: "== DESCRIPTION:"
25
+ description: TURN is a new way to view Test::Unit results. With longer running tests, it can be very frustrating to see a failure (....F...) and then have to wait till all the tests finish before you can see what the exact failure was. TURN displays each test on a separate line with failures being displayed immediately instead of at the end of the tests. If you have the 'facets' gem installed, then TURN output will be displayed in wonderful technicolor (but only if your terminal supports ANSI color codes). Well, the only colors are green and red, but that is still color.
26
26
  email: tim.pease@gmail.com
27
27
  executables:
28
28
  - turn
@@ -36,7 +36,6 @@ extra_rdoc_files:
36
36
  files:
37
37
  - .gitignore
38
38
  - History.txt
39
- - Manifest.txt
40
39
  - README.txt
41
40
  - Rakefile
42
41
  - Release.txt
@@ -63,7 +62,6 @@ files:
63
62
  - tasks/bones.rake
64
63
  - tasks/gem.rake
65
64
  - tasks/git.rake
66
- - tasks/manifest.rake
67
65
  - tasks/notes.rake
68
66
  - tasks/post_load.rake
69
67
  - tasks/rdoc.rake
@@ -74,6 +72,7 @@ files:
74
72
  - tasks/test.rake
75
73
  - test/test_example.rb
76
74
  - test/test_sample.rb
75
+ - turn.gemspec
77
76
  - work/quicktest.rb
78
77
  - work/turn.rb
79
78
  has_rdoc: true
@@ -1,29 +0,0 @@
1
- .gitignore
2
- History.txt
3
- Manifest.txt
4
- README.txt
5
- Rakefile
6
- Release.txt
7
- VERSION
8
- bin/turn
9
- lib/turn.rb
10
- lib/turn/colorize.rb
11
- lib/turn/command.rb
12
- lib/turn/components/case.rb
13
- lib/turn/components/method.rb
14
- lib/turn/components/suite.rb
15
- lib/turn/controller.rb
16
- lib/turn/reporter.rb
17
- lib/turn/reporters/dot_reporter.rb
18
- lib/turn/reporters/marshal_reporter.rb
19
- lib/turn/reporters/outline_reporter.rb
20
- lib/turn/reporters/progress_reporter.rb
21
- lib/turn/runners/crossrunner.rb
22
- lib/turn/runners/isorunner.rb
23
- lib/turn/runners/loadrunner.rb
24
- lib/turn/runners/solorunner.rb
25
- lib/turn/runners/testrunner.rb
26
- test/test_example.rb
27
- test/test_sample.rb
28
- work/quicktest.rb
29
- work/turn.rb
@@ -1,48 +0,0 @@
1
-
2
- require 'find'
3
-
4
- namespace :manifest do
5
-
6
- desc 'Verify the manifest'
7
- task :check do
8
- fn = PROJ.manifest_file + '.tmp'
9
- files = manifest_files
10
-
11
- File.open(fn, 'w') {|fp| fp.puts files}
12
- lines = %x(#{DIFF} -du #{PROJ.manifest_file} #{fn}).split("\n")
13
- if HAVE_FACETS_ANSICODE and ENV.has_key?('TERM')
14
- lines.map! do |line|
15
- case line
16
- when %r/^(-{3}|\+{3})/; nil
17
- when %r/^@/; ANSICode.blue line
18
- when %r/^\+/; ANSICode.green line
19
- when %r/^\-/; ANSICode.red line
20
- else line end
21
- end
22
- end
23
- puts lines.compact
24
- rm fn rescue nil
25
- end
26
-
27
- desc 'Create a new manifest'
28
- task :create do
29
- files = manifest_files
30
- unless test(?f, PROJ.manifest_file)
31
- files << PROJ.manifest_file
32
- files.sort!
33
- end
34
- File.open(PROJ.manifest_file, 'w') {|fp| fp.puts files}
35
- end
36
-
37
- task :assert do
38
- files = manifest_files
39
- manifest = File.read(PROJ.manifest_file).split($/)
40
- raise "ERROR: #{PROJ.manifest_file} is out of date" unless files == manifest
41
- end
42
-
43
- end # namespace :manifest
44
-
45
- desc 'Alias to manifest:check'
46
- task :manifest => 'manifest:check'
47
-
48
- # EOF