blazer_json_api 0.1.1h → 0.1.1i

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d4475f5d351abeb8ac4b3a49f5444d75cfde4d4547d367b13bb9cff3d541eed9
4
- data.tar.gz: 623a9570620e729eda904d9e612fa9ad1cae5682614f9f33538cc6e918b556b1
3
+ metadata.gz: 07fd9c9b0b687bb830f8fe5bf216282965a5e0bb9c2390a9cc05e9eb56d22e4b
4
+ data.tar.gz: 2c1d60956fbb7637d68c652764a50b39934ed7f2b9b080a95b0cfe9ec06a7b7b
5
5
  SHA512:
6
- metadata.gz: 7c2d137fb4dd9a802c6479d1f62ad961f4ba8b6ede91ccce31408bdceb7608ff3feca10d15d214c31ebaac6134d1e753fae2b0fcbe6eacf3cff7f7e2a062560c
7
- data.tar.gz: 701a0c2827242e3ff0669deecbfb1e0b74940391eea0ebf4cbcbfd54b79c417394acd8b9ae124d808bcbdb8cff908107ca18561f5a2b32444fb1fe3b6d4ccd0f
6
+ metadata.gz: 3f791140000106082ba74cddb0d0aefc81f2e4184e51572effa03501ed4cedf399706d1a94c6e994ad1975ee52e901e67ad6de758ea4f324964ff542ddf06b1d
7
+ data.tar.gz: 9ab2a52d7ee5f1df8652c52dd238eb04937360f65977cbdada0893d377bb9ac4685917f8508b42cb4e15b0b9bf6b9e559465408504504eac8e1bef6bdbfb41e1
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::API::Engine, at: 'blazer-api'
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::API::Config.username = <api-username>
37
- Blazer::API::Config.password = <api-password>
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::API'
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,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Blazer
4
- module API
4
+ module Api
5
5
  class ApplicationController < ActionController::Base
6
6
  protect_from_forgery with: :exception
7
7
 
@@ -1,10 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Blazer
4
- module API
4
+ module Api
5
5
  class QueriesController < ApplicationController
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
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::API::ResultToNestedJson.new(@statement, result).call
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::API::ProcessStatementVariables.new(statement, data_source, params).call
32
+ Blazer::Api::ProcessStatementVariables.new(statement, data_source, params).call
33
33
  end
34
34
  end
35
35
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Blazer
4
- module API
4
+ module Api
5
5
  module ApplicationHelper
6
6
  end
7
7
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Blazer
4
- module API
4
+ module Api
5
5
  class ApplicationJob < ActiveJob::Base
6
6
  end
7
7
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Blazer
4
- module API
4
+ module Api
5
5
  class ApplicationMailer < ActionMailer::Base
6
6
  default from: 'from@example.com'
7
7
  layout 'mailer'
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Blazer
4
- module API
4
+ module Api
5
5
  class ApplicationRecord < ActiveRecord::Base
6
6
  self.abstract_class = true
7
7
  end
data/config/routes.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- Blazer::API::Engine.routes.draw do
3
+ Blazer::Api::Engine.routes.draw do
4
4
  resources :queries, only: :show
5
5
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Blazer
4
- module API
4
+ module Api
5
5
  class Config
6
6
  # defaults
7
7
  @@nesting_column_separator = '__'
@@ -1,9 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Blazer
4
- module API
4
+ module Api
5
5
  class Engine < ::Rails::Engine
6
- isolate_namespace Blazer::API
6
+ isolate_namespace Blazer::Api
7
7
  end
8
8
  end
9
9
  end
@@ -4,7 +4,7 @@
4
4
  # Necessary for processing any query variables safely
5
5
  # Refactored to avoid rubocop breaches
6
6
  module Blazer
7
- module API
7
+ module Api
8
8
  class ProcessStatementVariables
9
9
  attr_reader :statement, :data_source, :params
10
10
 
@@ -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 API
7
+ module Api
8
8
  class ResultToNestedJson
9
- delegate :nesting_column_separator, to: Blazer::API::Config
9
+ delegate :nesting_column_separator, to: Blazer::Api::Config
10
10
 
11
11
  attr_reader :statement, :blazer_result
12
12
 
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Blazer
4
- module API
5
- VERSION = '0.1.1h'
4
+ module Api
5
+ VERSION = '0.1.1i'
6
6
  end
7
7
  end
data/lib/blazer/api.rb CHANGED
@@ -7,6 +7,6 @@ require 'blazer/api/process_statement_variables'
7
7
  require 'blazer/api/result_to_nested_json'
8
8
 
9
9
  module Blazer
10
- module API
10
+ module Api
11
11
  end
12
12
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blazer_json_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1h
4
+ version: 0.1.1i
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Farrell