lib/tap/support/configurable_class.rb in bahuvrihi-tap-0.10.1 vs lib/tap/support/configurable_class.rb in bahuvrihi-tap-0.10.2
- old
+ new
@@ -55,11 +55,11 @@
# Sets the source_file for base and initializes base.configurations.
def self.extended(base)
caller.each_with_index do |line, index|
case line
when /\/configurable.rb/ then next
- when /^(([A-z]:)?[^:]+):(\d+)/
+ when Lazydoc::CALLER_REGEXP
base.instance_variable_set(:@source_file, File.expand_path($1))
break
end
end
@@ -69,11 +69,11 @@
# When subclassed, the parent.configurations are duplicated and passed to
# the child class where they can be extended/modified without affecting
# the configurations of the parent class.
def inherited(child)
unless child.instance_variable_defined?(:@source_file)
- caller.first =~ /^(([A-z]:)?[^:]+):(\d+)/
+ caller.first =~ Lazydoc::CALLER_REGEXP
child.instance_variable_set(:@source_file, File.expand_path($1))
end
child.instance_variable_set(:@configurations, ClassConfiguration.new(child, @configurations))
super
@@ -248,10 +248,10 @@
# register with Lazydoc so that all extra documentation can be extracted
caller.each do |line|
case line
when /in .config.$/ then next
- when /^(([A-z]:)?[^:]+):(\d+)/
+ when Lazydoc::CALLER_REGEXP
options[:desc] = Lazydoc.register($1, $3.to_i - 1)
break
end
end if options[:desc] == nil
\ No newline at end of file