rex 0.0.4 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.rdoc +7 -0
- data/DOCUMENTATION.en.rdoc +215 -0
- data/DOCUMENTATION.ja.rdoc +205 -0
- data/Manifest.txt +37 -0
- data/README.ja +73 -0
- data/README.rdoc +53 -0
- data/Rakefile +28 -0
- data/bin/rex +18 -0
- data/lib/rex.rb +3 -23
- data/lib/rex/generator.rb +523 -0
- data/lib/rex/info.rb +16 -0
- data/lib/rex/rexcmd.rb +136 -0
- data/sample/a.cmd +1 -0
- data/sample/b.cmd +1 -0
- data/sample/c.cmd +4 -0
- data/sample/calc3.racc +47 -0
- data/sample/calc3.rex +15 -0
- data/sample/calc3.rex.rb +94 -0
- data/sample/calc3.tab.rb +188 -0
- data/sample/error1.rex +15 -0
- data/sample/error2.rex +15 -0
- data/sample/sample.html +32 -0
- data/sample/sample.rex +15 -0
- data/sample/sample.rex.rb +100 -0
- data/sample/sample.xhtml +32 -0
- data/sample/sample1.c +9 -0
- data/sample/sample1.rex +43 -0
- data/sample/sample2.bas +4 -0
- data/sample/sample2.rex +33 -0
- data/sample/simple.html +7 -0
- data/sample/simple.xhtml +10 -0
- data/sample/xhtmlparser.racc +66 -0
- data/sample/xhtmlparser.rex +72 -0
- data/test/assets/test.rex +12 -0
- data/test/rex-20060125.rb +152 -0
- data/test/rex-20060511.rb +143 -0
- data/test/test_generator.rb +184 -0
- metadata +74 -57
- data/README +0 -50
- data/lib/rex/array.rb +0 -13
- data/lib/rex/kernel.rb +0 -11
- data/lib/rex/modules/boolean.rb +0 -14
- data/lib/rex/modules/caller_name.rb +0 -15
- data/lib/rex/modules/ordinal.rb +0 -35
- data/lib/rex/modules/propercase.rb +0 -15
- data/lib/rex/modules/roman.rb +0 -41
- data/lib/rex/modules/scrub.rb +0 -66
- data/lib/rex/modules/stacktrace.rb +0 -31
- data/lib/rex/modules/swap.rb +0 -13
- data/lib/rex/modules/to_proc.rb +0 -13
- data/lib/rex/modules/tuple.rb +0 -14
- data/lib/rex/modules/wrap.rb +0 -15
- data/lib/rex/numeric.rb +0 -19
- data/lib/rex/string.rb +0 -21
- data/lib/rex/symbol.rb +0 -13
- data/test/boolean.rb +0 -64
- data/test/caller_name.rb +0 -26
- data/test/ordinal.rb +0 -609
- data/test/propercase.rb +0 -40
- data/test/roman.rb +0 -335
- data/test/scrub.rb +0 -27
- data/test/stacktrace.rb +0 -24
- data/test/swap.rb +0 -44
- data/test/to_proc.rb +0 -24
- data/test/tuple.rb +0 -26
- data/test/wrap.rb +0 -44
data/test/to_proc.rb
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
# to_proc.rb
|
4
|
-
# Symbol#to_proc unit tests
|
5
|
-
|
6
|
-
require 'test/unit'
|
7
|
-
require 'pathname'
|
8
|
-
dir = Pathname.new(File.expand_path(__FILE__)).realpath
|
9
|
-
require File.join(File.dirname(dir.to_s), '../lib/rex')
|
10
|
-
|
11
|
-
class ToProcTests < Test::Unit::TestCase
|
12
|
-
def test_to_proc
|
13
|
-
expected = 5050
|
14
|
-
actual = nil
|
15
|
-
|
16
|
-
assert_nothing_raised do
|
17
|
-
actual = (1..100).inject(&:+)
|
18
|
-
end
|
19
|
-
|
20
|
-
assert_not_nil(actual)
|
21
|
-
assert_equal(Fixnum, actual.class)
|
22
|
-
assert_equal(expected, actual)
|
23
|
-
end
|
24
|
-
end
|
data/test/tuple.rb
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
# tuple.rb
|
4
|
-
# Kernel#Tuple unit tests
|
5
|
-
|
6
|
-
require 'test/unit'
|
7
|
-
|
8
|
-
require 'pathname'
|
9
|
-
dir = Pathname.new(File.expand_path(__FILE__)).realpath
|
10
|
-
require File.join(File.dirname(dir.to_s), '../lib/rex')
|
11
|
-
|
12
|
-
class TupleTests < Test::Unit::TestCase
|
13
|
-
def test_tuple
|
14
|
-
expected = true
|
15
|
-
actual = false
|
16
|
-
|
17
|
-
assert_nothing_raised do
|
18
|
-
t1 = Tuple([1,2,3])
|
19
|
-
t2 = Tuple(1, 3, 4)
|
20
|
-
actual = t1 < t2
|
21
|
-
end
|
22
|
-
|
23
|
-
assert_instance_of(TrueClass, actual)
|
24
|
-
assert_equal(expected, actual)
|
25
|
-
end
|
26
|
-
end
|
data/test/wrap.rb
DELETED
@@ -1,44 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
# wrap.rb
|
4
|
-
# String#wrap unit tests
|
5
|
-
|
6
|
-
require 'test/unit'
|
7
|
-
require 'pathname'
|
8
|
-
dir = Pathname.new(File.expand_path(__FILE__)).realpath
|
9
|
-
require File.join(File.dirname(dir.to_s), '../lib/rex')
|
10
|
-
|
11
|
-
class WrapTests < Test::Unit::TestCase
|
12
|
-
def test_wrap_empty
|
13
|
-
expected = ''
|
14
|
-
actual = nil
|
15
|
-
|
16
|
-
assert_nothing_raised do
|
17
|
-
actual = ''.wrap
|
18
|
-
end
|
19
|
-
|
20
|
-
assert_not_nil(actual)
|
21
|
-
assert_equal(String, actual.class)
|
22
|
-
assert_equal(true, actual.empty?)
|
23
|
-
end
|
24
|
-
|
25
|
-
def test_wrap_data
|
26
|
-
expected_size = 1097
|
27
|
-
actual = nil
|
28
|
-
|
29
|
-
assert_nothing_raised do
|
30
|
-
begin
|
31
|
-
f = File.open("#{File.dirname(__FILE__)}/data/wrap_in.txt", 'r')
|
32
|
-
s = f.readline
|
33
|
-
actual = s.wrap
|
34
|
-
ensure
|
35
|
-
f.close if !f.nil?
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
|
-
assert_not_nil(actual)
|
40
|
-
assert_instance_of(String, actual)
|
41
|
-
assert_equal(false, actual.empty?)
|
42
|
-
assert_equal(expected_size, actual.size)
|
43
|
-
end
|
44
|
-
end
|