blazer 0.0.2 → 0.0.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: de392a9eb747475ba5588fa59ebbe5f24394cf00
4
- data.tar.gz: 1aac68cea87e1c1e308b775114ac2e8b5871a339
3
+ metadata.gz: bc1973d03f91ae69eafb0589d1fe256f6aa1be4a
4
+ data.tar.gz: 9f213d1622f818798a3f166ec56ba4b6e44b8d6c
5
5
  SHA512:
6
- metadata.gz: 75cfa90ef17c5f857752dc57198da6dc310afbec7d35b1d65e43dacf625fbbff254b2dd641f72f199b5ef8d2fb9cfc039f3df7c782e38cb2f95e653016c9318f
7
- data.tar.gz: 49b6a1ee5bf3c386813f8f9b4f918ce42b2de23378057a709ab734704ee6fb7760f5e34ab50d40896749fb8e0e3cfa4cf84c7595c4f9c882001334aa251faf56
6
+ metadata.gz: 4d23e80cd506f53b1d939e7820bee0e1fa6d9bc1bc8f55695d230b44981ff59a8304287530c487cebb59eec9e368ef3a1fdd9afb4e191eada39e61ead1634889
7
+ data.tar.gz: 20694d24bc1a4007a179f8e44804f161a5d4b2040316a02d72f4fe8edb0484221dc48e9eb53211e86f62c19d1e716252bdc1c9eabc1978ada9b1add642ab3689
data/README.md CHANGED
@@ -1,8 +1,10 @@
1
1
  # Blazer
2
2
 
3
- Create and share SQL queries instantly
3
+ Share data effortlessly with your team
4
4
 
5
- [View the demo](https://blazerme.herokuapp.com)
5
+ [Play around with the demo](https://blazerme.herokuapp.com) - data from [MovieLens](http://grouplens.org/datasets/movielens/)
6
+
7
+ ![Screenshot](https://blazerme.herokuapp.com/assets/screenshot-d9ba1e4394901e7233ce462c0c8dc8f5.png)
6
8
 
7
9
  Works with PostgreSQL and MySQL
8
10
 
@@ -11,11 +13,11 @@ Works with PostgreSQL and MySQL
11
13
  ## Features
12
14
 
13
15
  - **Secure** - works with your authentication system
14
- - **Variables** - get the same insights for multiple values
16
+ - **Variables** - run the same queries with different values
15
17
  - **Linked Columns** - link to other pages in your apps or around the web
16
18
  - **Smart Columns** - get the data your want without all the joins
17
- - **Smart Variables** - no need to remember IDs
18
- - **Charts & Maps** - a picture is worth a thousand words
19
+ - **Smart Variables** - no need to remember ids
20
+ - **Charts** - visualize the data
19
21
 
20
22
  ## Installation
21
23
 
@@ -122,6 +124,7 @@ Blazer.user_name = :first_name
122
124
  - update lock
123
125
  - warn when database user has write permissions
124
126
  - advanced permissions
127
+ - maps
125
128
  - favorites
126
129
  - support for multiple data sources
127
130
 
@@ -58,9 +58,13 @@ input.search:focus {
58
58
 
59
59
  #editor {
60
60
  display: none;
61
- height: 100px;
61
+ height: 160px;
62
62
  }
63
63
 
64
64
  .ace_print-margin-layer {
65
65
  display: none;
66
66
  }
67
+
68
+ .ace_gutter-cell.error {
69
+ background-color: red;
70
+ }
@@ -22,10 +22,12 @@
22
22
  </div>
23
23
  <div class="col-xs-4">
24
24
  <div class="form-group">
25
- <%= f.text_field :name, placeholder: "Name", class: "form-control" %>
25
+ <%= f.label :name %>
26
+ <%= f.text_field :name, class: "form-control" %>
26
27
  </div>
27
28
  <div class="form-group">
28
- <%= f.text_area :description, placeholder: "Optional description", style: "height: 70px;", class: "form-control" %>
29
+ <%= f.label :description %>
30
+ <%= f.text_area :description, placeholder: "Optional", style: "height: 80px;", class: "form-control" %>
29
31
  </div>
30
32
  <div class="text-right">
31
33
  <% if @query.persisted? %>
@@ -48,19 +50,49 @@
48
50
  enableSnippets: false,
49
51
  enableLiveAutocompletion: false,
50
52
  highlightActiveLine: false,
51
- fontSize: 12
53
+ fontSize: 12,
54
+ minLines: 10
52
55
  });
53
- editor.renderer.setShowGutter(false);
56
+ editor.renderer.setShowGutter(true);
54
57
  editor.renderer.setPrintMarginColumn(false);
55
58
  editor.renderer.setPadding(10);
56
59
  editor.getSession().setUseWrapMode(true);
60
+ editor.commands.addCommand({
61
+ name: 'run',
62
+ bindKey: {win: 'Ctrl-Enter', mac: 'Command-Enter'},
63
+ exec: function(editor) {
64
+ $("#run").click();
65
+ },
66
+ readOnly: false // false if this command should not apply in readOnly mode
67
+ });
68
+
69
+ editor.resize();
57
70
  $("#editor").show();
71
+ editor.focus();
58
72
 
59
- $("#run").click( function (e) {
73
+ var error_line = null;
74
+
75
+ $("#run").click(function (e) {
60
76
  e.preventDefault();
77
+
78
+ if (error_line) {
79
+ editor.getSession().removeGutterDecoration(error_line - 1, "error");
80
+ error_line = null;
81
+ }
82
+
61
83
  $("#results").html('<p class="text-muted">Loading...</p>');
62
84
  $.post("<%= run_queries_path %>", {statement: editor.getValue()}, function (data) {
63
85
  $("#results").html(data);
86
+
87
+ error_line = /LINE (\d+)/g.exec($("#results").find('.alert-danger').text());
88
+
89
+ if (error_line) {
90
+ error_line = parseInt(error_line[1], 10);
91
+ editor.getSession().addGutterDecoration(error_line - 1, "error");
92
+ editor.scrollToLine(error_line, true, true, function () {});
93
+ editor.gotoLine(error_line, 0, true);
94
+ editor.focus();
95
+ }
64
96
  });
65
97
  });
66
98
 
@@ -124,15 +124,23 @@
124
124
  $("#results").html(data);
125
125
  $("#results table").stupidtable().stickyTableHeaders({fixedOffset: 60});
126
126
  });
127
-
128
- $(".form-inline input, .form-inline select").change( function () {
129
- if ($(this).val() != "") {
130
- $(this).closest("form").submit();
131
- }
132
- });
133
127
  </script>
134
128
  <% end %>
135
129
 
136
130
  <script>
137
131
  hljs.initHighlightingOnLoad();
132
+
133
+ $(".form-inline input, .form-inline select").change( function () {
134
+ // see if all value are entered
135
+ var $form = $(this).closest("form");
136
+ var completed = true;
137
+ $form.find("input[name], select").each( function () {
138
+ if ($(this).val() == "") {
139
+ completed = false;
140
+ }
141
+ });
142
+ if (completed) {
143
+ $form.submit();
144
+ }
145
+ });
138
146
  </script>
data/blazer.gemspec CHANGED
@@ -8,8 +8,8 @@ Gem::Specification.new do |spec|
8
8
  spec.version = Blazer::VERSION
9
9
  spec.authors = ["Andrew Kane"]
10
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}
11
+ spec.summary = %q{Share data effortlessly with your team}
12
+ spec.description = %q{Share data effortlessly with your team}
13
13
  spec.homepage = "https://github.com/ankane/blazer"
14
14
  spec.license = "MIT"
15
15
 
data/lib/blazer.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  require "csv"
2
+ require "chartkick"
2
3
  require "blazer/version"
3
4
  require "blazer/engine"
4
5
 
@@ -1,3 +1,3 @@
1
1
  module Blazer
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blazer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-01 00:00:00.000000000 Z
11
+ date: 2014-10-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -66,7 +66,7 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '10.0'
69
- description: Create and share SQL queries instantly
69
+ description: Share data effortlessly with your team
70
70
  email:
71
71
  - andrew@chartkick.com
72
72
  executables: []
@@ -142,6 +142,5 @@ rubyforge_project:
142
142
  rubygems_version: 2.2.2
143
143
  signing_key:
144
144
  specification_version: 4
145
- summary: Create and share SQL queries instantly
145
+ summary: Share data effortlessly with your team
146
146
  test_files: []
147
- has_rdoc: