blazer 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of blazer might be problematic. Click here for more details.
- checksums.yaml +7 -0
- data/.gitignore +14 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +144 -0
- data/Rakefile +2 -0
- data/app/assets/javascripts/blazer/ace/ace.js +11 -0
- data/app/assets/javascripts/blazer/ace/ext-language_tools.js +5 -0
- data/app/assets/javascripts/blazer/ace/mode-sql.js +1 -0
- data/app/assets/javascripts/blazer/ace/snippets/sql.js +1 -0
- data/app/assets/javascripts/blazer/ace/snippets/text.js +1 -0
- data/app/assets/javascripts/blazer/ace/theme-twilight.js +1 -0
- data/app/assets/javascripts/blazer/application.js +15 -0
- data/app/assets/javascripts/blazer/daterangepicker.js +1026 -0
- data/app/assets/javascripts/blazer/highlight.pack.js +1 -0
- data/app/assets/javascripts/blazer/jquery.js +10308 -0
- data/app/assets/javascripts/blazer/jquery.stickytableheaders.js +263 -0
- data/app/assets/javascripts/blazer/jquery_ujs.js +469 -0
- data/app/assets/javascripts/blazer/list.js +1474 -0
- data/app/assets/javascripts/blazer/moment.js +2400 -0
- data/app/assets/javascripts/blazer/selectize.js +3477 -0
- data/app/assets/javascripts/blazer/stupidtable.js +114 -0
- data/app/assets/stylesheets/blazer/application.css +66 -0
- data/app/assets/stylesheets/blazer/bootstrap.css +6203 -0
- data/app/assets/stylesheets/blazer/bootstrap.css.map +1 -0
- data/app/assets/stylesheets/blazer/daterangepicker-bs3.css +267 -0
- data/app/assets/stylesheets/blazer/github.css +126 -0
- data/app/assets/stylesheets/blazer/selectize.default.css +386 -0
- data/app/controllers/blazer/queries_controller.rb +216 -0
- data/app/helpers/blazer/queries_helper.rb +21 -0
- data/app/models/blazer/audit.rb +5 -0
- data/app/models/blazer/connection.rb +5 -0
- data/app/models/blazer/query.rb +13 -0
- data/app/views/blazer/queries/_form.html.erb +84 -0
- data/app/views/blazer/queries/edit.html.erb +1 -0
- data/app/views/blazer/queries/index.html.erb +47 -0
- data/app/views/blazer/queries/new.html.erb +1 -0
- data/app/views/blazer/queries/run.html.erb +50 -0
- data/app/views/blazer/queries/show.html.erb +138 -0
- data/app/views/layouts/blazer/application.html.erb +17 -0
- data/blazer.gemspec +25 -0
- data/config/routes.rb +6 -0
- data/lib/blazer/engine.rb +11 -0
- data/lib/blazer/version.rb +3 -0
- data/lib/blazer.rb +16 -0
- data/lib/generators/blazer/install_generator.rb +33 -0
- data/lib/generators/blazer/templates/config.yml +8 -0
- data/lib/generators/blazer/templates/install.rb +17 -0
- metadata +134 -0
@@ -0,0 +1,84 @@
|
|
1
|
+
<% if @query.errors.any? %>
|
2
|
+
<div class="alert alert-danger"><%= @query.errors.full_messages.first %></div>
|
3
|
+
<% end %>
|
4
|
+
|
5
|
+
<%= form_for @query, html: {class: "the_form", autocomplete: "off"} do |f| %>
|
6
|
+
<div class="row">
|
7
|
+
<div class="col-xs-8">
|
8
|
+
<div class= "form-group">
|
9
|
+
<%= f.hidden_field :statement %>
|
10
|
+
<div id="editor-container">
|
11
|
+
<div id="editor"><%= @query.statement %></div>
|
12
|
+
</div>
|
13
|
+
</div>
|
14
|
+
<div class="form-group text-right">
|
15
|
+
<div class="pull-left" style="margin-top: 6px;">
|
16
|
+
<%= link_to "Back", :back %>
|
17
|
+
<span class="text-muted" style="margin-left: 20px;"> Use {start_time} and {end_time} for time ranges</span>
|
18
|
+
</div>
|
19
|
+
<%= select_tag :table_names, options_for_select([["Preview table", nil]] + tables.keys), style: "margin-right: 20px; width: 240px;" %>
|
20
|
+
<%= link_to "Run", "#", class: "btn btn-info", id: "run", style: "vertical-align: top;" %>
|
21
|
+
</div>
|
22
|
+
</div>
|
23
|
+
<div class="col-xs-4">
|
24
|
+
<div class="form-group">
|
25
|
+
<%= f.text_field :name, placeholder: "Name", class: "form-control" %>
|
26
|
+
</div>
|
27
|
+
<div class="form-group">
|
28
|
+
<%= f.text_area :description, placeholder: "Optional description", style: "height: 70px;", class: "form-control" %>
|
29
|
+
</div>
|
30
|
+
<div class="text-right">
|
31
|
+
<% if @query.persisted? %>
|
32
|
+
<%= link_to "Delete", query_path(@query), method: :delete, "data-confirm" => "Are you sure?", class: "btn btn-danger" %>
|
33
|
+
<% end %>
|
34
|
+
<%= f.submit "Save", class: "btn btn-success" %>
|
35
|
+
</div>
|
36
|
+
</div>
|
37
|
+
</div>
|
38
|
+
<% end %>
|
39
|
+
|
40
|
+
<div id="results"></div>
|
41
|
+
|
42
|
+
<script>
|
43
|
+
var editor = ace.edit("editor");
|
44
|
+
editor.setTheme("ace/theme/twilight");
|
45
|
+
editor.getSession().setMode("ace/mode/sql");
|
46
|
+
editor.setOptions({
|
47
|
+
enableBasicAutocompletion: false,
|
48
|
+
enableSnippets: false,
|
49
|
+
enableLiveAutocompletion: false,
|
50
|
+
highlightActiveLine: false,
|
51
|
+
fontSize: 12
|
52
|
+
});
|
53
|
+
editor.renderer.setShowGutter(false);
|
54
|
+
editor.renderer.setPrintMarginColumn(false);
|
55
|
+
editor.renderer.setPadding(10);
|
56
|
+
editor.getSession().setUseWrapMode(true);
|
57
|
+
$("#editor").show();
|
58
|
+
|
59
|
+
$("#run").click( function (e) {
|
60
|
+
e.preventDefault();
|
61
|
+
$("#results").html('<p class="text-muted">Loading...</p>');
|
62
|
+
$.post("<%= run_queries_path %>", {statement: editor.getValue()}, function (data) {
|
63
|
+
$("#results").html(data);
|
64
|
+
});
|
65
|
+
});
|
66
|
+
|
67
|
+
if ($("#query_statement").val() != "") {
|
68
|
+
$("#run").click();
|
69
|
+
}
|
70
|
+
|
71
|
+
$("#table_names").selectize({
|
72
|
+
}).change( function () {
|
73
|
+
var val = $(this).val();
|
74
|
+
if (val.length > 0) {
|
75
|
+
editor.setValue("SELECT * FROM " + val + " LIMIT 10");
|
76
|
+
$("#run").click();
|
77
|
+
}
|
78
|
+
});
|
79
|
+
|
80
|
+
$("form.the_form").on("submit", function() {
|
81
|
+
$("#query_statement").val(editor.getValue());
|
82
|
+
return true;
|
83
|
+
});
|
84
|
+
</script>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= render partial: "form" %>
|
@@ -0,0 +1,47 @@
|
|
1
|
+
<div id="queries">
|
2
|
+
<div id="header" style="margin-bottom: 20px;">
|
3
|
+
<div class="pull-right">
|
4
|
+
<%= link_to "New Query", new_query_path, class: "btn btn-info" %>
|
5
|
+
</div>
|
6
|
+
<input type="text" placeholder="Start typing a query or person" style="width: 300px; display: inline-block;" autofocus=true class="search form-control" />
|
7
|
+
</div>
|
8
|
+
|
9
|
+
<table class="table">
|
10
|
+
<thead>
|
11
|
+
<tr>
|
12
|
+
<th>Query</th>
|
13
|
+
<th style="width: 20%; text-align: right;">Mastermind</th>
|
14
|
+
</tr>
|
15
|
+
</thead>
|
16
|
+
<tbody class="list">
|
17
|
+
<% @queries.each do |query| %>
|
18
|
+
<tr>
|
19
|
+
<td class="query">
|
20
|
+
<%= link_to query.name, query %>
|
21
|
+
<% if query.created_at > 2.days.ago %>
|
22
|
+
<small style="font-weight: bold; color: #5cb85c;">NEW</small>
|
23
|
+
<% end %>
|
24
|
+
</td>
|
25
|
+
<td class="creator text-right text-muted">
|
26
|
+
<% if (creator = query.creator) and creator.respond_to?(:name) %>
|
27
|
+
<% name = creator.name %>
|
28
|
+
<% if respond_to?(:current_user) and creator == current_user %>
|
29
|
+
you
|
30
|
+
<div class="hide">me <%= name %></div>
|
31
|
+
<% else %>
|
32
|
+
<%= name %>
|
33
|
+
<% end %>
|
34
|
+
<% end %>
|
35
|
+
</td>
|
36
|
+
</tr>
|
37
|
+
<% end %>
|
38
|
+
</tbody>
|
39
|
+
</table>
|
40
|
+
</div>
|
41
|
+
|
42
|
+
<script>
|
43
|
+
var options = {
|
44
|
+
valueNames: ['query', 'creator']
|
45
|
+
};
|
46
|
+
var userList = new List('queries', options);
|
47
|
+
</script>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= render partial: "form" %>
|
@@ -0,0 +1,50 @@
|
|
1
|
+
<% if @error %>
|
2
|
+
<div class="alert alert-danger"><%= @error %></div>
|
3
|
+
<% elsif !@success %>
|
4
|
+
<div class="alert alert-info">Can’t run queries with variables yet</div>
|
5
|
+
<% else %>
|
6
|
+
<p class="text-muted"><%= pluralize(@rows.size, "row") %></p>
|
7
|
+
<% if @rows.any? %>
|
8
|
+
<% header_width = 100 / @rows.first.keys.size.to_f %>
|
9
|
+
<table class="table">
|
10
|
+
<thead>
|
11
|
+
<tr>
|
12
|
+
<% @columns.each do |key, type| %>
|
13
|
+
<th style="width: <%= header_width %>%;" data-sort="<%= type %>">
|
14
|
+
<div style="min-width: <%= @min_width_types.include?(key) ? 180 : 60 %>px;">
|
15
|
+
<%= key %>
|
16
|
+
</div>
|
17
|
+
</th>
|
18
|
+
<% end %>
|
19
|
+
</tr>
|
20
|
+
</thead>
|
21
|
+
<tbody>
|
22
|
+
<% @rows.each do |row| %>
|
23
|
+
<tr>
|
24
|
+
<% row.each do |k, v| %>
|
25
|
+
<td>
|
26
|
+
<% if v.is_a?(Time) %>
|
27
|
+
<% v = v.in_time_zone(Blazer.time_zone) %>
|
28
|
+
<% end %>
|
29
|
+
|
30
|
+
<% unless v.nil? %>
|
31
|
+
<% if v == "" %>
|
32
|
+
<div class="text-muted">empty string</div>
|
33
|
+
<% elsif @linked_columns[k] %>
|
34
|
+
<%= link_to format_value(k, v), @linked_columns[k].gsub("{value}", u(v.to_s)), target: "_blank" %>
|
35
|
+
<% else %>
|
36
|
+
<%= format_value(k, v) %>
|
37
|
+
<% end %>
|
38
|
+
|
39
|
+
<% if v2 = (@boom[k] || {})[v] %>
|
40
|
+
<div class="text-muted"><%= v2 %></div>
|
41
|
+
<% end %>
|
42
|
+
<% end %>
|
43
|
+
</td>
|
44
|
+
<% end %>
|
45
|
+
</tr>
|
46
|
+
<% end %>
|
47
|
+
</tbody>
|
48
|
+
</table>
|
49
|
+
<% end %>
|
50
|
+
<% end %>
|
@@ -0,0 +1,138 @@
|
|
1
|
+
<% title @query.name %>
|
2
|
+
|
3
|
+
<div style="position: fixed; top: 0; left: 0; right: 0; background-color: whitesmoke; height: 60px; z-index: 1001;">
|
4
|
+
<div class="container">
|
5
|
+
<div class="row" style="padding-top: 13px;">
|
6
|
+
<div class="col-sm-9">
|
7
|
+
<h3 style="margin: 0; line-height: 34px;">
|
8
|
+
<%= @query.name %>
|
9
|
+
</h3>
|
10
|
+
</div>
|
11
|
+
<div class="col-sm-3 text-right">
|
12
|
+
<%= link_to "Home", root_path, class: "btn btn-primary" %>
|
13
|
+
<%= link_to "Edit", edit_query_path(@query), class: "btn btn-default" %>
|
14
|
+
|
15
|
+
<% if !@error and @success %>
|
16
|
+
<%= button_to "Download", run_queries_path(statement: @query.statement, query_id: @query.id, format: "csv"), class: "btn btn-info" %>
|
17
|
+
<% end %>
|
18
|
+
</div>
|
19
|
+
</div>
|
20
|
+
</div>
|
21
|
+
</div>
|
22
|
+
|
23
|
+
<div style="margin-bottom: 60px;"></div>
|
24
|
+
|
25
|
+
<% if @sql_errors.any? %>
|
26
|
+
<div class="alert alert-danger">
|
27
|
+
<ul>
|
28
|
+
<% @sql_errors.each do |message| %>
|
29
|
+
<li><%= message %></li>
|
30
|
+
<% end %>
|
31
|
+
</ul>
|
32
|
+
</div>
|
33
|
+
<% end %>
|
34
|
+
|
35
|
+
<% if @query.description.present? %>
|
36
|
+
<p><%= @query.description %></p>
|
37
|
+
<% end %>
|
38
|
+
|
39
|
+
<% if @bind_vars.any? %>
|
40
|
+
<form id="bind" method="get" action="<%= url_for(params) %>" class="form-inline" style="margin-bottom: 10px;">
|
41
|
+
<% date_vars = ["start_time", "end_time"] %>
|
42
|
+
<% if (date_vars - @bind_vars).empty? %>
|
43
|
+
<% @bind_vars = @bind_vars - date_vars %>
|
44
|
+
<% else %>
|
45
|
+
<% date_vars = nil %>
|
46
|
+
<% end %>
|
47
|
+
|
48
|
+
<% @bind_vars.each_with_index do |var, i| %>
|
49
|
+
<%= label_tag var, var %>
|
50
|
+
<% if (data = @smart_vars[var]) %>
|
51
|
+
<%= select_tag var, options_for_select([[nil, nil]] + data, selected: params[var]), style: "margin-right: 20px; width: 200px;" %>
|
52
|
+
<script>
|
53
|
+
$("#<%= var %>").selectize({
|
54
|
+
create: true
|
55
|
+
});
|
56
|
+
</script>
|
57
|
+
<% else %>
|
58
|
+
<%= text_field_tag var, params[var], style: "width: 120px; margin-right: 20px;", autofocus: i == 0 && !var.end_with?("_at") && !params[var], class: "form-control" %>
|
59
|
+
<% if var.end_with?("_at") %>
|
60
|
+
<script>
|
61
|
+
$("#<%= var %>").datepicker({format: "yyyy-mm-dd", autoclose: true, todayBtn: "linked"})
|
62
|
+
</script>
|
63
|
+
<% end %>
|
64
|
+
<% end %>
|
65
|
+
<% end %>
|
66
|
+
|
67
|
+
<% if date_vars %>
|
68
|
+
<% date_vars.each do |var| %>
|
69
|
+
<%= hidden_field_tag var, params[var] %>
|
70
|
+
<% end %>
|
71
|
+
|
72
|
+
<%= label_tag nil, date_vars.join(" & ") %>
|
73
|
+
<div class="selectize-control single" style="width: 300px;">
|
74
|
+
<div id="reportrange" class="selectize-input" style="display: inline-block;">
|
75
|
+
<span>Select a time range</span>
|
76
|
+
</div>
|
77
|
+
</div>
|
78
|
+
|
79
|
+
<script>
|
80
|
+
$('#reportrange').daterangepicker(
|
81
|
+
{
|
82
|
+
ranges: {
|
83
|
+
'Today': [moment(), moment()],
|
84
|
+
'Last 7 Days': [moment().subtract('days', 6), moment()],
|
85
|
+
'Last 30 Days': [moment().subtract('days', 29), moment()]
|
86
|
+
},
|
87
|
+
startDate: moment().subtract('days', 29),
|
88
|
+
endDate: moment(),
|
89
|
+
opens: "left"
|
90
|
+
},
|
91
|
+
function(start, end) {
|
92
|
+
$("#start_time").val(start.toISOString());
|
93
|
+
$("#end_time").val(end.endOf("day").toISOString());
|
94
|
+
$("#start_time").closest("form").submit();
|
95
|
+
}
|
96
|
+
).on('apply.daterangepicker', function(ev, picker) {
|
97
|
+
$("#start_time").val(picker.startDate.toISOString());
|
98
|
+
$("#end_time").val(picker.endDate.endOf("day").toISOString());
|
99
|
+
$('#reportrange span').html(picker.startDate.format('MMMM D, YYYY') + ' - ' + picker.endDate.format('MMMM D, YYYY'));
|
100
|
+
})
|
101
|
+
|
102
|
+
if ($("#start_time").val().length > 0) {
|
103
|
+
var picker = $("#reportrange").data('daterangepicker');
|
104
|
+
picker.setStartDate(moment($("#start_time").val()));
|
105
|
+
picker.setEndDate(moment($("#end_time").val()));
|
106
|
+
$("#reportrange").trigger('apply.daterangepicker', picker)
|
107
|
+
}
|
108
|
+
</script>
|
109
|
+
<% end %>
|
110
|
+
|
111
|
+
<input type="submit" class="btn btn-success" value="Run" style="vertical-align: top;" />
|
112
|
+
</form>
|
113
|
+
<% end %>
|
114
|
+
|
115
|
+
<pre><code><%= @query.statement %></code></pre>
|
116
|
+
|
117
|
+
<% if @success %>
|
118
|
+
<div id="results">
|
119
|
+
<p class="text-muted">Loading...</p>
|
120
|
+
</div>
|
121
|
+
|
122
|
+
<script>
|
123
|
+
$.post("<%= run_queries_path %>", <%= json_escape({statement: @query.statement, query_id: @query.id}.to_json).html_safe %>, function (data) {
|
124
|
+
$("#results").html(data);
|
125
|
+
$("#results table").stupidtable().stickyTableHeaders({fixedOffset: 60});
|
126
|
+
});
|
127
|
+
|
128
|
+
$(".form-inline input, .form-inline select").change( function () {
|
129
|
+
if ($(this).val() != "") {
|
130
|
+
$(this).closest("form").submit();
|
131
|
+
}
|
132
|
+
});
|
133
|
+
</script>
|
134
|
+
<% end %>
|
135
|
+
|
136
|
+
<script>
|
137
|
+
hljs.initHighlightingOnLoad();
|
138
|
+
</script>
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title><%= title ? title : "Blazer" %></title>
|
5
|
+
|
6
|
+
<meta charset="utf-8" />
|
7
|
+
|
8
|
+
<%= stylesheet_link_tag "blazer/application" %>
|
9
|
+
<%= javascript_include_tag "blazer/application" %>
|
10
|
+
<%= csrf_meta_tags %>
|
11
|
+
</head>
|
12
|
+
<body>
|
13
|
+
<div class="container">
|
14
|
+
<%= yield %>
|
15
|
+
</div>
|
16
|
+
</body>
|
17
|
+
</html>
|
data/blazer.gemspec
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'blazer/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "blazer"
|
8
|
+
spec.version = Blazer::VERSION
|
9
|
+
spec.authors = ["Andrew Kane"]
|
10
|
+
spec.email = ["andrew@chartkick.com"]
|
11
|
+
spec.summary = %q{Create and share SQL queries instantly}
|
12
|
+
spec.description = %q{Create and share SQL queries instantly}
|
13
|
+
spec.homepage = "https://github.com/ankane/blazer"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0")
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_dependency "rails"
|
22
|
+
|
23
|
+
spec.add_development_dependency "bundler", "~> 1.7"
|
24
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
25
|
+
end
|
data/config/routes.rb
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
module Blazer
|
2
|
+
class Engine < ::Rails::Engine
|
3
|
+
isolate_namespace Blazer
|
4
|
+
|
5
|
+
initializer "precompile" do |app|
|
6
|
+
# use a proc instead of a string
|
7
|
+
app.config.assets.precompile << Proc.new{|path| path =~ /\Ablazer\/application\.(js|css)\z/ }
|
8
|
+
end
|
9
|
+
|
10
|
+
end
|
11
|
+
end
|
data/lib/blazer.rb
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
require "csv"
|
2
|
+
require "blazer/version"
|
3
|
+
require "blazer/engine"
|
4
|
+
|
5
|
+
module Blazer
|
6
|
+
class << self
|
7
|
+
attr_accessor :audit
|
8
|
+
attr_reader :time_zone
|
9
|
+
end
|
10
|
+
self.audit = true
|
11
|
+
|
12
|
+
def self.time_zone=(time_zone)
|
13
|
+
@time_zone = time_zone.is_a?(ActiveSupport::TimeZone) ? time_zone : ActiveSupport::TimeZone[time_zone.to_s]
|
14
|
+
end
|
15
|
+
self.time_zone = Time.zone
|
16
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# taken from https://github.com/collectiveidea/audited/blob/master/lib/generators/audited/install_generator.rb
|
2
|
+
require "rails/generators"
|
3
|
+
require "rails/generators/migration"
|
4
|
+
require "active_record"
|
5
|
+
require "rails/generators/active_record"
|
6
|
+
|
7
|
+
module Blazer
|
8
|
+
module Generators
|
9
|
+
class InstallGenerator < Rails::Generators::Base
|
10
|
+
include Rails::Generators::Migration
|
11
|
+
|
12
|
+
source_root File.expand_path("../templates", __FILE__)
|
13
|
+
|
14
|
+
# Implement the required interface for Rails::Generators::Migration.
|
15
|
+
def self.next_migration_number(dirname) #:nodoc:
|
16
|
+
next_migration_number = current_migration_number(dirname) + 1
|
17
|
+
if ActiveRecord::Base.timestamped_migrations
|
18
|
+
[Time.now.utc.strftime("%Y%m%d%H%M%S"), "%.14d" % next_migration_number].max
|
19
|
+
else
|
20
|
+
"%.3d" % next_migration_number
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
def copy_migration
|
25
|
+
migration_template "install.rb", "db/migrate/install_blazer.rb"
|
26
|
+
end
|
27
|
+
|
28
|
+
def copy_config
|
29
|
+
template "config.yml", "config/blazer.yml"
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
class <%= migration_class_name %> < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :blazer_queries do |t|
|
4
|
+
t.references :creator
|
5
|
+
t.string :name
|
6
|
+
t.text :description
|
7
|
+
t.text :statement
|
8
|
+
t.timestamps
|
9
|
+
end
|
10
|
+
|
11
|
+
create_table :blazer_audits do |t|
|
12
|
+
t.references :user
|
13
|
+
t.text :statement
|
14
|
+
t.timestamp :created_at
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
metadata
ADDED
@@ -0,0 +1,134 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: blazer
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Andrew Kane
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-10-01 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rails
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.7'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.7'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '10.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '10.0'
|
55
|
+
description: Create and share SQL queries instantly
|
56
|
+
email:
|
57
|
+
- andrew@chartkick.com
|
58
|
+
executables: []
|
59
|
+
extensions: []
|
60
|
+
extra_rdoc_files: []
|
61
|
+
files:
|
62
|
+
- ".gitignore"
|
63
|
+
- Gemfile
|
64
|
+
- LICENSE.txt
|
65
|
+
- README.md
|
66
|
+
- Rakefile
|
67
|
+
- app/assets/javascripts/blazer/ace/ace.js
|
68
|
+
- app/assets/javascripts/blazer/ace/ext-language_tools.js
|
69
|
+
- app/assets/javascripts/blazer/ace/mode-sql.js
|
70
|
+
- app/assets/javascripts/blazer/ace/snippets/sql.js
|
71
|
+
- app/assets/javascripts/blazer/ace/snippets/text.js
|
72
|
+
- app/assets/javascripts/blazer/ace/theme-twilight.js
|
73
|
+
- app/assets/javascripts/blazer/application.js
|
74
|
+
- app/assets/javascripts/blazer/daterangepicker.js
|
75
|
+
- app/assets/javascripts/blazer/highlight.pack.js
|
76
|
+
- app/assets/javascripts/blazer/jquery.js
|
77
|
+
- app/assets/javascripts/blazer/jquery.stickytableheaders.js
|
78
|
+
- app/assets/javascripts/blazer/jquery_ujs.js
|
79
|
+
- app/assets/javascripts/blazer/list.js
|
80
|
+
- app/assets/javascripts/blazer/moment.js
|
81
|
+
- app/assets/javascripts/blazer/selectize.js
|
82
|
+
- app/assets/javascripts/blazer/stupidtable.js
|
83
|
+
- app/assets/stylesheets/blazer/application.css
|
84
|
+
- app/assets/stylesheets/blazer/bootstrap.css
|
85
|
+
- app/assets/stylesheets/blazer/bootstrap.css.map
|
86
|
+
- app/assets/stylesheets/blazer/daterangepicker-bs3.css
|
87
|
+
- app/assets/stylesheets/blazer/github.css
|
88
|
+
- app/assets/stylesheets/blazer/selectize.default.css
|
89
|
+
- app/controllers/blazer/queries_controller.rb
|
90
|
+
- app/helpers/blazer/queries_helper.rb
|
91
|
+
- app/models/blazer/audit.rb
|
92
|
+
- app/models/blazer/connection.rb
|
93
|
+
- app/models/blazer/query.rb
|
94
|
+
- app/views/blazer/queries/_form.html.erb
|
95
|
+
- app/views/blazer/queries/edit.html.erb
|
96
|
+
- app/views/blazer/queries/index.html.erb
|
97
|
+
- app/views/blazer/queries/new.html.erb
|
98
|
+
- app/views/blazer/queries/run.html.erb
|
99
|
+
- app/views/blazer/queries/show.html.erb
|
100
|
+
- app/views/layouts/blazer/application.html.erb
|
101
|
+
- blazer.gemspec
|
102
|
+
- config/routes.rb
|
103
|
+
- lib/blazer.rb
|
104
|
+
- lib/blazer/engine.rb
|
105
|
+
- lib/blazer/version.rb
|
106
|
+
- lib/generators/blazer/install_generator.rb
|
107
|
+
- lib/generators/blazer/templates/config.yml
|
108
|
+
- lib/generators/blazer/templates/install.rb
|
109
|
+
homepage: https://github.com/ankane/blazer
|
110
|
+
licenses:
|
111
|
+
- MIT
|
112
|
+
metadata: {}
|
113
|
+
post_install_message:
|
114
|
+
rdoc_options: []
|
115
|
+
require_paths:
|
116
|
+
- lib
|
117
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
118
|
+
requirements:
|
119
|
+
- - ">="
|
120
|
+
- !ruby/object:Gem::Version
|
121
|
+
version: '0'
|
122
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
123
|
+
requirements:
|
124
|
+
- - ">="
|
125
|
+
- !ruby/object:Gem::Version
|
126
|
+
version: '0'
|
127
|
+
requirements: []
|
128
|
+
rubyforge_project:
|
129
|
+
rubygems_version: 2.2.2
|
130
|
+
signing_key:
|
131
|
+
specification_version: 4
|
132
|
+
summary: Create and share SQL queries instantly
|
133
|
+
test_files: []
|
134
|
+
has_rdoc:
|