tdoc 0.12.1 → 0.12.2
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/tdoc.rb +5 -6
- 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
|
16
|
+
if files.class==Array
|
17
17
|
files.each {|f| system("#{$PROGRAM_NAME} #{f} #{ARGV}")}
|
18
18
|
else
|
19
|
-
|
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
|
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
|
-
|
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.
|
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-
|
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
|