mongo_fe 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES.md +5 -0
- data/Gemfile.lock +3 -2
- data/README.md +6 -6
- data/lib/mongo_fe/controllers/collections_controller.rb +1 -17
- data/lib/mongo_fe/version.rb +1 -1
- data/lib/mongo_fe/views/navbar.haml +1 -0
- data/mongo_fe.gemspec +1 -1
- data/spec/controllers/collections_controller_spec.rb +3 -2
- metadata +3 -4
- data/.DS_Store +0 -0
data/CHANGES.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
mongo_fe (0.1.
|
4
|
+
mongo_fe (0.1.1)
|
5
|
+
agnostic-will_paginate (>= 3.0.0)
|
5
6
|
bson
|
6
7
|
bson_ext
|
7
8
|
chronic (~> 0.6.7)
|
@@ -15,7 +16,6 @@ PATH
|
|
15
16
|
sinatra-contrib (~> 1.3.1)
|
16
17
|
tilt (~> 1.3.0)
|
17
18
|
vegas (~> 0.1.11)
|
18
|
-
will_paginate (>= 3.0.0)
|
19
19
|
will_paginate-bootstrap
|
20
20
|
yajl-ruby
|
21
21
|
|
@@ -26,6 +26,7 @@ GEM
|
|
26
26
|
i18n (~> 0.6)
|
27
27
|
multi_json (~> 1.0)
|
28
28
|
addressable (2.2.8)
|
29
|
+
agnostic-will_paginate (3.0.0)
|
29
30
|
appraisal (0.4.1)
|
30
31
|
bundler
|
31
32
|
rake
|
data/README.md
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
This is a simple Sinatra based web front-end that can be used for experimenting and learning MongoDB. The MongoFe gem can also be used for simple administrative tasks, managing collections and document basic operations such as: create new documents, delete existing ones, search by various criteria and document indexing.
|
4
4
|
|
5
|
-
|
5
|
+
### Installation
|
6
6
|
|
7
7
|
$ gem install mongo_fe
|
8
8
|
|
9
|
-
|
9
|
+
### Credentials
|
10
10
|
|
11
11
|
Create a file in your home directory called: `.mongo_fe`
|
12
12
|
|
@@ -18,7 +18,7 @@ Examples:
|
|
18
18
|
|
19
19
|
uri: mongodb://nemo:clownfish@ds02231897.mongolab.com:33897/Reef
|
20
20
|
|
21
|
-
|
21
|
+
### Usage
|
22
22
|
|
23
23
|
Verify first that you have access to a MongoDB instance. [See the install guides](http://www.mongodb.org/display/DOCS/Quickstart/), if need be. I used the [Homebrew](http://mxcl.github.com/homebrew/) package manager to install mongodb. If you have Homebrew, run the following commands:
|
24
24
|
|
@@ -42,7 +42,7 @@ To stop the server:
|
|
42
42
|
|
43
43
|
$ mongofe -K
|
44
44
|
|
45
|
-
|
45
|
+
### Screenshots
|
46
46
|
|
47
47
|
In the mean time, I'd love for you to check out these screenshots to get a feel for MongoFe and see some of the administrative interfaces designed to make your day to day tasks easier.
|
48
48
|
|
@@ -58,7 +58,7 @@ In the mean time, I'd love for you to check out these screenshots to get a feel
|
|
58
58
|
Have fun!
|
59
59
|
|
60
60
|
|
61
|
-
|
61
|
+
### Contributing
|
62
62
|
|
63
63
|
* Fork it
|
64
64
|
* Create your feature branch (``git checkout -b my-new-feature``)
|
@@ -67,6 +67,6 @@ Have fun!
|
|
67
67
|
* Push to the branch (``git push origin my-new-feature``)
|
68
68
|
* Create new Pull Request
|
69
69
|
|
70
|
-
|
70
|
+
### License
|
71
71
|
MIT License
|
72
72
|
|
@@ -201,23 +201,7 @@ module MongoFe
|
|
201
201
|
|
202
202
|
end
|
203
203
|
|
204
|
-
|
205
|
-
@page = params[:page].to_i || 1
|
206
|
-
@query= session[:query]
|
207
|
-
|
208
|
-
begin
|
209
|
-
@total, @documents = MongoFe::MongoDB::SearchDocuments.new(current_db, @collection).list(@query, @page, 10)
|
210
|
-
flash_search_results @query, @total
|
211
|
-
rescue => e
|
212
|
-
session[:query] = nil
|
213
|
-
@total, @documents = MongoFe::MongoDB::SearchDocuments.new(current_db, @collection).list(nil, 1, 10)
|
214
|
-
|
215
|
-
flash[:error] = "Resetting to find all. Cause: #{e.message}"
|
216
|
-
end
|
217
|
-
|
218
|
-
end
|
219
|
-
|
220
|
-
haml :'/collections/index'
|
204
|
+
redirect "/databases/#{current_db.name}/collections/#{@collection.name}"
|
221
205
|
end
|
222
206
|
|
223
207
|
put "/:collection_name/?" do
|
data/lib/mongo_fe/version.rb
CHANGED
data/mongo_fe.gemspec
CHANGED
@@ -26,7 +26,7 @@ Gem::Specification.new do |gem|
|
|
26
26
|
gem.add_runtime_dependency "bson"
|
27
27
|
gem.add_runtime_dependency "bson_ext"
|
28
28
|
gem.add_runtime_dependency "json"
|
29
|
-
gem.add_runtime_dependency 'will_paginate', '>= 3.0.0'
|
29
|
+
gem.add_runtime_dependency 'agnostic-will_paginate', '>= 3.0.0'
|
30
30
|
gem.add_runtime_dependency 'will_paginate-bootstrap'
|
31
31
|
gem.add_runtime_dependency "sinatra", "~> 1.3.2"
|
32
32
|
gem.add_runtime_dependency "sinatra-contrib", "~> 1.3.1"
|
@@ -81,6 +81,7 @@ describe "Collections Controller" do
|
|
81
81
|
describe "POST /databases/:db_name/collections/:collection_name/documents" do
|
82
82
|
it "should insert a new document" do
|
83
83
|
post "/databases/#{db_name}/collections/#{collection_name}/documents", {:json_doc_attributes => test_doc_json}
|
84
|
+
follow_redirect!
|
84
85
|
last_response.body.should contain("added to: #{db_name}.#{collection_name}")
|
85
86
|
# todo verify the Document insertion
|
86
87
|
end
|
@@ -112,7 +113,7 @@ describe "Collections Controller" do
|
|
112
113
|
|
113
114
|
follow_redirect!
|
114
115
|
# "The index: '#{index_name}' was successfully created"
|
115
|
-
index.name = last_response.body[/index: '([^']+)/,1]
|
116
|
+
index.name = last_response.body[/index: '([^']+)/, 1]
|
116
117
|
last_response.body.should contain("was successfully created")
|
117
118
|
end
|
118
119
|
end
|
@@ -134,7 +135,7 @@ describe "Collections Controller" do
|
|
134
135
|
last_response.body.should contain("The index: '#{index.name}', was deleted successfully.")
|
135
136
|
|
136
137
|
indexes = collection.index_information
|
137
|
-
indexes.should_not contain(index.name)
|
138
|
+
indexes.should_not contain(index.name)
|
138
139
|
end
|
139
140
|
end
|
140
141
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mongo_fe
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-07-
|
12
|
+
date: 2012-07-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: hashie
|
@@ -156,7 +156,7 @@ dependencies:
|
|
156
156
|
- !ruby/object:Gem::Version
|
157
157
|
version: '0'
|
158
158
|
- !ruby/object:Gem::Dependency
|
159
|
-
name: will_paginate
|
159
|
+
name: agnostic-will_paginate
|
160
160
|
requirement: !ruby/object:Gem::Requirement
|
161
161
|
none: false
|
162
162
|
requirements:
|
@@ -457,7 +457,6 @@ extra_rdoc_files:
|
|
457
457
|
- LICENSE
|
458
458
|
- README.md
|
459
459
|
files:
|
460
|
-
- .DS_Store
|
461
460
|
- .gitignore
|
462
461
|
- .rspec
|
463
462
|
- CHANGES.md
|
data/.DS_Store
DELETED
Binary file
|