gaptool-server 0.2.3 → 0.2.4
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/VERSION +1 -1
- data/gaptool-server.gemspec +4 -2
- data/lib/helpers/init.rb +3 -0
- data/lib/helpers/mongodb.rb +21 -0
- data/lib/routes/init.rb +1 -0
- data/lib/routes/mongodb.rb +7 -0
- metadata +5 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.4
|
data/gaptool-server.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "gaptool-server"
|
8
|
-
s.version = "0.2.
|
8
|
+
s.version = "0.2.4"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Matt Bailey"]
|
12
|
-
s.date = "2013-01-
|
12
|
+
s.date = "2013-01-08"
|
13
13
|
s.description = "gaptool-server for managing cloud resources"
|
14
14
|
s.email = "m@mdb.io"
|
15
15
|
s.executables = ["gaptool-server"]
|
@@ -32,6 +32,7 @@ Gem::Specification.new do |s|
|
|
32
32
|
"lib/app.rb",
|
33
33
|
"lib/helpers/gaptool-base.rb",
|
34
34
|
"lib/helpers/init.rb",
|
35
|
+
"lib/helpers/mongodb.rb",
|
35
36
|
"lib/helpers/nicebytes.rb",
|
36
37
|
"lib/helpers/partials.rb",
|
37
38
|
"lib/helpers/redis.rb",
|
@@ -41,6 +42,7 @@ Gem::Specification.new do |s|
|
|
41
42
|
"lib/public/js/manifest.txt",
|
42
43
|
"lib/routes/init.rb",
|
43
44
|
"lib/routes/main.rb",
|
45
|
+
"lib/routes/mongodb.rb",
|
44
46
|
"lib/routes/redis.rb",
|
45
47
|
"lib/views/hosts.erb",
|
46
48
|
"lib/views/init.erb",
|
data/lib/helpers/init.rb
CHANGED
@@ -0,0 +1,21 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require 'bson_ext'
|
3
|
+
require 'mongo'
|
4
|
+
module MongodbHelpers
|
5
|
+
def collectioncount(dbcollections)
|
6
|
+
@remote_mongodb = Mongo::MongoClient.new(
|
7
|
+
'localhost' || $redis.hget('config', 'remotemongo:host'),
|
8
|
+
27017 || $redis.hget('config', 'remotemongo:port'),
|
9
|
+
)
|
10
|
+
result = Hash.new
|
11
|
+
dbcollections.keys.each do |db|
|
12
|
+
@db = @remote_mongodb[db]
|
13
|
+
count = Hash.new
|
14
|
+
dbcollections[db].each do |collection|
|
15
|
+
count.merge!(collection => @db[collection].stats['count'])
|
16
|
+
end
|
17
|
+
result.merge!(db => count)
|
18
|
+
end
|
19
|
+
return result
|
20
|
+
end
|
21
|
+
end
|
data/lib/routes/init.rb
CHANGED
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: gaptool-server
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.2.
|
5
|
+
version: 0.2.4
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Matt Bailey
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2013-01-
|
13
|
+
date: 2013-01-08 00:00:00 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: sinatra
|
@@ -179,6 +179,7 @@ files:
|
|
179
179
|
- lib/app.rb
|
180
180
|
- lib/helpers/gaptool-base.rb
|
181
181
|
- lib/helpers/init.rb
|
182
|
+
- lib/helpers/mongodb.rb
|
182
183
|
- lib/helpers/nicebytes.rb
|
183
184
|
- lib/helpers/partials.rb
|
184
185
|
- lib/helpers/redis.rb
|
@@ -188,6 +189,7 @@ files:
|
|
188
189
|
- lib/public/js/manifest.txt
|
189
190
|
- lib/routes/init.rb
|
190
191
|
- lib/routes/main.rb
|
192
|
+
- lib/routes/mongodb.rb
|
191
193
|
- lib/routes/redis.rb
|
192
194
|
- lib/views/hosts.erb
|
193
195
|
- lib/views/init.erb
|
@@ -207,7 +209,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
207
209
|
requirements:
|
208
210
|
- - ">="
|
209
211
|
- !ruby/object:Gem::Version
|
210
|
-
hash:
|
212
|
+
hash: -3015715560940527206
|
211
213
|
segments:
|
212
214
|
- 0
|
213
215
|
version: "0"
|