Parent

Launchy::Browser

This class is deprecated and will be removed

Public Class Methods

run( *args ) click to toggle source
   # File lib/launchy/deprecated.rb, line 6
6:     def self.run( *args )
7:       Browser.new.visit( args[0] )
8:     end

Public Instance Methods

visit( url ) click to toggle source
    # File lib/launchy/deprecated.rb, line 10
10:     def visit( url )
11:       _warn "You made a call to a deprecated Launchy API. This call should be changed to 'Launchy.open( uri )'"
12:       report_caller_context( caller )
13: 
14:       ::Launchy.open( url )
15:     end

Private Instance Methods

_warn( msg = "" ) click to toggle source
    # File lib/launchy/deprecated.rb, line 48
48:     def _warn( msg = "" )
49:       warn "WARNING: #{msg}"
50:     end
find_caller_context( stack ) click to toggle source
    # File lib/launchy/deprecated.rb, line 19
19:     def find_caller_context( stack )
20:       caller_file = stack.find do |line|
21:         not line.index( __FILE__ )
22:       end
23:       if caller_file then
24:         caller_fname, caller_line, _ = caller_file.split(":")
25:         if File.readable?( caller_fname ) then
26:           caller_lines = IO.readlines( caller_fname )
27:           context = [ caller_file ]
28:           context << caller_lines[(caller_line.to_i)-3, 5] 
29:           return context.flatten
30:         end
31:       end
32:       return []
33:     end
report_caller_context( stack ) click to toggle source
    # File lib/launchy/deprecated.rb, line 35
35:     def report_caller_context( stack )
36:       context = find_caller_context( stack )
37:       if context.size > 0 then
38:         _warn "I think I was able to find the location that needs to be fixed. Please go look at:"
39:         _warn
40:         context.each do |line|
41:           _warn line.rstrip
42:         end
43:         _warn
44:         _warn "If this is not the case, please file a bug. #{Launchy.bug_report_message}"
45:       end
46:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.