rails8_db 0.0.12 → 0.0.14
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.
- checksums.yaml +4 -4
- data/app/javascript/rails_db/application.js +32 -44
- data/app/views/layouts/rails_db/application.html.erb +1 -1
- data/lib/rails_db/engine.rb +20 -37
- data/lib/rails_db/version.rb +1 -1
- data/test/dummy/log/test.log +3484 -0
- metadata +69 -69
- /data/app/javascript/codemirror/{codemirror/addons → addons}/comment/comment.js +0 -0
- /data/app/javascript/codemirror/{codemirror/addons → addons}/comment/continuecomment.js +0 -0
- /data/app/javascript/codemirror/{codemirror/addons → addons}/dialog/dialog.css +0 -0
- /data/app/javascript/codemirror/{codemirror/addons → addons}/dialog/dialog.js +0 -0
- /data/app/javascript/codemirror/{codemirror/addons → addons}/display/autorefresh.js +0 -0
- /data/app/javascript/codemirror/{codemirror/addons → addons}/display/fullscreen.css +0 -0
- /data/app/javascript/codemirror/{codemirror/addons → addons}/display/fullscreen.js +0 -0
- /data/app/javascript/codemirror/{codemirror/addons → addons}/display/panel.js +0 -0
- /data/app/javascript/codemirror/{codemirror/addons → addons}/display/placeholder.js +0 -0
- /data/app/javascript/codemirror/{codemirror/addons → addons}/display/rulers.js +0 -0
- /data/app/javascript/codemirror/{codemirror/addons → addons}/edit/closebrackets.js +0 -0
- /data/app/javascript/codemirror/{codemirror/addons → addons}/edit/closetag.js +0 -0
- /data/app/javascript/codemirror/{codemirror/addons → addons}/edit/continuelist.js +0 -0
- /data/app/javascript/codemirror/{codemirror/addons → addons}/edit/matchbrackets.js +0 -0
- /data/app/javascript/codemirror/{codemirror/addons → addons}/edit/matchtags.js +0 -0
- /data/app/javascript/codemirror/{codemirror/addons → addons}/edit/trailingspace.js +0 -0
- /data/app/javascript/codemirror/{codemirror/addons → addons}/fold/brace-fold.js +0 -0
- /data/app/javascript/codemirror/{codemirror/addons → addons}/fold/comment-fold.js +0 -0
- /data/app/javascript/codemirror/{codemirror/addons → addons}/fold/foldcode.js +0 -0
- /data/app/javascript/codemirror/{codemirror/addons → addons}/fold/foldgutter.css +0 -0
- /data/app/javascript/codemirror/{codemirror/addons → addons}/fold/foldgutter.js +0 -0
- /data/app/javascript/codemirror/{codemirror/addons → addons}/fold/indent-fold.js +0 -0
- /data/app/javascript/codemirror/{codemirror/addons → addons}/fold/markdown-fold.js +0 -0
- /data/app/javascript/codemirror/{codemirror/addons → addons}/fold/xml-fold.js +0 -0
- /data/app/javascript/codemirror/{codemirror/addons → addons}/hint/anyword-hint.js +0 -0
- /data/app/javascript/codemirror/{codemirror/addons → addons}/hint/show-hint.css +0 -0
- /data/app/javascript/codemirror/{codemirror/addons → addons}/hint/show-hint.js +0 -0
- /data/app/javascript/codemirror/{codemirror/addons → addons}/hint/sql-hint.js +0 -0
- /data/app/javascript/codemirror/{codemirror/addons → addons}/lint/coffeescript-lint.js +0 -0
- /data/app/javascript/codemirror/{codemirror/addons → addons}/lint/css-lint.js +0 -0
- /data/app/javascript/codemirror/{codemirror/addons → addons}/lint/html-lint.js +0 -0
- /data/app/javascript/codemirror/{codemirror/addons → addons}/lint/javascript-lint.js +0 -0
- /data/app/javascript/codemirror/{codemirror/addons → addons}/lint/json-lint.js +0 -0
- /data/app/javascript/codemirror/{codemirror/addons → addons}/lint/lint.css +0 -0
- /data/app/javascript/codemirror/{codemirror/addons → addons}/lint/lint.js +0 -0
- /data/app/javascript/codemirror/{codemirror/addons → addons}/lint/yaml-lint.js +0 -0
- /data/app/javascript/codemirror/{codemirror/addons → addons}/merge/merge.css +0 -0
- /data/app/javascript/codemirror/{codemirror/addons → addons}/merge/merge.js +0 -0
- /data/app/javascript/codemirror/{codemirror/addons → addons}/mode/loadmode.js +0 -0
- /data/app/javascript/codemirror/{codemirror/addons → addons}/mode/multiplex.js +0 -0
- /data/app/javascript/codemirror/{codemirror/addons → addons}/mode/multiplex_test.js +0 -0
- /data/app/javascript/codemirror/{codemirror/addons → addons}/mode/overlay.js +0 -0
- /data/app/javascript/codemirror/{codemirror/addons → addons}/mode/simple.js +0 -0
- /data/app/javascript/codemirror/{codemirror/addons → addons}/runmode/colorize.js +0 -0
- /data/app/javascript/codemirror/{codemirror/addons → addons}/runmode/runmode-standalone.js +0 -0
- /data/app/javascript/codemirror/{codemirror/addons → addons}/runmode/runmode.js +0 -0
- /data/app/javascript/codemirror/{codemirror/addons → addons}/runmode/runmode.node.js +0 -0
- /data/app/javascript/codemirror/{codemirror/addons → addons}/scroll/annotatescrollbar.js +0 -0
- /data/app/javascript/codemirror/{codemirror/addons → addons}/scroll/scrollpastend.js +0 -0
- /data/app/javascript/codemirror/{codemirror/addons → addons}/scroll/simplescrollbars.css +0 -0
- /data/app/javascript/codemirror/{codemirror/addons → addons}/scroll/simplescrollbars.js +0 -0
- /data/app/javascript/codemirror/{codemirror/addons → addons}/search/jump-to-line.js +0 -0
- /data/app/javascript/codemirror/{codemirror/addons → addons}/search/match-highlighter.js +0 -0
- /data/app/javascript/codemirror/{codemirror/addons → addons}/search/matchesonscrollbar.css +0 -0
- /data/app/javascript/codemirror/{codemirror/addons → addons}/search/matchesonscrollbar.js +0 -0
- /data/app/javascript/codemirror/{codemirror/addons → addons}/search/search.js +0 -0
- /data/app/javascript/codemirror/{codemirror/addons → addons}/search/searchcursor.js +0 -0
- /data/app/javascript/codemirror/{codemirror/addons → addons}/selection/active-line.js +0 -0
- /data/app/javascript/codemirror/{codemirror/addons → addons}/selection/mark-selection.js +0 -0
- /data/app/javascript/codemirror/{codemirror/addons → addons}/selection/selection-pointer.js +0 -0
- /data/app/javascript/codemirror/{codemirror/addons → addons}/tern/tern.css +0 -0
- /data/app/javascript/codemirror/{codemirror/addons → addons}/tern/tern.js +0 -0
- /data/app/javascript/codemirror/{codemirror/addons → addons}/tern/worker.js +0 -0
- /data/app/javascript/codemirror/{codemirror/addons → addons}/wrap/hardwrap.js +0 -0
- /data/app/javascript/codemirror/{codemirror/keymaps → keymaps}/emacs.js +0 -0
- /data/app/javascript/codemirror/{codemirror/keymaps → keymaps}/sublime.js +0 -0
- /data/app/javascript/codemirror/{codemirror/keymaps → keymaps}/vim.js +0 -0
- /data/app/javascript/codemirror/{codemirror/modes → modes}/sql.js +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 35dc6bd2209042247c9ee8e4640715d4ae81c1f20735b3c26b8b607f0441e803
|
4
|
+
data.tar.gz: 0be23991d32463e28e270ac40d1c7b94932b9eeb32308a37a125d02c86956f20
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a7a206b6cc8fc69a8271b5714fc6ccd91ddd0ee1145a0f2658bdc5a3c61d51dfbf4e94b3bc139ffe5195de759a314613fa870bfd679fc803c060a9260ef10ceb
|
7
|
+
data.tar.gz: 696745c09274d7d22018f184bf37ddfa6da2738c85fcf709d3adf78620c99d18a22f0e295cf1bc75f97051bf2d84b229a290f602207a3d35fd094b45647197a9
|
@@ -1,18 +1,31 @@
|
|
1
|
-
// Import all required JavaScript files
|
2
|
-
import "../codemirror/codemirror.js"
|
3
|
-
import "../codemirror/modes/sql.js"
|
4
|
-
import "../codemirror/addons/hint/show-hint.js"
|
5
|
-
import "../codemirror/addons/hint/sql-hint.js"
|
6
|
-
import "./jquery.js"
|
7
|
-
import "./jquery.cookie.js"
|
8
|
-
import "./foundation.min.js"
|
9
|
-
import "./rails-ujs.js"
|
10
|
-
import "./search.js"
|
11
|
-
import "./show_hide_columns.js"
|
12
|
-
import "./sticky.js"
|
13
1
|
|
14
|
-
|
15
|
-
|
2
|
+
$(function(){
|
3
|
+
$(document).foundation();
|
4
|
+
|
5
|
+
jQuery.expr[":"].icontains = jQuery.expr.createPseudo(function (arg) {
|
6
|
+
return function (elem) {
|
7
|
+
return jQuery(elem).text().toUpperCase().indexOf(arg.toUpperCase()) >= 0;
|
8
|
+
};
|
9
|
+
});
|
10
|
+
|
11
|
+
$('body').on('change', '.per_page_pagination_select', function() {
|
12
|
+
$(this).parents('form').submit();
|
13
|
+
});
|
14
|
+
|
15
|
+
$('body').on('keyup', '#rails_db_tables_input', function() {
|
16
|
+
value = $(this).val();
|
17
|
+
$("#rails_db_tables a").show();
|
18
|
+
$("#rails_db_tables a:not(:icontains('" + value + "'))").hide();
|
19
|
+
});
|
20
|
+
|
21
|
+
$('body').on('click', '.expand, .collapse', function() {
|
22
|
+
expand_collapse();
|
23
|
+
save_expand_collapse();
|
24
|
+
return false;
|
25
|
+
});
|
26
|
+
});
|
27
|
+
|
28
|
+
function expand_collapse() {
|
16
29
|
$('#main_content').toggleClass('push-3')
|
17
30
|
$('#main_content').toggleClass('large-9')
|
18
31
|
$('#main_content').toggleClass('large-12')
|
@@ -21,12 +34,13 @@ window.expand_collapse = function() {
|
|
21
34
|
$('.expand').toggle();
|
22
35
|
};
|
23
36
|
|
24
|
-
|
37
|
+
function save_expand_collapse() {
|
25
38
|
$.removeCookie('sidebar_hidden');
|
26
39
|
$.cookie('sidebar_hidden', !$('.expand').is(':visible'), { expires: 30, path: '/' });
|
27
40
|
};
|
28
41
|
|
29
|
-
|
42
|
+
// https://github.com/codemirror/CodeMirror/blob/master/mode/sql/index.html
|
43
|
+
function init_sql_editor(mime, tables) {
|
30
44
|
var editor = CodeMirror.fromTextArea($('#sql').get(0), {
|
31
45
|
mime: mime,
|
32
46
|
hint: CodeMirror.hint.sql,
|
@@ -54,37 +68,11 @@ window.init_sql_editor = function(mime, tables) {
|
|
54
68
|
editor.focus();
|
55
69
|
};
|
56
70
|
|
57
|
-
|
71
|
+
function set_browser_url(url) {
|
58
72
|
if (typeof (history.pushState) != "undefined") {
|
59
73
|
window.history.pushState({"path": url}, '', url);
|
60
74
|
}
|
61
|
-
}
|
62
|
-
|
63
|
-
$(function(){
|
64
|
-
$(document).foundation();
|
65
|
-
|
66
|
-
jQuery.expr[":"].icontains = jQuery.expr.createPseudo(function (arg) {
|
67
|
-
return function (elem) {
|
68
|
-
return jQuery(elem).text().toUpperCase().indexOf(arg.toUpperCase()) >= 0;
|
69
|
-
};
|
70
|
-
});
|
71
|
-
|
72
|
-
$('body').on('change', '.per_page_pagination_select', function() {
|
73
|
-
$(this).parents('form').submit();
|
74
|
-
});
|
75
|
-
|
76
|
-
$('body').on('keyup', '#rails_db_tables_input', function() {
|
77
|
-
value = $(this).val();
|
78
|
-
$("#rails_db_tables a").show();
|
79
|
-
$("#rails_db_tables a:not(:icontains('" + value + "'))").hide();
|
80
|
-
});
|
81
|
-
|
82
|
-
$('body').on('click', '.expand, .collapse', function() {
|
83
|
-
expand_collapse();
|
84
|
-
save_expand_collapse();
|
85
|
-
return false;
|
86
|
-
});
|
87
|
-
});
|
75
|
+
}
|
88
76
|
|
89
77
|
$(window).bind('popstate', function(event) {
|
90
78
|
if (typeof (history.pushState) != "undefined") {
|
@@ -4,7 +4,7 @@
|
|
4
4
|
<title><%= [yield(:title), 'Rails DB'].reject(&:blank?).join(' - ') %></title>
|
5
5
|
<%= stylesheet_link_tag "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.min.css" %>
|
6
6
|
<%= stylesheet_link_tag "rails_db/application" %>
|
7
|
-
<%= javascript_include_tag "rails_db/application"
|
7
|
+
<%= javascript_include_tag "rails_db/application" %>
|
8
8
|
|
9
9
|
<%= csrf_meta_tags %>
|
10
10
|
|
data/lib/rails_db/engine.rb
CHANGED
@@ -1,49 +1,32 @@
|
|
1
1
|
module RailsDb
|
2
2
|
class Engine < ::Rails::Engine
|
3
3
|
isolate_namespace RailsDb
|
4
|
-
config.autoload_paths += Dir["#{config.root}/lib"]
|
4
|
+
config.autoload_paths += Dir["#{config.root}/lib"] # For Ruby code, keep this
|
5
5
|
|
6
|
-
initializer
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
# Configure assets for Propshaft
|
13
|
-
initializer 'rails_db.assets.precompile' do |app|
|
14
|
-
# Add the app/javascript directory to the asset paths
|
15
|
-
app.config.assets.paths << root.join('app', 'javascript')
|
16
|
-
|
17
|
-
# Configure Propshaft to handle JavaScript modules
|
18
|
-
if app.config.respond_to?(:assets) && app.config.assets.respond_to?(:js_compressor)
|
19
|
-
app.config.assets.js_compressor = nil if app.config.assets.js_compressor == :uglifier
|
20
|
-
end
|
6
|
+
initializer "rails_db.assets" do |app|
|
7
|
+
# Check if the host app uses config.assets.paths (like Propshaft)
|
8
|
+
if app.config.respond_to?(:assets) && app.config.assets.respond_to?(:paths)
|
9
|
+
# Add the engine's app/javascript directory to the host app's asset paths
|
10
|
+
# 'config.root' here refers to the engine's root directory
|
11
|
+
app.config.assets.paths << config.root.join("app/javascript")
|
21
12
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
rails_db/jquery.cookie.js
|
27
|
-
rails_db/foundation.min.js
|
28
|
-
rails_db/rails-ujs.js
|
29
|
-
rails_db/search.js
|
30
|
-
rails_db/show_hide_columns.js
|
31
|
-
rails_db/sticky.js
|
32
|
-
codemirror/codemirror.js
|
33
|
-
codemirror/modes/sql.js
|
34
|
-
codemirror/addons/hint/show-hint.js
|
35
|
-
codemirror/addons/hint/sql-hint.js
|
36
|
-
)
|
13
|
+
# Optional: You might also explicitly add app/assets if needed,
|
14
|
+
# although Rails usually adds app/assets/** from engines automatically.
|
15
|
+
# Explicitly adding might help in some edge cases or ensure precedence.
|
16
|
+
# app.config.assets.paths << config.root.join("app/assets")
|
37
17
|
|
38
|
-
|
39
|
-
|
40
|
-
|
18
|
+
# Rails.logger.debug "[RailsDb Engine] Added #{config.root.join('app/javascript')} to asset paths"
|
19
|
+
else
|
20
|
+
# Log a warning if the expected configuration isn't found
|
21
|
+
Rails.logger.warn "[RailsDb Engine] Host application's config.assets.paths not found. Cannot automatically add engine's app/javascript path."
|
41
22
|
end
|
23
|
+
end
|
42
24
|
|
43
|
-
|
44
|
-
|
45
|
-
|
25
|
+
initializer 'rails_db.helpers' do
|
26
|
+
ActiveSupport.on_load :action_view do
|
27
|
+
include RailsDb::Helpers
|
46
28
|
end
|
47
29
|
end
|
30
|
+
|
48
31
|
end
|
49
32
|
end
|
data/lib/rails_db/version.rb
CHANGED