summaryrefslogtreecommitdiff
path: root/ext/syck/lib/syck/ypath.rb
diff options
context:
space:
mode:
authortenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-08-22 17:43:16 +0000
committertenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-08-22 17:43:16 +0000
commit5571c7315e118b339c6b6590e666dfda68a7327d (patch)
treefcff1492ba18c09a44d2d29431e320591e0ac9c1 /ext/syck/lib/syck/ypath.rb
parentb8910f3751e985d04c2049be3c23c2ef5a9d9ecc (diff)
* ext/syck: removed. Fixes [ruby-core:43360]
* test/syck: removed. * lib/yaml.rb: only require psych, show a warning if people try to set the engine to syck. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36786 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/syck/lib/syck/ypath.rb')
-rw-r--r--ext/syck/lib/syck/ypath.rb54
1 files changed, 0 insertions, 54 deletions
diff --git a/ext/syck/lib/syck/ypath.rb b/ext/syck/lib/syck/ypath.rb
deleted file mode 100644
index 024dcb7f4e..0000000000
--- a/ext/syck/lib/syck/ypath.rb
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# YAML::YPath
-#
-
-warn "#{caller[0]}: YAML::YPath is deprecated" if $VERBOSE
-
-module Syck
-
- class YPath
- attr_accessor :segments, :predicates, :flags
- def initialize( str )
- @segments = []
- @predicates = []
- @flags = nil
- while str =~ /^\/?(\/|[^\/\[]+)(?:\[([^\]]+)\])?/
- @segments.push $1
- @predicates.push $2
- str = $'
- end
- unless str.to_s.empty?
- @segments += str.split( "/" )
- end
- if @segments.length == 0
- @segments.push "."
- end
- end
- def self.each_path( str )
- #
- # Find choices
- #
- paths = []
- str = "(#{ str })"
- while str.sub!( /\(([^()]+)\)/, "\n#{ paths.length }\n" )
- paths.push $1.split( '|' )
- end
-
- #
- # Construct all possible paths
- #
- all = [ str ]
- ( paths.length - 1 ).downto( 0 ) do |i|
- all = all.collect do |a|
- paths[i].collect do |p|
- a.gsub( /\n#{ i }\n/, p )
- end
- end.flatten.uniq
- end
- all.collect do |path|
- yield YPath.new( path )
- end
- end
- end
-
-end