summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAzul <azul@riseup.net>2012-09-11 13:02:27 +0200
committerAzul <azul@riseup.net>2012-09-11 13:02:27 +0200
commitc0fc5ac5b5d955b1789a58153952e43bb7052b07 (patch)
treefd9b3e98cd9c75c09b33c4ee8e8af3996309abb4 /lib
parentc331d70638c35d807128e39a9958cab5ba4eeb25 (diff)
configuring couchDB the CouchRest way and using that for tracking
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