blazer_json_api 0.1.1f → 0.1.1g
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -3
- data/Rakefile +1 -1
- data/app/controllers/blazer/api/application_controller.rb +1 -1
- data/app/controllers/blazer/api/queries_controller.rb +5 -5
- data/app/helpers/blazer/api/application_helper.rb +1 -1
- data/app/jobs/blazer/api/application_job.rb +1 -1
- data/app/mailers/blazer/api/application_mailer.rb +1 -1
- data/app/models/blazer/api/application_record.rb +1 -1
- data/config/routes.rb +1 -1
- data/lib/blazer/api/config.rb +1 -1
- data/lib/blazer/api/engine.rb +2 -2
- data/lib/blazer/api/process_statement_variables.rb +1 -1
- data/lib/blazer/api/result_to_nested_json.rb +2 -2
- data/lib/blazer/api/version.rb +2 -2
- data/lib/blazer/api.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ee9262c99b81833606e99f1c910dbe75d81e05820e1da3186aa55ffed20c3c9b
|
4
|
+
data.tar.gz: 6468b17bca023ed9d3cda30f9818075164dedf5dfc5d2b693d470988738936a3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1d6ddb100016bfd1a777c6acac05fcf0f87c4e4de4706b8cac93fff86585007b20595e2d57b8dcb43045355976c377b8b8be254f65bd610c0918e097bf84ec41
|
7
|
+
data.tar.gz: bc8b17910b13a22f6bab61e9c4cc3e179a6e70e9b311fdb3475ff267490cbfee042c226e634235fdbe82e162c0e14e3d2b84f8b33dde1378a35265493a410b36
|
data/README.md
CHANGED
@@ -27,14 +27,14 @@ $ bundle
|
|
27
27
|
And mount the engine in your `config/routes.rb`:
|
28
28
|
|
29
29
|
```ruby
|
30
|
-
mount Blazer::
|
30
|
+
mount Blazer::API::Engine, at: 'blazer-api'
|
31
31
|
```
|
32
32
|
|
33
33
|
Configure authentication in an initializer as follows (e.g. in `initializers/blazer_api.rb`)
|
34
34
|
|
35
35
|
```ruby
|
36
|
-
Blazer::
|
37
|
-
Blazer::
|
36
|
+
Blazer::API::Config.username = <api-username>
|
37
|
+
Blazer::API::Config.password = <api-password>
|
38
38
|
```
|
39
39
|
|
40
40
|
## Usage
|
data/Rakefile
CHANGED
@@ -10,7 +10,7 @@ require 'rdoc/task'
|
|
10
10
|
|
11
11
|
RDoc::Task.new(:rdoc) do |rdoc|
|
12
12
|
rdoc.rdoc_dir = 'rdoc'
|
13
|
-
rdoc.title = 'Blazer::
|
13
|
+
rdoc.title = 'Blazer::API'
|
14
14
|
rdoc.options << '--line-numbers'
|
15
15
|
rdoc.rdoc_files.include('README.md')
|
16
16
|
rdoc.rdoc_files.include('lib/**/*.rb')
|
@@ -1,10 +1,10 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module Blazer
|
4
|
-
module
|
4
|
+
module API
|
5
5
|
class QueriesController < ApplicationController
|
6
|
-
if Blazer::
|
7
|
-
http_basic_authenticate_with name: Blazer::
|
6
|
+
if Blazer::API::Config.username && Blazer::API::Config.password
|
7
|
+
http_basic_authenticate_with name: Blazer::API::Config.username, password: Blazer::API::Config.password
|
8
8
|
end
|
9
9
|
before_action :set_query
|
10
10
|
|
@@ -17,7 +17,7 @@ module Blazer
|
|
17
17
|
if result.error.present?
|
18
18
|
render_errors(Array(result.error))
|
19
19
|
else
|
20
|
-
render json: Blazer::
|
20
|
+
render json: Blazer::API::ResultToNestedJson.new(@statement, result).call
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
@@ -29,7 +29,7 @@ module Blazer
|
|
29
29
|
end
|
30
30
|
|
31
31
|
def process_variables(statement, data_source)
|
32
|
-
Blazer::
|
32
|
+
Blazer::API::ProcessStatementVariables.new(statement, data_source, params).call
|
33
33
|
end
|
34
34
|
end
|
35
35
|
end
|
data/config/routes.rb
CHANGED
data/lib/blazer/api/config.rb
CHANGED
data/lib/blazer/api/engine.rb
CHANGED
@@ -4,9 +4,9 @@
|
|
4
4
|
# Used the convention of a double underscore in the column header to denote a parent key or nesting
|
5
5
|
# e.g. { 'parent__child': '1' } becomes { 'parent': { 'child': 1 }}
|
6
6
|
module Blazer
|
7
|
-
module
|
7
|
+
module API
|
8
8
|
class ResultToNestedJson
|
9
|
-
delegate :nesting_column_separator, to: Blazer::
|
9
|
+
delegate :nesting_column_separator, to: Blazer::API::Config
|
10
10
|
|
11
11
|
attr_reader :statement, :blazer_result
|
12
12
|
|
data/lib/blazer/api/version.rb
CHANGED
data/lib/blazer/api.rb
CHANGED