blazer_json_api 0.1.1f → 0.1.1g

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cc930d874b1d0983d1f195b97c513fed51161159c063ae48dd4a090a0cfd6a4c
4
- data.tar.gz: 656fd71fccb9329d853cbc74ed7a98bdf53c194bede49fde9dc0b06c629f3d6f
3
+ metadata.gz: ee9262c99b81833606e99f1c910dbe75d81e05820e1da3186aa55ffed20c3c9b
4
+ data.tar.gz: 6468b17bca023ed9d3cda30f9818075164dedf5dfc5d2b693d470988738936a3
5
5
  SHA512:
6
- metadata.gz: 91decb82a0548189dc0242068e9718841cfa2208f59600ae5f2cc8a3d9a97de3ba9f4e4d546bb574bee11a22d98c2eb32bbe7079982cda6f4798685e4642fb11
7
- data.tar.gz: b306248d8b444dd51eadb9c12515d5f69d661d901c8a7f3898c599f1c85bec19d5428a0424b6a8d7e0b6f78e1349fa07980b7520e2dd3b74bd47448eb37b906a
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::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.1f'
4
+ module API
5
+ VERSION = '0.1.1g'
6
6
  end
7
7
  end
data/lib/blazer/api.rb CHANGED
@@ -6,6 +6,6 @@ require 'blazer/api/process_statement_variables'
6
6
  require 'blazer/api/result_to_nested_json'
7
7
 
8
8
  module Blazer
9
- module Api
9
+ module API
10
10
  end
11
11
  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.1f
4
+ version: 0.1.1g
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Farrell