lib/announcer/subscription.rb
##
# Determines the file path of the ruby code defining the subscription.
# It's important that this is called from within the initializer to get the
# desired effect.
Determines the file path of the ruby code defining the subscription.
It's important that this is called from within the initializer to get the
desired effect.
Determines the file path of the ruby code defining the subscription . It ' s important that this is called from within the initializer to get the desired effect .
def _determine_path
      path = File.expand_path('../..', __FILE__)
      non_announcer_caller = caller.find { |c| !c.start_with?(path) }
      unless non_announcer_caller
        raise Errors::SubscriptionError, "Could not find non-Announcer caller"
      end
      non_announcer_caller
    end
def _determine_path path = File . expand_path ( '../..' , __FILE__ ) non_announcer_caller = caller . find { | c | ! c . start_with? ( path ) } unless non_announcer_caller raise Errors :: SubscriptionError , "Could not find non-Announcer caller" end non_announcer_caller end
Determines the file path of the ruby code defining the subscription.
Determines the file path of the ruby code defining the subscription .
# Will be something like: # "/path/to/file.rb:47:in `method_name'" # This is not expected to occur.