Navigation Menu

Skip to content

Commit

Permalink
Fix indent
Browse files Browse the repository at this point in the history
  • Loading branch information
piroor committed Apr 15, 2015
1 parent 412ca73 commit 07335b4
Show file tree
Hide file tree
Showing 4 changed files with 254 additions and 254 deletions.
64 changes: 32 additions & 32 deletions lib/droonga/catalog/fetcher.rb
Expand Up @@ -22,43 +22,43 @@

module Droonga
module Catalog
class Fetcher
class EmptyResponse < StandardError
end
class Fetcher
class EmptyResponse < StandardError
end

class EmptyCatalog < StandardError
end
class EmptyCatalog < StandardError
end

def initialize(client_options)
@client_options = default_options.merge(client_options)
end
def initialize(client_options)
@client_options = default_options.merge(client_options)
end

def fetch(options={})
message = {
"dataset" => options[:dataset] || Catalog::Dataset::DEFAULT_NAME,
"type" => "catalog.fetch"
}
response = nil
Droonga::Client.open(@client_options) do |client|
response = client.request(message)
def fetch(options={})
message = {
"dataset" => options[:dataset] || Catalog::Dataset::DEFAULT_NAME,
"type" => "catalog.fetch"
}
response = nil
Droonga::Client.open(@client_options) do |client|
response = client.request(message)
end
raise EmptyResponse.new unless response
raise EmptyCatalog.new unless response["body"]
response["body"]
end
raise EmptyResponse.new unless response
raise EmptyCatalog.new unless response["body"]
response["body"]
end

private
def default_options
{
:host => "127.0.0.1",
:port => NodeName::DEFAULT_PORT,
:tag => NodeName::DEFAULT_TAG,
:protocol => :droonga,
:timeout => 1,
:receiver_host => Socket.gethostname,
:receiver_port => 0,
}
private
def default_options
{
:host => "127.0.0.1",
:port => NodeName::DEFAULT_PORT,
:tag => NodeName::DEFAULT_TAG,
:protocol => :droonga,
:timeout => 1,
:receiver_host => Socket.gethostname,
:receiver_port => 0,
}
end
end
end
end
end

0 comments on commit 07335b4

Please sign in to comment.