ClsRuby 1.0.0 → 1.0.1
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.
- data/THANKS +1 -0
- data/lib/cls-ruby/tag_any.rb +2 -2
- data/tests/tc_tag_any.rb +31 -0
- metadata +17 -16
data/THANKS
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
Leonid Borisenko (lborisenko at intervale ru)
|
data/lib/cls-ruby/tag_any.rb
CHANGED
data/tests/tc_tag_any.rb
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
$:.unshift File.join( File.dirname( __FILE__ ), '..', 'lib' )
|
2
|
+
|
3
|
+
require 'test/unit'
|
4
|
+
|
5
|
+
require 'cls-ruby'
|
6
|
+
require 'cls-ruby/tag_any'
|
7
|
+
require 'cls-ruby/tag_no_value'
|
8
|
+
|
9
|
+
class Tc_TagAny < Test::Unit::TestCase
|
10
|
+
class TagParent < ClsRuby::TagNoValue
|
11
|
+
child_tag :extensible, ClsRuby::TagAny
|
12
|
+
default_tag_params :name => 'parent'
|
13
|
+
|
14
|
+
def value; @extensible.content; end
|
15
|
+
end #class TagParent
|
16
|
+
|
17
|
+
def test_should_not_fail_on_initializing_as_child_tag
|
18
|
+
assert_nothing_raised { TagParent.new }
|
19
|
+
end
|
20
|
+
|
21
|
+
def test_should_register_self_on_parent_tag
|
22
|
+
tag = TagParent.new
|
23
|
+
cls = '{parent {extension "value"} }'
|
24
|
+
|
25
|
+
ClsRuby.parse_string cls, tag
|
26
|
+
tag_any_content = tag.value
|
27
|
+
|
28
|
+
assert_equal 1, tag_any_content.size
|
29
|
+
assert_instance_of ClsRuby::TagAny::TAG, tag_any_content.first
|
30
|
+
end
|
31
|
+
end
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.0
|
|
3
3
|
specification_version: 1
|
4
4
|
name: ClsRuby
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 1.0.
|
7
|
-
date:
|
6
|
+
version: 1.0.1
|
7
|
+
date: 2008-01-11 00:00:00 +03:00
|
8
8
|
summary: Curl Like Syntax for Ruby language
|
9
9
|
require_paths:
|
10
10
|
- lib
|
@@ -39,6 +39,7 @@ files:
|
|
39
39
|
- tests/tc_parser_simple.rb
|
40
40
|
- tests/tc_scalar_parsers.rb
|
41
41
|
- tests/tc_tag.rb
|
42
|
+
- tests/tc_tag_any.rb
|
42
43
|
- tests/tc_tag_no_value.rb
|
43
44
|
- tests/tc_tag_scalar_int.rb
|
44
45
|
- tests/tc_tag_scalar_nonspace_string.rb
|
@@ -50,13 +51,16 @@ files:
|
|
50
51
|
- tests/tc_tag_vector_of_tags.rb
|
51
52
|
- tests/ts_cls_ruby.rb
|
52
53
|
- lib/cls-ruby
|
53
|
-
- lib/cls-ruby.rb
|
54
54
|
- lib/cls-ruby/basic_scalars.rb
|
55
55
|
- lib/cls-ruby/constraints
|
56
|
+
- lib/cls-ruby/constraints/one_of.rb
|
56
57
|
- lib/cls-ruby/default_formatter.rb
|
57
58
|
- lib/cls-ruby/ex.rb
|
58
59
|
- lib/cls-ruby/formatter.rb
|
59
60
|
- lib/cls-ruby/lexers
|
61
|
+
- lib/cls-ruby/lexers/char_classifier.rb
|
62
|
+
- lib/cls-ruby/lexers/first_stage.rb
|
63
|
+
- lib/cls-ruby/lexers/lexer.rb
|
60
64
|
- lib/cls-ruby/oneline_formatter.rb
|
61
65
|
- lib/cls-ruby/parser.rb
|
62
66
|
- lib/cls-ruby/tag.rb
|
@@ -68,23 +72,16 @@ files:
|
|
68
72
|
- lib/cls-ruby/tag_vector_of_different_tags.rb
|
69
73
|
- lib/cls-ruby/tag_vector_of_tags.rb
|
70
74
|
- lib/cls-ruby/vector_of_tags_impl.rb
|
71
|
-
- lib/cls-ruby
|
72
|
-
- lib/cls-ruby/lexers/char_classifier.rb
|
73
|
-
- lib/cls-ruby/lexers/first_stage.rb
|
74
|
-
- lib/cls-ruby/lexers/lexer.rb
|
75
|
+
- lib/cls-ruby.rb
|
75
76
|
- docs/base_formatting_methods
|
76
77
|
- docs/base_parsing_methods
|
77
78
|
- docs/constructor_params
|
78
79
|
- docs/examples
|
79
|
-
- docs/fragments
|
80
|
-
- docs/principles
|
81
|
-
- docs/std_tags_short_description
|
82
|
-
- docs/syntax
|
83
|
-
- docs/why_cls
|
84
80
|
- docs/examples/log_single_line_format
|
85
81
|
- docs/examples/service_description
|
86
82
|
- docs/examples/sms-hist
|
87
83
|
- docs/examples/tag_any
|
84
|
+
- docs/fragments
|
88
85
|
- docs/fragments/custom_tag_field.rb
|
89
86
|
- docs/fragments/custom_tag_include.rb
|
90
87
|
- docs/fragments/field.cls
|
@@ -94,6 +91,10 @@ files:
|
|
94
91
|
- docs/fragments/tags_order.rb
|
95
92
|
- docs/fragments/tag_field.rb
|
96
93
|
- docs/fragments/tag_message.rb
|
94
|
+
- docs/principles
|
95
|
+
- docs/std_tags_short_description
|
96
|
+
- docs/syntax
|
97
|
+
- docs/why_cls
|
97
98
|
- examples/hex_stream.txt
|
98
99
|
- examples/log_single_line_formatter.rb
|
99
100
|
- examples/service_description.day_time.cfg
|
@@ -122,14 +123,14 @@ extra_rdoc_files:
|
|
122
123
|
- docs/base_parsing_methods
|
123
124
|
- docs/constructor_params
|
124
125
|
- docs/examples
|
125
|
-
- docs/principles
|
126
|
-
- docs/std_tags_short_description
|
127
|
-
- docs/syntax
|
128
|
-
- docs/why_cls
|
129
126
|
- docs/examples/log_single_line_format
|
130
127
|
- docs/examples/service_description
|
131
128
|
- docs/examples/sms-hist
|
132
129
|
- docs/examples/tag_any
|
130
|
+
- docs/principles
|
131
|
+
- docs/std_tags_short_description
|
132
|
+
- docs/syntax
|
133
|
+
- docs/why_cls
|
133
134
|
executables: []
|
134
135
|
|
135
136
|
extensions: []
|