Sha256: 2413d3f6a0672d5f48f4b59130217f404f608d7e7a7618a15acfeec888f8b5a6
Contents?: true
Size: 1.13 KB
Versions: 2
Compression:
Stored size: 1.13 KB
Contents
class LegacyRSpecDescribeHandler < YARD::Handlers::Ruby::Legacy::Base MATCH = /\Adescribe\s+(.+?)\s+(do|\{)/ handles MATCH # I'm not using this logic anymore but if I remove it, nothing works Oo def process objname = statement.tokens.to_s[MATCH, 1].gsub(/["']/, '') obj = {:spec => owner ? (owner[:spec] || "") : ""} obj[:spec] += objname parse_block :owner => obj rescue YARD::Handlers::NamespaceMissingError end end class LegacyRSpecItHandler < YARD::Handlers::Ruby::Legacy::Base MATCH = /\Ait\s+['"](.+?)['"]\s+(do|\{)/ handles MATCH def process example_name = statement.tokens.to_s[MATCH, 1] object_names = example_name.scan(/\[([^\]]+)\]/) example_name_without_objects = example_name.gsub(/\[.+\]/, '').strip return if object_names.empty? object_names.each do |object_name| obj = P(object_name) next if obj.is_a?(Proxy) (obj[:specifications] ||= []) << { :name => example_name_without_objects, :file => parser.file, :line => statement.line, :source => statement.block.to_s } end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
yard-different-rspec-0.1.1 | lib/yard-rspec/legacy.rb |
yard-different-rspec-0.1 | lib/yard-rspec/legacy.rb |