rubysl-yaml 1.1.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +5 -6
- data/lib/rubysl/yaml/version.rb +1 -1
- data/lib/rubysl/yaml/yaml.rb +53 -417
- data/lib/yaml/dbm.rb +116 -13
- data/lib/yaml/store.rb +45 -2
- data/lib/yaml/syck.rb +44 -35
- data/rubysl-yaml.gemspec +1 -3
- metadata +25 -70
- data/ext/rubysl/syck/bytecode.c +0 -1166
- data/ext/rubysl/syck/emitter.c +0 -1242
- data/ext/rubysl/syck/extconf.rb +0 -5
- data/ext/rubysl/syck/gram.c +0 -1894
- data/ext/rubysl/syck/gram.h +0 -79
- data/ext/rubysl/syck/handler.c +0 -174
- data/ext/rubysl/syck/implicit.c +0 -2990
- data/ext/rubysl/syck/node.c +0 -408
- data/ext/rubysl/syck/rubyext.c +0 -2366
- data/ext/rubysl/syck/st.c +0 -576
- data/ext/rubysl/syck/st.h +0 -72
- data/ext/rubysl/syck/syck.c +0 -504
- data/ext/rubysl/syck/syck.h +0 -458
- data/ext/rubysl/syck/token.c +0 -2725
- data/ext/rubysl/syck/yaml2byte.c +0 -257
- data/ext/rubysl/syck/yamlbyte.h +0 -170
- data/lib/yaml/baseemitter.rb +0 -247
- data/lib/yaml/basenode.rb +0 -216
- data/lib/yaml/constants.rb +0 -45
- data/lib/yaml/encoding.rb +0 -33
- data/lib/yaml/error.rb +0 -34
- data/lib/yaml/loader.rb +0 -14
- data/lib/yaml/rubytypes.rb +0 -409
- data/lib/yaml/stream.rb +0 -40
- data/lib/yaml/stringio.rb +0 -83
- data/lib/yaml/tag.rb +0 -91
- data/lib/yaml/types.rb +0 -192
- data/lib/yaml/yamlnode.rb +0 -54
- data/lib/yaml/ypath.rb +0 -52
data/lib/yaml/ypath.rb
DELETED
@@ -1,52 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# YAML::YPath
|
3
|
-
#
|
4
|
-
|
5
|
-
module YAML
|
6
|
-
|
7
|
-
class YPath
|
8
|
-
attr_accessor :segments, :predicates, :flags
|
9
|
-
def initialize( str )
|
10
|
-
@segments = []
|
11
|
-
@predicates = []
|
12
|
-
@flags = nil
|
13
|
-
while str =~ /^\/?(\/|[^\/\[]+)(?:\[([^\]]+)\])?/
|
14
|
-
@segments.push $1
|
15
|
-
@predicates.push $2
|
16
|
-
str = $'
|
17
|
-
end
|
18
|
-
unless str.to_s.empty?
|
19
|
-
@segments += str.split( "/" )
|
20
|
-
end
|
21
|
-
if @segments.length == 0
|
22
|
-
@segments.push "."
|
23
|
-
end
|
24
|
-
end
|
25
|
-
def YPath.each_path( str )
|
26
|
-
#
|
27
|
-
# Find choices
|
28
|
-
#
|
29
|
-
paths = []
|
30
|
-
str = "(#{ str })"
|
31
|
-
while str.sub!( /\(([^()]+)\)/, "\n#{ paths.length }\n" )
|
32
|
-
paths.push $1.split( '|' )
|
33
|
-
end
|
34
|
-
|
35
|
-
#
|
36
|
-
# Construct all possible paths
|
37
|
-
#
|
38
|
-
all = [ str ]
|
39
|
-
( paths.length - 1 ).downto( 0 ) do |i|
|
40
|
-
all = all.collect do |a|
|
41
|
-
paths[i].collect do |p|
|
42
|
-
a.gsub( /\n#{ i }\n/, p )
|
43
|
-
end
|
44
|
-
end.flatten.uniq
|
45
|
-
end
|
46
|
-
all.collect do |path|
|
47
|
-
yield YPath.new( path )
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
|
-
end
|