mongo_browser 0.1.3 → 0.2.0.rc2
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +3 -0
- data/.travis.yml +3 -3
- data/README.md +1 -25
- data/Rakefile +0 -1
- data/app/assets/images/background.png +0 -0
- data/app/assets/javascripts/app/controllers/alerts.js.coffee +12 -0
- data/app/assets/javascripts/app/controllers/breadcrumbs.js.coffee +25 -0
- data/app/assets/javascripts/app/controllers/collections.js.coffee +40 -0
- data/app/assets/javascripts/app/controllers/databases.js.coffee +39 -0
- data/app/assets/javascripts/app/controllers/documents.js.coffee +49 -0
- data/app/assets/javascripts/app/controllers/main.js.coffee +10 -0
- data/app/assets/javascripts/app/controllers/server_info.js.coffee +14 -0
- data/app/assets/javascripts/app/controllers.js.coffee +2 -0
- data/app/assets/javascripts/app/directives.js.coffee +20 -0
- data/app/assets/javascripts/app/filters.js.coffee +48 -0
- data/app/assets/javascripts/app/modules/dialogs.js.coffee +29 -0
- data/app/assets/javascripts/app/modules/pager.js.coffee +87 -0
- data/app/assets/javascripts/app/modules/table_filter.js.coffee +27 -0
- data/app/assets/javascripts/app/resources.js.coffee +22 -0
- data/app/assets/javascripts/app/services.js.coffee +36 -0
- data/app/assets/javascripts/app.js.coffee +8 -0
- data/app/assets/javascripts/application.js.coffee +35 -6
- data/app/assets/javascripts/templates/.gitkeep +0 -0
- data/app/assets/javascripts/templates.js.coffee +1 -0
- data/app/assets/javascripts/vendor.js.coffee +5 -0
- data/app/assets/stylesheets/application.css.scss +46 -3
- data/app/assets/templates/collections.html +53 -0
- data/app/assets/templates/databases.html +32 -0
- data/app/assets/templates/documents.html +45 -0
- data/app/assets/templates/pager.html +13 -0
- data/app/{views/server_info.erb → assets/templates/server_info.html} +5 -7
- data/app/assets/templates/table_filter.html +10 -0
- data/bin/mongo_browser +8 -45
- data/config-e2e.ru +20 -0
- data/grunt.js +36 -0
- data/lib/mongo_browser/application.rb +143 -64
- data/lib/mongo_browser/middleware/sprockets_base.rb +11 -0
- data/lib/mongo_browser/middleware/sprockets_sinatra.rb +3 -7
- data/lib/mongo_browser/middleware/sprockets_specs.rb +18 -0
- data/lib/mongo_browser/models/collection.rb +67 -0
- data/lib/mongo_browser/models/database.rb +52 -0
- data/lib/mongo_browser/models/document.rb +17 -0
- data/lib/mongo_browser/models/pager.rb +30 -0
- data/lib/mongo_browser/models/server.rb +51 -0
- data/lib/mongo_browser/version.rb +1 -1
- data/lib/mongo_browser.rb +10 -5
- data/mongo_browser.gemspec +4 -11
- data/public/index.html +47 -0
- data/script/ci_all +21 -0
- data/script/ci_e2e +11 -0
- data/script/ci_javascripts +4 -0
- data/script/ci_rspec +3 -0
- data/spec/features/collections_list_spec.rb +6 -49
- data/spec/features/documents_list_spec.rb +15 -14
- data/spec/features/server_info_spec.rb +3 -3
- data/spec/javascripts/app/controllers/alerts_spec.js.coffee +36 -0
- data/spec/javascripts/app/controllers/breadcrumbs_spec.js.coffee +28 -0
- data/spec/javascripts/app/controllers/collections_spec.js.coffee +78 -0
- data/spec/javascripts/app/controllers/databases_spec.js.coffee +55 -0
- data/spec/javascripts/app/controllers/documents_spec.js.coffee +62 -0
- data/spec/javascripts/app/controllers/main_spec.js.coffee +20 -0
- data/spec/javascripts/app/controllers/server_info_spec.js.coffee +21 -0
- data/spec/javascripts/app/directives_spec.js.coffee +58 -0
- data/spec/javascripts/app/filters_spec.js.coffee +99 -0
- data/spec/javascripts/app/modules/dialogs_spec.js.coffee +51 -0
- data/spec/javascripts/app/modules/pager_spec.js.coffee +104 -0
- data/spec/javascripts/app/modules/table_filter_spec.js.coffee +76 -0
- data/spec/javascripts/app/services_spec.js.coffee +83 -0
- data/spec/javascripts/config/testacular-e2e.conf.js +19 -0
- data/spec/javascripts/config/testacular.conf.js +43 -0
- data/spec/javascripts/e2e/collections_scenario.js.coffee +49 -0
- data/spec/javascripts/e2e/databases_scenario.js.coffee +74 -0
- data/spec/javascripts/e2e/documents_scenario.js.coffee +18 -0
- data/spec/javascripts/e2e/server_info_scenario.js.coffee +12 -0
- data/spec/javascripts/helpers/matchers.js.coffee +5 -0
- data/spec/javascripts/helpers/mocks.js.coffee +7 -0
- data/spec/javascripts/helpers_e2e/app_element.js.coffee +6 -0
- data/spec/javascripts/lib/angular-mocks.js +1740 -0
- data/spec/javascripts/lib/angular-scenario.js +26147 -0
- data/spec/javascripts/lib/jasmine-html.js +681 -0
- data/spec/javascripts/lib/jasmine.css +82 -0
- data/spec/javascripts/lib/jasmine.js +2600 -0
- data/spec/javascripts/runner.html +54 -0
- data/spec/javascripts/runner_e2e.html +10 -0
- data/spec/javascripts/spec.js.coffee +2 -0
- data/spec/javascripts/spec_e2e.js.coffee +2 -0
- data/spec/lib/models/collection_spec.rb +80 -0
- data/spec/lib/models/database_spec.rb +75 -0
- data/spec/lib/models/document_spec.rb +17 -0
- data/spec/lib/models/pager_spec.rb +64 -0
- data/spec/lib/models/server_spec.rb +76 -0
- data/spec/lib/mongo_browser_spec.rb +1 -1
- data/spec/spec_helper.rb +2 -19
- data/spec/support/feature_example_group.rb +8 -3
- data/spec/support/fixtures/databases.json +8 -0
- data/spec/support/fixtures.rb +20 -3
- data/spec/support/matchers/have_flash_message.rb +1 -1
- data/spec/support/mongod.rb +37 -21
- data/spec/support/mongodb.conf +47 -0
- data/vendor/assets/javascripts/angular/angular-bootstrap.js +166 -0
- data/vendor/assets/javascripts/angular/angular-resource.js +435 -0
- data/vendor/assets/javascripts/angular/angular-sanitize.js +535 -0
- data/vendor/assets/javascripts/angular/angular.js +14531 -0
- data/vendor/assets/javascripts/underscore.js +1200 -0
- metadata +136 -148
- data/app/assets/javascripts/app/table_filter.js.coffee +0 -50
- data/app/assets/javascripts/ujs.js.coffee +0 -23
- data/app/views/collections/index.erb +0 -59
- data/app/views/databases/index.erb +0 -29
- data/app/views/documents/index.erb +0 -61
- data/app/views/layout/_flash_messages.erb +0 -10
- data/app/views/layout/_navbar.erb +0 -22
- data/app/views/layout.erb +0 -20
- data/app/views/shared/_filter.erb +0 -14
- data/features/mongo_browser.feature +0 -18
- data/features/step_definitions/mongo_browser_steps.rb +0 -1
- data/features/support/env.rb +0 -18
- data/spec/features/databases_list_spec.rb +0 -65
@@ -1,22 +0,0 @@
|
|
1
|
-
<div class="navbar-inner">
|
2
|
-
<div class="container">
|
3
|
-
<a class="brand" href="/">MongoBrowser</a>
|
4
|
-
<div class="nav-collapse collapse">
|
5
|
-
<% if params[:db_name] %>
|
6
|
-
<ul class="nav breadcrumbs">
|
7
|
-
<% unless params[:collection_name] %>
|
8
|
-
<li><a href="#"><%= params[:db_name] %></a></li>
|
9
|
-
<% else %>
|
10
|
-
<li><a href="/databases/<%= params[:db_name] %>"><%= params[:db_name] %></a></li>
|
11
|
-
<li><a href="#"><%= params[:collection_name] %></a></li>
|
12
|
-
<% end %>
|
13
|
-
</ul>
|
14
|
-
<% end %>
|
15
|
-
|
16
|
-
<ul class="nav pull-right">
|
17
|
-
<li><a href="/server_info">Server Info</a></li>
|
18
|
-
<li><a>v. <%= MongoBrowser::VERSION %></a></li>
|
19
|
-
</ul>
|
20
|
-
</div>
|
21
|
-
</div>
|
22
|
-
</div>
|
data/app/views/layout.erb
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<title>Mongo Browser</title>
|
5
|
-
<link href="/assets/application.css" rel="stylesheet" media="screen">
|
6
|
-
</head>
|
7
|
-
<body>
|
8
|
-
<div class="navbar navbar navbar-fixed-top">
|
9
|
-
<%= erb :"layout/_navbar" %>
|
10
|
-
</div>
|
11
|
-
|
12
|
-
<div class="container-fluid">
|
13
|
-
<%= erb :"layout/_flash_messages" %>
|
14
|
-
<%= yield %>
|
15
|
-
</div>
|
16
|
-
|
17
|
-
<script src="/assets/vendor.js"></script>
|
18
|
-
<script src="/assets/application.js"></script>
|
19
|
-
</body>
|
20
|
-
</html>
|
@@ -1,14 +0,0 @@
|
|
1
|
-
<form class="filter" data-filter-for="<%= filter_for %>">
|
2
|
-
<div class="input-append">
|
3
|
-
<input type="text" value="" class="span3" placeholder="<%= placeholder %>">
|
4
|
-
|
5
|
-
<button type="button" class="btn clear">
|
6
|
-
<i class="icon-remove-circle"></i>Clear
|
7
|
-
</button>
|
8
|
-
</div>
|
9
|
-
<span class="help-block">Press ESC to clear the filter</span>
|
10
|
-
</form>
|
11
|
-
|
12
|
-
<div class="filter alert" style="display: none;">
|
13
|
-
Nothing has been found.
|
14
|
-
</div>
|
@@ -1,18 +0,0 @@
|
|
1
|
-
Feature: My bootstrapped app kinda works
|
2
|
-
In order to get going on coding my awesome app
|
3
|
-
I want to have aruba and cucumber setup
|
4
|
-
So I don't have to do it myself
|
5
|
-
|
6
|
-
Scenario: App just runs
|
7
|
-
When I get help for "mongo_browser"
|
8
|
-
Then the exit status should be 0
|
9
|
-
And the banner should be present
|
10
|
-
And the banner should document that this app takes options
|
11
|
-
And the following options should be documented:
|
12
|
-
| --version |
|
13
|
-
| --port |
|
14
|
-
| --mongodb-host |
|
15
|
-
| --mongodb-port |
|
16
|
-
| --demonize |
|
17
|
-
| --log-level |
|
18
|
-
And the banner should document that this app takes no arguments
|
@@ -1 +0,0 @@
|
|
1
|
-
# Put your step definitions here
|
data/features/support/env.rb
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
require 'aruba/cucumber'
|
2
|
-
require 'methadone/cucumber'
|
3
|
-
|
4
|
-
ENV['PATH'] = "#{File.expand_path(File.dirname(__FILE__) + '/../../bin')}#{File::PATH_SEPARATOR}#{ENV['PATH']}"
|
5
|
-
LIB_DIR = File.join(File.expand_path(File.dirname(__FILE__)),'..','..','lib')
|
6
|
-
|
7
|
-
Before do
|
8
|
-
@aruba_timeout_seconds = 10
|
9
|
-
|
10
|
-
# Using "announce" causes massive warnings on 1.9.2
|
11
|
-
@puts = true
|
12
|
-
@original_rubylib = ENV['RUBYLIB']
|
13
|
-
ENV['RUBYLIB'] = LIB_DIR + File::PATH_SEPARATOR + ENV['RUBYLIB'].to_s
|
14
|
-
end
|
15
|
-
|
16
|
-
After do
|
17
|
-
ENV['RUBYLIB'] = @original_rubylib
|
18
|
-
end
|
@@ -1,65 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
describe "Databases list", type: :request do
|
4
|
-
before { visit "/" }
|
5
|
-
|
6
|
-
it "hides the breadcrumb" do
|
7
|
-
expect(page).not_to have_css(".breadcrumb")
|
8
|
-
end
|
9
|
-
|
10
|
-
it "has a valid title" do
|
11
|
-
within "h2" do
|
12
|
-
expect(page).to have_content("localhost databases")
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
it "displays list with available databases" do
|
17
|
-
|
18
|
-
within "table" do
|
19
|
-
expect(page).to have_link("first_database")
|
20
|
-
expect(page).to have_link("second_database")
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
describe "filtering", js: true do
|
25
|
-
it "filters databases by name" do
|
26
|
-
fill_in_filter("first")
|
27
|
-
|
28
|
-
within "table.databases" do
|
29
|
-
expect(page).to have_link("first_database")
|
30
|
-
expect(page).to_not have_link("second_database")
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
it "displays a notification when nothing has been found" do
|
35
|
-
fill_in_filter("third")
|
36
|
-
should_hide_the_table_and_display_a_notification
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
describe "click on delete database button", js: true do
|
41
|
-
it "deletes a database" do
|
42
|
-
click_delete_button_for("second_database")
|
43
|
-
confirm_dialog
|
44
|
-
|
45
|
-
expect(page).to have_flash_message("Database second_database has been deleted.")
|
46
|
-
|
47
|
-
within "table.databases" do
|
48
|
-
expect(page).to have_link("first_database")
|
49
|
-
expect(page).to_not have_link("second_database")
|
50
|
-
end
|
51
|
-
|
52
|
-
click_delete_button_for("first_database")
|
53
|
-
confirm_dialog
|
54
|
-
|
55
|
-
expect(page).to have_flash_message("Database first_database has been deleted.")
|
56
|
-
|
57
|
-
should_hide_the_table_and_display_a_notification
|
58
|
-
end
|
59
|
-
|
60
|
-
def click_delete_button_for(database_name)
|
61
|
-
database_row = find(:xpath, %Q{//table//tr//*[contains(text(), "#{database_name}")]/../..})
|
62
|
-
within(database_row) { click_link "Delete" }
|
63
|
-
end
|
64
|
-
end
|
65
|
-
end
|