coderay 0.7.2.176 → 0.7.4.196
Sign up to get free protection for your applications and to get access to all the features.
- data/FOLDERS +1 -1
- data/README +16 -9
- data/lib/coderay.rb +2 -2
- data/lib/coderay/encoder.rb +1 -1
- data/lib/coderay/helpers/plugin.rb +4 -4
- data/lib/coderay/scanners/ruby.rb +22 -19
- data/lib/coderay/scanners/ruby/patterns.rb +15 -1
- metadata +64 -87
- data/demo/demo_cache.rb +0 -12
- data/demo/demo_count.rb +0 -10
- data/demo/demo_css.rb +0 -4
- data/demo/demo_div.rb +0 -19
- data/demo/demo_dump.rb +0 -15
- data/demo/demo_encoder.rb +0 -39
- data/demo/demo_global_vars.rb +0 -13
- data/demo/demo_global_vars2.rb +0 -28
- data/demo/demo_highlight.rb +0 -14
- data/demo/demo_html.rb +0 -394
- data/demo/demo_html2.rb +0 -11
- data/demo/demo_html_list.rb +0 -12
- data/demo/demo_load_encoder.rb +0 -25
- data/demo/demo_load_scanner.rb +0 -25
- data/demo/demo_more.rb +0 -205
- data/demo/demo_scanner.rb +0 -36
- data/demo/demo_server.rb +0 -110
- data/demo/demo_simple.rb +0 -10
- data/demo/demo_stream.rb +0 -25
- data/demo/demo_stream2.rb +0 -8
- data/demo/demo_tokens.rb +0 -3
- data/demo/suite.rb +0 -82
data/demo/demo_stream2.rb
DELETED
data/demo/demo_tokens.rb
DELETED
data/demo/suite.rb
DELETED
@@ -1,82 +0,0 @@
|
|
1
|
-
mydir = File.dirname(__FILE__)
|
2
|
-
$:.unshift mydir + '/../lib/'
|
3
|
-
|
4
|
-
$VERBOSE = true
|
5
|
-
|
6
|
-
require 'test/unit'
|
7
|
-
include Test::Unit
|
8
|
-
|
9
|
-
class CodeRaySuite < TestCase
|
10
|
-
|
11
|
-
def self.dir &block
|
12
|
-
@dir ||= File.dirname(__FILE__)
|
13
|
-
if block
|
14
|
-
Dir.chdir @dir, &block
|
15
|
-
end
|
16
|
-
@dir
|
17
|
-
end
|
18
|
-
|
19
|
-
def dir &block
|
20
|
-
self.class.dir(&block)
|
21
|
-
end
|
22
|
-
|
23
|
-
def test_ALL
|
24
|
-
dir do
|
25
|
-
for input in Dir["demo_*.rb"] - %w(demo_server.rb demo_stream.rb)
|
26
|
-
puts "[ testing #{input}... ]"
|
27
|
-
name = File.basename(input, ".rb")
|
28
|
-
output = name + '.out'
|
29
|
-
code = File.open(input, 'rb') { |f| break f.read }
|
30
|
-
|
31
|
-
result = `ruby -wI../lib #{input}`
|
32
|
-
|
33
|
-
if File.exist? output
|
34
|
-
expected = File.read output
|
35
|
-
ok = expected == result
|
36
|
-
computed = output.sub('.out', '.computed')
|
37
|
-
unless ok
|
38
|
-
File.open(computed, 'w') { |f| f.write result }
|
39
|
-
print `gvimdiff #{output} #{computed}` if $DEBUG
|
40
|
-
end
|
41
|
-
assert(ok, "Output error: #{computed} != #{output}") unless $DEBUG
|
42
|
-
else
|
43
|
-
File.open(output, 'w') do |f| f.write result end
|
44
|
-
puts "New test: #{output}"
|
45
|
-
end
|
46
|
-
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
50
|
-
|
51
|
-
end
|
52
|
-
|
53
|
-
require 'test/unit/testsuite'
|
54
|
-
$suite = TestSuite.new 'CodeRay Demos Test'
|
55
|
-
$suite << CodeRaySuite.suite
|
56
|
-
|
57
|
-
def load_suite name
|
58
|
-
begin
|
59
|
-
require name + '/suite.rb'
|
60
|
-
rescue LoadError
|
61
|
-
$stderr.puts <<-ERR
|
62
|
-
|
63
|
-
!! Folder #{File.split(__FILE__).first + '/' + name} not found
|
64
|
-
|
65
|
-
ERR
|
66
|
-
false
|
67
|
-
end
|
68
|
-
end
|
69
|
-
|
70
|
-
if subsuite = ARGV.find { |a| break $1 if a[/^([^-].*)/] }
|
71
|
-
load_suite(subsuite) or exit
|
72
|
-
else
|
73
|
-
Dir[mydir + '/*/'].each { |suite| load_suite suite }
|
74
|
-
end
|
75
|
-
|
76
|
-
if ARGV.include? '-f'
|
77
|
-
require 'test/unit/ui/fox/testrunner'
|
78
|
-
UI::Fox::TestRunner.run $suite
|
79
|
-
else
|
80
|
-
require 'test/unit/ui/console/testrunner'
|
81
|
-
UI::Console::TestRunner.run $suite
|
82
|
-
end
|