blazer_json_api 0.1.1 → 0.1.2

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: 7bb70c37952526ddd6429985da872163b1220406a97af427aa0787db0e9fb371
4
- data.tar.gz: bb3e7718fec2af8cfaf95d25a383b138f4db11d35c888a0e7907f89bd59cf87d
3
+ metadata.gz: 59f80fa45e2a211955055a9833d63c75115e7a7b7ddc80dff0953551cb98994c
4
+ data.tar.gz: 004add471a763d719345a3c2de853d0ccbdadd432ffaddcaed8d63c51de7a08a
5
5
  SHA512:
6
- metadata.gz: 37f319479257cf68de348e8d0bcabe5fcef9d3a7dd7d611665346255089d5cb44eee40288432b3f3a8d18e9bcff03d5769740de22b24ee71f6dfbab5b4cbccc1
7
- data.tar.gz: d4ce2dddc2eb910547761689705c431a5541b7031b87d154c4c758a04046cb8a721559ab61bc2e5f2230ae0ec79a4ecd6d90c0f961f284984de7c63f847b32aa
6
+ metadata.gz: c3936cafc9e5edebc527d3dff0618e42f8544e816c6cc6b8dce611169a7cec1a77eb5984582d4a701164dc0562013f003ccbc74ae12904e0f0d53a1cfae85b04
7
+ data.tar.gz: 9673d8c148f944fbb24fa3914b655961153eaf95a0a2fc91ce30de532fd465f089fc0b2ace2690cbf2b49c70e4d8a88cbd61f865927c50a7d0084e7cff015268
data/README.md CHANGED
@@ -1,17 +1,20 @@
1
1
  # Blazer JSON API
2
- An extension to [Blazer](https://github.com/ankane/blazer) to enable exposing your queries as JSON via API so it can be consumed outside of Blazer by your application.
2
+ An extension to [Blazer](https://github.com/ankane/blazer) to enable exposing your queries as JSON via API, so that they can be consumed outside of Blazer by your application.
3
+ Use Blazer for powering in app charts using a charting library of your choice.
3
4
 
4
5
  ## Features
5
- - **Powered by SQL** Author APIs quickly using Blazers IDE. Particular useful for private/internal APIs that fall outside of your standard API endpoints
6
- - **No deploy APIs** Expermental APIs can be authored quickly via Blazer without the need to do a deploy
7
- - **Flexible structure** JSON response structure can be controlled directly in SQL by using a column naming convention (double underscore denotes a nesting by default, but can be overridden)
8
- - **Security** You'll likely want to lock down API access so APIs are authenticated separately to standard Blazer authentication using HTTP basic authentication to avoid granding everyone with access to Blazer also access to your APIs.
9
- - **URL parameters** URL parameters are also supported built on Blazers query variables meaning the APIs can be highly dynamic and flexible
6
+ - **Powered by SQL** Author APIs quickly using Blazers SQL based IDE. Particular useful for private/internal APIs that fall outside your standard API endpoints or where responses need to be taylored to suit a specific charting library.
7
+ - **No deploy APIs** Experimental APIs can be authored and iterated on quickly via Blazer without the need to do a deploy. Were a team is split between frontend and backend, this greatly increases collaboration and speed.
8
+ - **Flexible structure** JSON response structure can be controlled directly in SQL by using a column naming convention (double underscore `__` denotes a nesting by default, but can be overridden)
9
+ - **Security** You'll likely want to lock down API access so APIs are authenticated separately to the standard Blazer auth model, so authentication is enabled using HTTP basic authentication to avoid granting everyone with access to Blazer also access to your APIs.
10
+ - **URL parameters** URL parameters are also supported via Blazers query variables meaning the APIs can be highly dynamic and flexible
10
11
  - **Pagination** Pagination can be controlled using query variables in combination with limits and offsets
11
- - **Multiple data sources** Blazer supports multiple datasources meaning you can potentially build APIs that access beyond the applications database (e.g. ElasticSearch, Google BigQuery, Salesforce)
12
+ - **Multiple data sources** Blazer supports multiple data sources meaning you can potentially build APIs that access beyond the applications' database (e.g. ElasticSearch, Google BigQuery, SalesForce etc)
13
+ - **Permissions** Use Blazers [basic permissions mode](https://github.com/ankane/blazer#query-permissions) with your own naming conventions to control access and visibility of API based queries.
12
14
 
13
15
  ## Installation
14
- Follow the installation steps described to get Blazer up and running.
16
+ Follow the installation steps described to get [Blazer](https://github.com/ankane/blazer#installation) up and running.
17
+
15
18
  Then, add this line to your application's Gemfile:
16
19
 
17
20
  ```ruby
@@ -26,30 +29,172 @@ $ bundle
26
29
  And mount the engine in your `config/routes.rb`:
27
30
 
28
31
  ```ruby
29
- mount BlazerJsonAPI, at: 'blazer-api'
32
+ mount BlazerJsonAPI::Engine, at: 'blazer-api'
30
33
  ```
31
34
 
32
35
  Configure authentication in an initializer as follows (e.g. in `initializers/blazer_json_api.rb`)
33
36
 
34
37
  ```ruby
35
- BlazerJsonAPI::Config.username = <api-username>
36
- BlazerJsonAPI::Config.password = <api-password>
38
+ BlazerJsonAPI.configure do |config|
39
+ config.username = 'api-username'
40
+ config.password = 'api-password'
41
+ end
37
42
  ```
38
43
 
39
44
  ## Usage
40
- Create queries as normal via Blazer and use the query identifier to render the JSON via the mounted location.
45
+ Create queries as normal via Blazer and use the query identifier to render the JSON via the mounted location.
46
+
47
+ e.g. `/blazer-api/queries/1-all-users` or `/blazer-api/queries/1`
48
+
49
+ URL params can be added where necessary also
41
50
 
42
- e.g. `/blazer-api/queries/1-all-users`
51
+ e.g. `/blazer-api/queries/1-all-users?username=blazer_user`
43
52
 
44
53
  ### Example queries
45
54
 
55
+ #### A simple index like request
56
+ Fetching specifics of all users as follows:
46
57
 
47
- > TODO
58
+ ```sql
59
+ SELECT id, username, first_name, last_name, email, country
60
+ FROM users
61
+ ```
62
+ This would result in the following API response
63
+ ```json
64
+ [
65
+ {
66
+ "id":1,
67
+ "username":"blazer_tommy",
68
+ "first_name":"Tom",
69
+ "last_name":"Carey",
70
+ "email":"tom.carey@gmail.com",
71
+ "country":"Ireland"
72
+ },
73
+ {
74
+ "id":2,
75
+ "username":"blazer_john",
76
+ "first_name":"John",
77
+ "last_name":"Doyle",
78
+ "email":"john.doyle@gmail.com",
79
+ "country":"USA"
80
+ }
81
+ ]
82
+ ```
83
+ #### A simple single resource GET request using a variable
48
84
 
49
- ## Contributing
85
+ Using a variable, a specific resource can be fetched.
86
+
87
+ **Note:** the use of `LIMIT 1` can be used to be explicit in desiring a single record in the response, as opposed to a collection
88
+
89
+ ```sql
90
+ SELECT id, username, first_name, last_name, email, country
91
+ FROM users
92
+ WHERE username={username}
93
+ LIMIT 1
94
+ ```
95
+ Now, the username can be passed as a URL parameter to the API to fetch the relevant record.
96
+
97
+ e.g. `/blazer-api/queries/1-all-users?username=blazer_john`
98
+
99
+ It would result in the following response.
100
+
101
+ ```json
102
+ {
103
+ "id":2,
104
+ "username":"blazer_john",
105
+ "first_name":"John",
106
+ "last_name":"Doyle",
107
+ "email":"john.doyle@gmail.com",
108
+ "country":"USA"
109
+ }
110
+ ```
111
+ #### Controlling response structure
112
+ Standard queries return flat JSON responses that correspond to the results table from executing the SQL.
113
+
114
+ It's possible to control the JSON structure by using double underscores to denote the desired nesting
115
+
116
+ Take, for example, the following query:
117
+
118
+ ```sql
119
+ SELECT users.id, username, first_name, last_name, teams.name as team__name, teams.location as team__location, email
120
+ FROM users
121
+ JOIN users ON users.team_id = teams.id
122
+ ```
50
123
 
124
+ Would result in the following structure in the response:
125
+
126
+ ```json
127
+ [
128
+ {
129
+ "id":1,
130
+ "username":"blazer_tommy",
131
+ "first_name":"Tom",
132
+ "last_name":"Carey",
133
+ "team":{
134
+ "name":"defenders",
135
+ "location":"Dublin"
136
+ },
137
+ "email":"tom.carey@gmail.com"
138
+ },
139
+ {
140
+ "id":2,
141
+ "username":"blazer_john",
142
+ "first_name":"John",
143
+ "last_name":"Doyle",
144
+ "team":{
145
+ "name":"responders",
146
+ "location":"London"
147
+ },
148
+ "email":"john.doyle@gmail.com"
149
+ }
150
+ ]
151
+ ```
152
+ Deeper nesting is also possible, just continue the pattern e.g. `a__deeper__nested__value`
153
+
154
+ #### Paginating potentially large responses
155
+ If your query could return a large response, it's generally a good idea to paginate it.
156
+
157
+ Pagination can be achieved in many ways, but a basic example can be done as follows using a combination
158
+ of variables in the query and `LIMIT` and `OFFSET`.
159
+
160
+ ```sql
161
+ SELECT id, username, first_name, last_name, email, country
162
+ FROM users
163
+ LIMIT {per_page}
164
+ OFFSET ({page}-1)*{per_page}
165
+ ```
166
+ Using this technique, URL params can be used by the requester to control pagination.
167
+
168
+ In this example, `page` corresponds to the desired page in the paginated collection and `per_page` corresponds to the desired size of records in each page
169
+
170
+ This technique can be used in combination with some default settings for these parameters in blazers config file `blazer.yml`.
171
+
172
+ Having defaults means if they are not specified by the requester, the defaults will automatically be applied.
173
+ ```yaml
174
+ variable_defaults:
175
+ # pagination defaults
176
+ per_page: 30
177
+ page: 1
178
+ ```
179
+
180
+ Requests can then be as follows:
181
+
182
+ `/blazer-api/queries/1-all-users` = returns first 30 users (pagination defaults apply automatically)
183
+
184
+ `/blazer-api/queries/1-all-users?page=2` = returns second page containing 30 users
185
+
186
+ `/blazer-api/queries/1-all-users?page=1&per_page=90` = returns first page containing 90 users
187
+
188
+
189
+ etc...
190
+
191
+ ## Contributing
192
+ Want to improve this library, please do!
51
193
 
52
- > TODO
194
+ * Report bugs
195
+ * Fix bugs and submit pull requests
196
+ * Write, clarify, or fix documentation
197
+ * Suggest or add new features
53
198
 
54
199
  ## License
55
200
  The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
@@ -1,15 +1,27 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module BlazerJsonAPI
3
+ module BlazerJsonApi
4
4
  class ApplicationController < ActionController::Base
5
+
6
+ if BlazerJsonAPI.credentials_provided?
7
+ http_basic_authenticate_with name: BlazerJsonAPI.username, password: BlazerJsonAPI.password
8
+ end
9
+
5
10
  protect_from_forgery with: :exception
11
+ before_action :check_authentication
6
12
 
7
13
  def record_not_found
8
14
  render json: [], status: :not_found
9
15
  end
10
16
 
11
- def render_errors(error_messages)
12
- render json: { errors: error_messages }, status: :bad_request
17
+ def render_errors(error_messages, status: :bad_request)
18
+ render json: { errors: error_messages }, status: status
19
+ end
20
+
21
+ def check_authentication
22
+ return if BlazerJsonAPI.credentials_provided?
23
+
24
+ render_errors(['Authentication credentials not set'], status: :unauthorized)
13
25
  end
14
26
  end
15
27
  end
@@ -1,10 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module BlazerJsonAPI
3
+ module BlazerJsonApi
4
4
  class QueriesController < ApplicationController
5
- if BlazerJsonAPI::Config.username && BlazerJsonAPI::Config.password
6
- http_basic_authenticate_with name: BlazerJsonAPI::Config.username, password: BlazerJsonAPI::Config.password
7
- end
8
5
  before_action :set_query
9
6
 
10
7
  def show
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module BlazerJsonAPI
3
+ module BlazerJsonApi
4
4
  module ApplicationHelper
5
5
  end
6
6
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module BlazerJsonAPI
3
+ module BlazerJsonApi
4
4
  class ApplicationJob < ActiveJob::Base
5
5
  end
6
6
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module BlazerJsonAPI
3
+ module BlazerJsonApi
4
4
  class ApplicationMailer < ActionMailer::Base
5
5
  default from: 'from@example.com'
6
6
  layout 'mailer'
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module BlazerJsonAPI
3
+ module BlazerJsonApi
4
4
  class ApplicationRecord < ActiveRecord::Base
5
5
  self.abstract_class = true
6
6
  end
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ module BlazerJsonAPI
4
+ module Configuration
5
+
6
+ VALID_OPTIONS_KEYS = %i[username password nesting_column_separator].freeze
7
+
8
+ DEFAULT_USERNAME = nil
9
+ DEFAULT_PASSWORD = nil
10
+ DEFAULT_NESTING_COLUMN_SEPARATOR = '__'.freeze
11
+
12
+ attr_accessor(*VALID_OPTIONS_KEYS)
13
+
14
+ def self.extended(base)
15
+ base.reset_config!
16
+ end
17
+
18
+ # Convenience method to allow configuration options to be set in a block
19
+ # e.g. in an initializer for the application
20
+ def configure
21
+ yield self
22
+ end
23
+
24
+ def credentials_provided?
25
+ username.present? && password.present?
26
+ end
27
+
28
+ def reset_config!
29
+ self.username = DEFAULT_USERNAME
30
+ self.password = DEFAULT_PASSWORD
31
+ self.nesting_column_separator = DEFAULT_NESTING_COLUMN_SEPARATOR
32
+ end
33
+ end
34
+ end
@@ -3,5 +3,9 @@
3
3
  module BlazerJsonAPI
4
4
  class Engine < ::Rails::Engine
5
5
  isolate_namespace BlazerJsonAPI
6
+
7
+ config.generators do |g|
8
+ g.test_framework :rspec
9
+ end
6
10
  end
7
11
  end
@@ -5,7 +5,7 @@
5
5
  # e.g. { 'parent__child': '1' } becomes { 'parent': { 'child': 1 }}
6
6
  module BlazerJsonAPI
7
7
  class ResultToNestedJson
8
- delegate :nesting_column_separator, to: BlazerJsonAPI::Config
8
+ delegate :nesting_column_separator, to: BlazerJsonAPI
9
9
 
10
10
  attr_reader :statement, :blazer_result
11
11
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BlazerJsonAPI
4
- VERSION = '0.1.1'
4
+ VERSION = '0.1.2'
5
5
  end
@@ -1,9 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'blazer_json_api/engine'
4
- require 'blazer_json_api/config'
4
+ require 'blazer_json_api/configuration'
5
5
  require 'blazer_json_api/process_statement_variables'
6
6
  require 'blazer_json_api/result_to_nested_json'
7
7
 
8
8
  module BlazerJsonAPI
9
+ extend BlazerJsonAPI::Configuration
9
10
  end
@@ -0,0 +1,70 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is copied to spec/ when you run 'rails generate rspec:install'
4
+ require 'spec_helper'
5
+ ENV['RAILS_ENV'] ||= 'test'
6
+ require File.expand_path('../config/environment', __dir__)
7
+ # Prevent database truncation if the environment is production
8
+ if Rails.env.production?
9
+ abort('The Rails environment is running in production mode!')
10
+ end
11
+ require 'rspec/rails'
12
+ # Add additional requires below this line. Rails is not loaded until this point!
13
+
14
+ # Requires supporting ruby files with custom matchers and macros, etc, in
15
+ # spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are
16
+ # run as spec files by default. This means that files in spec/support that end
17
+ # in _spec.rb will both be required and run as specs, causing the specs to be
18
+ # run twice. It is recommended that you do not name files matching this glob to
19
+ # end with _spec.rb. You can configure this pattern with the --pattern
20
+ # option on the command line or in ~/.rspec, .rspec or `.rspec-local`.
21
+ #
22
+ # The following line is provided for convenience purposes. It has the downside
23
+ # of increasing the boot-up time by auto-requiring all files in the support
24
+ # directory. Alternatively, in the individual `*_spec.rb` files, manually
25
+ # require only the support files necessary.
26
+ #
27
+ # Dir[Rails.root.join('spec', 'support', '**', '*.rb')].sort.each do |f|
28
+ # require f
29
+ # end
30
+
31
+ # Checks for pending migrations and applies them before tests are run.
32
+ # If you are not using ActiveRecord, you can remove these lines.
33
+ begin
34
+ ActiveRecord::Migration.maintain_test_schema!
35
+ rescue ActiveRecord::PendingMigrationError => e
36
+ puts e.to_s.strip
37
+ exit 1
38
+ end
39
+ RSpec.configure do |config|
40
+ # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
41
+ config.fixture_path = "#{::Rails.root}/spec/fixtures"
42
+
43
+ # If you're not using ActiveRecord, or you'd prefer not to run each of your
44
+ # examples within a transaction, remove the following line or assign false
45
+ # instead of true.
46
+ config.use_transactional_fixtures = true
47
+
48
+ # You can uncomment this line to turn off ActiveRecord support entirely.
49
+ # config.use_active_record = false
50
+
51
+ # RSpec Rails can automatically mix in different behaviours to your tests
52
+ # based on their file location, for example enabling you to call `get` and
53
+ # `post` in specs under `spec/controllers`.
54
+ #
55
+ # You can disable this behaviour by removing the line below, and instead
56
+ # explicitly tag your specs with their type, e.g.:
57
+ #
58
+ # RSpec.describe UsersController, type: :controller do
59
+ # # ...
60
+ # end
61
+ #
62
+ # The different available types are documented in the features, such as in
63
+ # https://relishapp.com/rspec/rspec-rails/docs
64
+ config.infer_spec_type_from_file_location!
65
+
66
+ # Filter lines from Rails gems in backtraces.
67
+ config.filter_rails_from_backtrace!
68
+ # arbitrary gems may also be filtered via:
69
+ # config.filter_gems_from_backtrace("gem name")
70
+ end
@@ -0,0 +1,100 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file was generated by the `rails generate rspec:install` command.
4
+ # Conventionally, all
5
+ # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
6
+ # The generated `.rspec` file contains `--require spec_helper` which will cause
7
+ # this file to always be loaded, without a need to explicitly require it in any
8
+ # files.
9
+ #
10
+ # Given that it is always loaded, you are encouraged to keep this file as
11
+ # light-weight as possible. Requiring heavyweight dependencies from this file
12
+ # will add to the boot time of your test suite on EVERY test run, even for an
13
+ # individual file that may not need all of that loaded. Instead, consider making
14
+ # a separate helper file that requires the additional dependencies and performs
15
+ # the additional setup, and require it from the spec files that actually need
16
+ # it.
17
+ #
18
+ # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
19
+ RSpec.configure do |config|
20
+ # rspec-expectations config goes here. You can use an alternate
21
+ # assertion/expectation library such as wrong or the stdlib/minitest
22
+ # assertions if you prefer.
23
+ config.expect_with :rspec do |expectations|
24
+ # This option will default to `true` in RSpec 4. It makes the `description`
25
+ # and `failure_message` of custom matchers include text for helper methods
26
+ # defined using `chain`, e.g.:
27
+ # be_bigger_than(2).and_smaller_than(4).description
28
+ # # => "be bigger than 2 and smaller than 4"
29
+ # ...rather than:
30
+ # # => "be bigger than 2"
31
+ expectations.include_chain_clauses_in_custom_matcher_descriptions = true
32
+ end
33
+
34
+ # rspec-mocks config goes here. You can use an alternate test double
35
+ # library (such as bogus or mocha) by changing the `mock_with` option here.
36
+ config.mock_with :rspec do |mocks|
37
+ # Prevents you from mocking or stubbing a method that does not exist on
38
+ # a real object. This is generally recommended, and will default to
39
+ # `true` in RSpec 4.
40
+ mocks.verify_partial_doubles = true
41
+ end
42
+
43
+ # This option will default to `:apply_to_host_groups` in RSpec 4 (and will
44
+ # have no way to turn it off -- the option exists only for backwards
45
+ # compatibility in RSpec 3). It causes shared context metadata to be
46
+ # inherited by the metadata hash of host groups and examples, rather than
47
+ # triggering implicit auto-inclusion in groups with matching metadata.
48
+ config.shared_context_metadata_behavior = :apply_to_host_groups
49
+
50
+ # The settings below are suggested to provide a good initial experience
51
+ # with RSpec, but feel free to customize to your heart's content.
52
+ # # This allows you to limit a spec run to individual examples or groups
53
+ # # you care about by tagging them with `:focus` metadata. When nothing
54
+ # # is tagged with `:focus`, all examples get run. RSpec also provides
55
+ # # aliases for `it`, `describe`, and `context` that include `:focus`
56
+ # # metadata: `fit`, `fdescribe` and `fcontext`, respectively.
57
+ # config.filter_run_when_matching :focus
58
+ #
59
+ # # Allows RSpec to persist some state between runs in order to support
60
+ # # the `--only-failures` and `--next-failure` CLI options. We recommend
61
+ # # you configure your source control system to ignore this file.
62
+ # config.example_status_persistence_file_path = "spec/examples.txt"
63
+ #
64
+ # # Limits the available syntax to the non-monkey patched syntax that is
65
+ # # recommended. For more details, see:
66
+ # # - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/
67
+ # # - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
68
+ # # - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode
69
+ # config.disable_monkey_patching!
70
+ #
71
+ # # Many RSpec users commonly either run the entire suite or an individual
72
+ # # file, and it's useful to allow more verbose output when running an
73
+ # # individual spec file.
74
+ # if config.files_to_run.one?
75
+ # # Use the documentation formatter for detailed output,
76
+ # # unless a formatter has already been configured
77
+ # # (e.g. via a command-line flag).
78
+ # config.default_formatter = "doc"
79
+ # end
80
+ #
81
+ # # Print the 10 slowest examples and example groups at the
82
+ # # end of the spec run, to help surface which specs are running
83
+ # # particularly slow.
84
+ # config.profile_examples = 10
85
+ #
86
+ # # Run specs in random order to surface order dependencies. If you find an
87
+ # # order dependency and want to debug it, you can fix the order by
88
+ # # providing
89
+ # # the seed, which is printed after each run.
90
+ # # --seed 1234
91
+ # config.order = :random
92
+ #
93
+ # # Seed global randomization in this process using the `--seed` CLI option.
94
+ # # Setting this allows you to use `--seed` to deterministically
95
+ # # reproduce
96
+ # # test failures related to randomization by passing the same `--seed`
97
+ # # value
98
+ # # as the one that triggered the failure.
99
+ # Kernel.srand config.seed
100
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blazer_json_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Farrell
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-11-02 00:00:00.000000000 Z
11
+ date: 2021-11-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -55,7 +55,7 @@ dependencies:
55
55
  description: An extension to the Blazer gem that makes it possible to expose queries
56
56
  as APIs
57
57
  email:
58
- - john.m.farrell1@gmail.com
58
+ - john.farrell@andopen.co
59
59
  executables: []
60
60
  extensions: []
61
61
  extra_rdoc_files: []
@@ -75,17 +75,19 @@ files:
75
75
  - app/views/layouts/blazer_json_api/application.html.erb
76
76
  - config/routes.rb
77
77
  - lib/blazer_json_api.rb
78
- - lib/blazer_json_api/config.rb
78
+ - lib/blazer_json_api/configuration.rb
79
79
  - lib/blazer_json_api/engine.rb
80
80
  - lib/blazer_json_api/process_statement_variables.rb
81
81
  - lib/blazer_json_api/result_to_nested_json.rb
82
82
  - lib/blazer_json_api/version.rb
83
83
  - lib/tasks/blazer_json_api_tasks.rake
84
- homepage: https://github.com/johnmfarrell1/blazer_json_api
84
+ - spec/rails_helper.rb
85
+ - spec/spec_helper.rb
86
+ homepage: https://gitlab.com/andopen/blazer_json_api
85
87
  licenses:
86
88
  - MIT
87
89
  metadata: {}
88
- post_install_message:
90
+ post_install_message:
89
91
  rdoc_options: []
90
92
  require_paths:
91
93
  - lib
@@ -93,15 +95,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
93
95
  requirements:
94
96
  - - ">="
95
97
  - !ruby/object:Gem::Version
96
- version: '2.4'
98
+ version: '2.5'
97
99
  required_rubygems_version: !ruby/object:Gem::Requirement
98
100
  requirements:
99
101
  - - ">="
100
102
  - !ruby/object:Gem::Version
101
103
  version: '0'
102
104
  requirements: []
103
- rubygems_version: 3.0.3
104
- signing_key:
105
+ rubygems_version: 3.1.2
106
+ signing_key:
105
107
  specification_version: 4
106
108
  summary: An API extension to the Blazer gem
107
- test_files: []
109
+ test_files:
110
+ - spec/spec_helper.rb
111
+ - spec/rails_helper.rb
@@ -1,12 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module BlazerJsonAPI
4
- class Config
5
- # defaults
6
- @@nesting_column_separator = '__'
7
-
8
- cattr_accessor :username
9
- cattr_accessor :password
10
- cattr_accessor :nesting_column_separator
11
- end
12
- end