grape-app 0.6.1 → 0.6.2

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: 589d82aa9d573d5eb1322f519820d73c3943497dd16222a675196d4bb7fe479d
4
- data.tar.gz: de0940d47a5c306028e14d8d42b5c0419edaa0b13e8cb913d7d35ab2605591ef
3
+ metadata.gz: 9079b3fecf5f3a3b1c932516924514892eb44870dfd67ac8225a1365153688ee
4
+ data.tar.gz: ecab0a13693a63e57f6a46995c7ef56913770588d73dbd111dc306d91fd27733
5
5
  SHA512:
6
- metadata.gz: f109e3446cd59a06d51f768c6caf65b5099423b26dc9d8d7fed409be9f351e519add129a52de1d53592689b68291071b61367a443bc6298acb18dc9e6049f5a2
7
- data.tar.gz: 6f48da3fd9ae536c53d19e306a79e888ddcf89438b56975b57daec14f83634819b347c6a2a5e5cab84143cae55bea8431c1e9321a437b6a0047a42270f8ab4f1
6
+ metadata.gz: 245ebdf92b8d4bde24c23abd453512894ad5d5835985ed74e67e8f6c5683e8fb76052b8f06df56c5d66a468a1ec3513616027fbfa73be394609320a3bc87a745
7
+ data.tar.gz: ff7594612fe461ba1dfce6981ca274c397003d8877365311bf2f8ce86fd4560bcdb3f9bf64d25b3d40f2bd0a1021bbb168c4c1cbf07d9d45d80ebf4bd2736352
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- grape-app (0.6.1)
4
+ grape-app (0.6.2)
5
5
  activesupport
6
6
  grape (>= 1.2.0)
7
7
  grape-entity
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s| # rubocop:disable Metrics/BlockLength
2
2
  s.name = 'grape-app'
3
- s.version = '0.6.1'
3
+ s.version = '0.6.2'
4
4
  s.authors = ['Black Square Media Ltd']
5
5
  s.email = ['info@blacksquaremedia.com']
6
6
  s.summary = %(Stanalone Grape API apps)
@@ -8,7 +8,7 @@ require 'active_support/core_ext/time/zones'
8
8
  require 'rack/cors'
9
9
  require 'rack/ssl-enforcer'
10
10
 
11
- class Grape::App < Grape::API
11
+ class Grape::App < Grape::API::Instance
12
12
  class << self
13
13
 
14
14
  # Run initializers
@@ -7,4 +7,6 @@ module API
7
7
  end
8
8
 
9
9
  # Mount root API to app
10
- Grape::App.mount API::V1
10
+ Grape::App.instance_eval do
11
+ mount API::V1
12
+ end
@@ -1,2 +1,2 @@
1
- class API::Base < Grape::API
1
+ class API::Base < Grape::API::Instance
2
2
  end
@@ -20,7 +20,7 @@ RSpec.describe Grape::App do
20
20
  end
21
21
 
22
22
  it 'should be an API instance' do
23
- expect(subject).to be < Grape::API
23
+ expect(subject).to be < Grape::API::Instance
24
24
  end
25
25
 
26
26
  it 'should init with default time zone' do
@@ -1,10 +1,12 @@
1
- require 'my_lib'
2
-
3
1
  module API
4
2
  extend ActiveSupport::Autoload
5
3
 
4
+ # Autoload API components
6
5
  autoload :V1
6
+ autoload :Base
7
7
  end
8
8
 
9
9
  # Mount root API to app
10
- Grape::App.mount API::V1
10
+ Grape::App.instance_eval do
11
+ mount API::V1
12
+ end
@@ -1,4 +1,4 @@
1
- class API::V1 < Grape::API
1
+ class API::V1 < API::Base
2
2
  version 'v1'
3
3
  format :json
4
4
 
@@ -13,5 +13,4 @@ class API::V1 < Grape::API
13
13
  get '/failing' do
14
14
  raise MyLib::BadRequest, 'bad request'
15
15
  end
16
-
17
16
  end
@@ -1,3 +1,5 @@
1
+ require 'my_lib'
2
+
1
3
  Grape::App.configure do |c|
2
4
  c.test_specific = true
3
5
  c.raise_on_missing_translations = true
@@ -3,7 +3,6 @@ class MyLib
3
3
  end
4
4
 
5
5
  class Middleware
6
-
7
6
  def initialize(app)
8
7
  @app = app
9
8
  end
@@ -13,6 +12,5 @@ class MyLib
13
12
  headers['X-MyApp'] = 'true'
14
13
  [status, headers, body]
15
14
  end
16
-
17
15
  end
18
16
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grape-app
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Black Square Media Ltd