tdoc 0.12.1 → 0.12.2

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 (2) hide show
  1. data/bin/tdoc.rb +5 -6
  2. metadata +2 -2
data/bin/tdoc.rb CHANGED
@@ -13,14 +13,13 @@ DEFAULT_FILE=["README#{EXTENSIONS[:tests]}"]
13
13
  START_IRB="IRB.setup nil; IRB.conf[:MAIN_CONTEXT] = IRB::Irb.new.context; require 'irb/ext/multi-irb'; IRB.irb nil, self"
14
14
 
15
15
  def process(files) #called at end of script
16
- if files.class==Array && files.count > 1
16
+ if files.class==Array
17
17
  files.each {|f| system("#{$PROGRAM_NAME} #{f} #{ARGV}")}
18
18
  else
19
- file=files[0]
20
- test_name=File.basename(file).sub(/\..*?$/,'')
19
+ test_name=File.basename(files).sub(/\..*?$/,'')
21
20
  test_case=Class.new(Test::Unit::TestCase)
22
21
  Object.const_set(:"Test#{test_name.capitalize}", test_case)
23
- mk_test_context(files[0], test_case)
22
+ mk_test_context(files, test_case)
24
23
  end
25
24
  end
26
25
  def mk_test_context(file, test_case=nil)
@@ -79,12 +78,12 @@ def mk_test_context(file, test_case=nil)
79
78
  test_case.module_eval {mk_test_context(file).call}
80
79
  process opts[:tests] unless opts[:tests].empty?
81
80
  else
82
- process opts[:tests] unless opts[:tests].empty?
83
81
  context_proc
84
82
  end
85
83
  end
86
84
  if glob=ARGV.shift
87
- process(Dir.glob(glob))
85
+ files=Dir.glob(glob)
86
+ process(files.count > 1 ? files : files[0])
88
87
  else
89
88
  process(DEFAULT_FILE)
90
89
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tdoc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.1
4
+ version: 0.12.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Herb Daily
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2011-11-30 00:00:00 -03:00
12
+ date: 2011-12-05 00:00:00 -03:00
13
13
  default_executable: tdoc.rb
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency