summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/config.rb18
-rw-r--r--lib/couch_stream.rb6
2 files changed, 3 insertions, 21 deletions
diff --git a/lib/config.rb b/lib/config.rb
deleted file mode 100644
index dded140..0000000
--- a/lib/config.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-require 'yaml'
-
-module LeapCA
- class Config
- def initialize(filename)
- file = File.new(filename, 'r')
- @hash = YAML::load(file)
- end
-
- def server
- @hash['server']
- end
-
- def database
- @hash['database']
- end
- end
-end
diff --git a/lib/couch_stream.rb b/lib/couch_stream.rb
index 081688a..ed56db2 100644
--- a/lib/couch_stream.rb
+++ b/lib/couch_stream.rb
@@ -1,6 +1,6 @@
class CouchStream
- def initialize(config)
- @config = config
+ def initialize(database_url)
+ @database_url = database_url
end
def get(path, options)
@@ -14,7 +14,7 @@ class CouchStream
protected
def url_for(path, options = {})
- url = [@config.server, @config.database, path].join('/')
+ url = [@database_url, path].join('/')
url += '?' if options.any?
url += options.map {|k,v| "#{k}=#{v}"}.join('&')
end