This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# lib/searchlogic/named_scopes/conditions.rb | |
def method_missing(name, *args, &block) | |
... | |
send(name, *args) | |
... | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# lib/searchlogic/named_scopes/conditions.rb | |
def create_primary_condition(column, condition) | |
... | |
named_scope("#{column}_#{condition}".to_sym, scope_options) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# lib/searchlogic/core_ext/object.rb | |
def searchlogic_lambda(type = :string, options = {}, &block) | |
proc = lambda(&block) | |
proc.searchlogic_options ||= {} | |
proc.searchlogic_options[:type] = type | |
proc.searchlogic_options.merge!(options) | |
proc | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# lib/searchlogic/named_scopes/conditions.rb | |
def method_missing(name, *args, &block) | |
if details = condition_details(name) | |
create_condition(details[:column], details[:condition], args) | |
send(name, *args) | |
elsif boolean_condition?(name) | |
column = name.to_s.gsub(/^not_/, "") | |
named_scope name, :conditions => {column => (name.to_s =~ /^not_/).nil?} | |
send(name) | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
User.username_equals("ben") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# lib/culerity/celerity_server.rb | |
def initialize(_in, _out) | |
... | |
while(true) | |
call, block = eval _in.gets.to_s.strip | |
... | |
unless call.nil? | |
begin | |
result = target(call.first).send call[1], *call[2..-1], &block |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# lib/culerity/celerity_server.rb | |
def initialize(_in, _out) | |
... | |
while(true) | |
call, block = eval _in.gets.to_s.strip | |
... | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[remote_object_id, "link", "Log in"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# lib/culerity/remote_browser_object.rb | |
def send_remote(name, *args, &blk) | |
input = [remote_object_id, %Q{"#{name}"}, *args.map{|a| arg_to_string(a)}] | |
serialized_block = ", #{block_to_string(&blk)}" if block_given? | |
@io << "[[#{input.join(", ")}]#{serialized_block}]\n" | |
process_result @io.gets.to_s.strip | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# lib/culerity/remote_browser_object.rb | |
def method_missing(name, *args, &block) | |
send_remote(name, *args, &block) | |
end |