Method: RSQL::EvalContext#initialize
- Defined in:
- lib/rsql/eval_context.rb
#initialize(options = OpenStruct.new) ⇒ EvalContext
Returns a new instance of EvalContext.
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
# File 'lib/rsql/eval_context.rb', line 42 def initialize(=OpenStruct.new) @opts = @prompt = nil @verbose = @opts.verbose @hexstr_limit = HEXSTR_LIMIT @results = nil @loaded_fns = [] @loaded_fns_state = {} @init_registrations = [] @bangs = {} @global_bangs = {} @registrations = { :version => Registration.new('version', [], {}, method(:version), 'version', 'Version information about RSQL, the client, and the server.'), :help => Registration.new('help', [], {}, method(:help), 'help', 'Show short syntax help.'), :grep => Registration.new('grep', [], {}, method(:grep), 'grep(string_or_regexp, *options)', 'Show results when regular expression matches any part of the content.'), :reload => Registration.new('reload', [], {}, method(:reload), 'reload', 'Reload the rsqlrc file.'), :desc => Registration.new('desc', [], {}, method(:desc), 'desc(name)', 'Describe the content of a recipe.'), :history => Registration.new('history', [], {}, method(:history), 'history(cnt=1)', 'Print recent queries made (request a count or use :all for entire list).'), :set_max_rows => Registration.new('set_max_rows', [], {}, Proc.new{|r| MySQLResults.max_rows = r}, 'set_max_rows(max)', 'Set the maximum number of rows to process.'), :max_rows => Registration.new('max_rows', [], {}, Proc.new{MySQLResults.max_rows}, 'max_rows', 'Get the maximum number of rows to process.'), } end |