humongous 0.1.6.pre → 0.1.8.beta
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +3 -3
- data/lib/humongous/application.rb +14 -14
- data/lib/humongous/version.rb +1 -1
- metadata +14 -14
data/README.markdown
CHANGED
@@ -42,7 +42,7 @@ Command line options:
|
|
42
42
|
|
43
43
|
## More Info
|
44
44
|
|
45
|
-
For detailed info visit my blog [http://BagwanPankaj.com](http://bagwanpankaj.com)
|
45
|
+
For detailed info visit my blog [http://BagwanPankaj.com](http://bagwanpankaj.com) and/or [http://github.bagwanpankaj.com/humongous/](http://github.bagwanpankaj.com/humongous/)
|
46
46
|
|
47
47
|
For more info write me at me[at]bagwanpankaj.com
|
48
48
|
|
@@ -54,8 +54,8 @@ Currently it only supports Ruby version >= 1.9.2
|
|
54
54
|
|
55
55
|
There are lot of things and area to improve and develop. Since it in pre release now, any bug report, issues and feature request is highly appreciated.
|
56
56
|
|
57
|
-
*
|
58
|
-
*
|
57
|
+
* Error Handling [DONE]
|
58
|
+
* Authentication module [DONE]
|
59
59
|
* Better UI (need a real contribution here)
|
60
60
|
* Better documentation
|
61
61
|
* Example series
|
@@ -5,10 +5,10 @@ module Humongous
|
|
5
5
|
|
6
6
|
class Application < Sinatra::Base
|
7
7
|
DEFAULT_OPTIONS = {
|
8
|
-
url
|
9
|
-
port
|
10
|
-
username
|
11
|
-
password
|
8
|
+
:url => "localhost",
|
9
|
+
:port => "27017",
|
10
|
+
:username => "",
|
11
|
+
:password => ""
|
12
12
|
}
|
13
13
|
|
14
14
|
use Rack::Session::Pool, :expire_after => 2592000
|
@@ -73,7 +73,7 @@ module Humongous
|
|
73
73
|
end
|
74
74
|
|
75
75
|
def default_opts
|
76
|
-
{ skip
|
76
|
+
{ :skip => 0, :limit => 10 }
|
77
77
|
end
|
78
78
|
|
79
79
|
def to_bson( options )
|
@@ -103,9 +103,9 @@ module Humongous
|
|
103
103
|
end
|
104
104
|
|
105
105
|
def from_bson( options )
|
106
|
-
ids = options.
|
107
|
-
ids.each do |
|
108
|
-
options[
|
106
|
+
ids = options.select{ |k,v| v.is_a? BSON::ObjectId }
|
107
|
+
ids.each do | k, v |
|
108
|
+
options[k] = v.to_s
|
109
109
|
end
|
110
110
|
options
|
111
111
|
end
|
@@ -133,21 +133,21 @@ module Humongous
|
|
133
133
|
@database = @connection.db(params[:db_name])
|
134
134
|
@header_string = "Database #{@database.name} (#{@database.collection_names.size}) stats"
|
135
135
|
content_type :json
|
136
|
-
{ collections
|
136
|
+
{ :collections => @database.collection_names, :stats => @database.stats, :header => @header_string }.to_json
|
137
137
|
end
|
138
138
|
|
139
139
|
get "/database/:db_name/collection/:collection_name" do
|
140
140
|
@database = @connection.db(params[:db_name])
|
141
141
|
@collection = @database.collection(params[:collection_name])
|
142
142
|
content_type :json
|
143
|
-
{ stats
|
143
|
+
{ :stats => @collection.stats, :header => "Collection #{@database.name}.#{@collection.name} (#{@collection.stats.count}) stats" }.to_json
|
144
144
|
end
|
145
145
|
|
146
146
|
delete "/database/:db_name/collection/:collection_name" do
|
147
147
|
@database = @connection.db(params[:db_name])
|
148
148
|
if @database.drop_collection(params[:collection_name])
|
149
149
|
content_type :json
|
150
|
-
{ status
|
150
|
+
{ :status => "OK", :dropped => true }.to_json
|
151
151
|
end
|
152
152
|
end
|
153
153
|
|
@@ -178,7 +178,7 @@ module Humongous
|
|
178
178
|
# doc["_id"] = BSON::ObjectId.from_string(doc["_id"])
|
179
179
|
@collection.save(doc)
|
180
180
|
content_type :json
|
181
|
-
{ status
|
181
|
+
{ :status => "OK", :saved => true }.to_json
|
182
182
|
end
|
183
183
|
|
184
184
|
delete "/database/:db_name" do
|
@@ -188,12 +188,12 @@ module Humongous
|
|
188
188
|
|
189
189
|
post "/database" do
|
190
190
|
@connection.db(params["database_name"]).create_collection("test");
|
191
|
-
{ status
|
191
|
+
{ :status => "OK", :created => true, :name => params["database_name"] }.to_json
|
192
192
|
end
|
193
193
|
|
194
194
|
post "/database/:database_name/collection" do
|
195
195
|
@connection.db(params["database_name"]).create_collection(params[:collection_name]);
|
196
|
-
{ status
|
196
|
+
{ :status => "OK", :created => true, :name => params["collection_name"] }.to_json
|
197
197
|
end
|
198
198
|
|
199
199
|
end
|
data/lib/humongous/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: humongous
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8.beta
|
5
5
|
prerelease: 6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2012-01-21 00:00:00.000000000Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: vegas
|
16
|
-
requirement: &
|
16
|
+
requirement: &2160924140 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - =
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 0.1.8
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *2160924140
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: sinatra
|
27
|
-
requirement: &
|
27
|
+
requirement: &2160923660 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - =
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 1.3.2
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *2160923660
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: bson_ext
|
38
|
-
requirement: &
|
38
|
+
requirement: &2160923120 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - =
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: 1.5.2
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *2160923120
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: mongo
|
49
|
-
requirement: &
|
49
|
+
requirement: &2160922380 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - =
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: 1.5.2
|
55
55
|
type: :runtime
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *2160922380
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: json
|
60
|
-
requirement: &
|
60
|
+
requirement: &2160921520 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - =
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: 1.6.5
|
66
66
|
type: :runtime
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *2160921520
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: crack
|
71
|
-
requirement: &
|
71
|
+
requirement: &2160920480 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - =
|
@@ -76,7 +76,7 @@ dependencies:
|
|
76
76
|
version: 0.3.1
|
77
77
|
type: :runtime
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *2160920480
|
80
80
|
description: ! 'Humongous: A Ruby way to browse and maintain mongo instance. Using
|
81
81
|
HTML5.'
|
82
82
|
email: bagwanpankaj@gmail.com
|
@@ -118,7 +118,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
118
118
|
requirements:
|
119
119
|
- - ! '>='
|
120
120
|
- !ruby/object:Gem::Version
|
121
|
-
version: 1.
|
121
|
+
version: 1.8.7
|
122
122
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
123
123
|
none: false
|
124
124
|
requirements:
|