couchup 0.0.11 → 0.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/bin/couchup +5 -1
- data/lib/couchup.rb +1 -1
- data/lib/couchup/commands/map.rb +1 -3
- data/lib/couchup/couchup.rb +6 -0
- data/lib/couchup/mapreduce.rb +7 -3
- data/lib/couchup/version.rb +1 -1
- metadata +2 -2
data/bin/couchup
CHANGED
@@ -29,6 +29,10 @@ OptionParser.new do |opts|
|
|
29
29
|
opts.on("-d", "--database DATABASE", "Database to connect to.") do |db|
|
30
30
|
options[:db] = db
|
31
31
|
end
|
32
|
+
|
33
|
+
opts.on("-b", "--debug", "Show debugging information") do |bug|
|
34
|
+
options[:bug] = bug
|
35
|
+
end
|
32
36
|
|
33
37
|
end.parse!
|
34
38
|
|
@@ -36,7 +40,7 @@ host = options[:host] || 'localhost'
|
|
36
40
|
port = options[:port] || "5984"
|
37
41
|
Couchup::Commands::Connect.new.run(host, port)
|
38
42
|
Couchup::Commands::Use.new.run(options[:db]) unless options[:db].nil?
|
39
|
-
|
43
|
+
Couchup.debug = true if options[:bug]
|
40
44
|
puts "Type help to view the list of things you can do. And Yeah Relax."
|
41
45
|
|
42
46
|
ARGV.clear
|
data/lib/couchup.rb
CHANGED
data/lib/couchup/commands/map.rb
CHANGED
data/lib/couchup/couchup.rb
CHANGED
data/lib/couchup/mapreduce.rb
CHANGED
@@ -19,9 +19,13 @@ module Couchup
|
|
19
19
|
view_params = {:include_docs => true}.merge(options)
|
20
20
|
if params.size == 1
|
21
21
|
val = params.first
|
22
|
-
|
23
|
-
|
24
|
-
|
22
|
+
if val.is_a? Array
|
23
|
+
view_params.merge!(:keys => val)
|
24
|
+
elsif val.is_a? Hash
|
25
|
+
view_params.merge!(val)
|
26
|
+
else
|
27
|
+
view_params.merge!(:key => val) unless val.nil?
|
28
|
+
end
|
25
29
|
end
|
26
30
|
response = Couchup.database.view(name, view_params)
|
27
31
|
rows = response["rows"]
|
data/lib/couchup/version.rb
CHANGED
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: couchup
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.0.
|
5
|
+
version: 0.0.12
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- V Sreekanth
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-02-
|
13
|
+
date: 2011-02-28 00:00:00 +05:30
|
14
14
|
default_executable: ey
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|