grape-app 0.5.3 → 0.6.0

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: 41f23bad1b0bde492375ac52d86c29e03b20e85d5c976a24b5bf647eacfc8f27
4
- data.tar.gz: b5a923a5a8ceadc42254b495abe6e7ef5735cbaf3a7d5f4a0325d809bfcf7c4b
3
+ metadata.gz: 11a8672b13362989bb3faea02cbcc61de91d035d8a77aed324a4b7cf1b07e303
4
+ data.tar.gz: b26a1e9ff4856e6ea6c6b1bb5227e77e182af9f6ac3a4952652e854d444be83e
5
5
  SHA512:
6
- metadata.gz: c2dcfcd9cc76a9eb5512324b2f726a84efeab43c324d07b0c513c2857a4148d0c63580203c6aef4a81bb1b882e07176ed902aed2f9fb95cedd01009f4a8301e0
7
- data.tar.gz: 3eea8678d1dfcccbbbe1d98ad352187fb889d52f511785eb819e67c5a35aab2f2e8396abaf502464c4558df4b7c56d11295a65d05071328d96d14a4bcd0bd308
6
+ metadata.gz: 60572498effa35b2d85cece7c4dc4c6de23e5ac9d0df358284cb27db5b618cbdc797efe65b589175255eb408a8e3ae4511fedfa3f2a06b3d7c6baabec1e1cffd
7
+ data.tar.gz: 71accc244d0d64d9d72cce6a47a1440b305aac917b47e1aa991b1f52f48437dab2e9e58c086e545b6c3daa17cec175578ab5b5f64f73e1fdd0edfa347861c4df
@@ -1,7 +1,2 @@
1
1
  inherit_from:
2
- - https://storage.googleapis.com/bsm-misc/rubocop.yml
3
-
4
- AllCops:
5
- TargetRubyVersion: 2.2
6
- Exclude:
7
- - vendor/**/*
2
+ - https://bitbucket.org/bsm/misc/raw/master/rubocop/default.yml
@@ -1,6 +1,5 @@
1
1
  language: ruby
2
- sudo: false
3
2
  rvm:
4
- - 2.3.6
5
- - 2.4.3
6
- - 2.5.0
3
+ - 2.3
4
+ - 2.4
5
+ - 2.5
@@ -1,9 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- grape-app (0.5.3)
4
+ grape-app (0.6.0)
5
5
  activesupport
6
- grape (>= 1.0.0)
6
+ grape (>= 1.2.0)
7
7
  grape-entity
8
8
  rack-cors
9
9
  rack-ssl-enforcer
@@ -12,13 +12,13 @@ PATH
12
12
  GEM
13
13
  remote: https://rubygems.org/
14
14
  specs:
15
- activemodel (5.2.0)
16
- activesupport (= 5.2.0)
17
- activerecord (5.2.0)
18
- activemodel (= 5.2.0)
19
- activesupport (= 5.2.0)
15
+ activemodel (5.2.1.1)
16
+ activesupport (= 5.2.1.1)
17
+ activerecord (5.2.1.1)
18
+ activemodel (= 5.2.1.1)
19
+ activesupport (= 5.2.1.1)
20
20
  arel (>= 9.0)
21
- activesupport (5.2.0)
21
+ activesupport (5.2.1.1)
22
22
  concurrent-ruby (~> 1.0, >= 1.0.2)
23
23
  i18n (>= 0.7, < 2)
24
24
  minitest (~> 5.1)
@@ -32,12 +32,12 @@ GEM
32
32
  builder (3.2.3)
33
33
  coercible (1.0.0)
34
34
  descendants_tracker (~> 0.0.1)
35
- concurrent-ruby (1.0.5)
35
+ concurrent-ruby (1.1.3)
36
36
  descendants_tracker (0.0.4)
37
37
  thread_safe (~> 0.3, >= 0.3.1)
38
38
  diff-lcs (1.3)
39
39
  equalizer (0.0.11)
40
- grape (1.0.3)
40
+ grape (1.2.0)
41
41
  activesupport
42
42
  builder
43
43
  mustermann-grape (~> 1.0.0)
@@ -47,54 +47,56 @@ GEM
47
47
  grape-entity (0.7.1)
48
48
  activesupport (>= 4.0)
49
49
  multi_json (>= 1.3.2)
50
- i18n (1.0.1)
50
+ i18n (1.1.1)
51
51
  concurrent-ruby (~> 1.0)
52
52
  ice_nine (0.11.2)
53
+ jaro_winkler (1.5.1)
53
54
  minitest (5.11.3)
54
55
  multi_json (1.13.1)
55
- mustermann (1.0.2)
56
+ mustermann (1.0.3)
56
57
  mustermann-grape (1.0.0)
57
58
  mustermann (~> 1.0.0)
58
59
  parallel (1.12.1)
59
- parser (2.5.1.0)
60
+ parser (2.5.3.0)
60
61
  ast (~> 2.4.0)
61
- powerpack (0.1.1)
62
- rack (2.0.5)
62
+ powerpack (0.1.2)
63
+ rack (2.0.6)
63
64
  rack-accept (0.4.5)
64
65
  rack (>= 0.4)
65
66
  rack-cors (1.0.2)
66
67
  rack-ssl-enforcer (0.2.9)
67
- rack-test (1.0.0)
68
+ rack-test (1.1.0)
68
69
  rack (>= 1.0, < 3)
69
70
  rainbow (3.0.0)
70
71
  rake (12.3.1)
71
- rspec (3.7.0)
72
- rspec-core (~> 3.7.0)
73
- rspec-expectations (~> 3.7.0)
74
- rspec-mocks (~> 3.7.0)
75
- rspec-core (3.7.1)
76
- rspec-support (~> 3.7.0)
77
- rspec-expectations (3.7.0)
72
+ rspec (3.8.0)
73
+ rspec-core (~> 3.8.0)
74
+ rspec-expectations (~> 3.8.0)
75
+ rspec-mocks (~> 3.8.0)
76
+ rspec-core (3.8.0)
77
+ rspec-support (~> 3.8.0)
78
+ rspec-expectations (3.8.2)
78
79
  diff-lcs (>= 1.2.0, < 2.0)
79
- rspec-support (~> 3.7.0)
80
- rspec-mocks (3.7.0)
80
+ rspec-support (~> 3.8.0)
81
+ rspec-mocks (3.8.0)
81
82
  diff-lcs (>= 1.2.0, < 2.0)
82
- rspec-support (~> 3.7.0)
83
- rspec-support (3.7.1)
84
- rubocop (0.55.0)
83
+ rspec-support (~> 3.8.0)
84
+ rspec-support (3.8.0)
85
+ rubocop (0.60.0)
86
+ jaro_winkler (~> 1.5.1)
85
87
  parallel (~> 1.10)
86
- parser (>= 2.5)
88
+ parser (>= 2.5, != 2.5.1.1)
87
89
  powerpack (~> 0.1)
88
90
  rainbow (>= 2.2.2, < 4.0)
89
91
  ruby-progressbar (~> 1.7)
90
- unicode-display_width (~> 1.0, >= 1.0.1)
91
- ruby-progressbar (1.9.0)
92
+ unicode-display_width (~> 1.4.0)
93
+ ruby-progressbar (1.10.0)
92
94
  sqlite3 (1.3.13)
93
- thor (0.20.0)
95
+ thor (0.20.3)
94
96
  thread_safe (0.3.6)
95
97
  tzinfo (1.2.5)
96
98
  thread_safe (~> 0.1)
97
- unicode-display_width (1.3.2)
99
+ unicode-display_width (1.4.0)
98
100
  virtus (1.0.5)
99
101
  axiom-types (~> 0.1)
100
102
  coercible (~> 1.0)
@@ -115,4 +117,4 @@ DEPENDENCIES
115
117
  sqlite3
116
118
 
117
119
  BUNDLED WITH
118
- 1.16.1
120
+ 1.16.4
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  $LOAD_PATH.unshift(File.expand_path('../lib', __dir__)) if File.exist?(File.expand_path('../.git', __dir__))
4
- require "grape/app/cli"
4
+ require 'grape/app/cli'
@@ -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.5.3'
3
+ s.version = '0.6.0'
4
4
  s.authors = ['Black Square Media Ltd']
5
5
  s.email = ['info@blacksquaremedia.com']
6
6
  s.summary = %(Stanalone Grape API apps)
@@ -15,7 +15,7 @@ Gem::Specification.new do |s| # rubocop:disable Metrics/BlockLength
15
15
  s.required_ruby_version = '>= 2.2'
16
16
 
17
17
  s.add_dependency 'activesupport'
18
- s.add_dependency 'grape', '>= 1.0.0'
18
+ s.add_dependency 'grape', '>= 1.2.0'
19
19
  s.add_dependency 'grape-entity'
20
20
  s.add_dependency 'rack-cors'
21
21
  s.add_dependency 'rack-ssl-enforcer'
@@ -12,7 +12,7 @@ class Grape::App < Grape::API
12
12
  class << self
13
13
 
14
14
  # Run initializers
15
- def init!(root=nil) # rubocop:disable Metrics/AbcSize
15
+ def init!(root=nil)
16
16
  @root = Pathname.new(root) if root
17
17
 
18
18
  # Require bundle
@@ -11,24 +11,24 @@ module Grape::App::CLI
11
11
  end
12
12
 
13
13
  def copy_templates
14
- prefix = File.join(self.class.source_root, "")
14
+ prefix = File.join(self.class.source_root, '')
15
15
 
16
16
  Dir[File.join(self.class.source_root, '**', '*')].each do |file|
17
17
  next if File.directory?(file)
18
18
 
19
- file.sub! prefix, ""
19
+ file.sub! prefix, ''
20
20
  copy_file file, File.join(name, file)
21
21
  end
22
22
  end
23
23
 
24
24
  def init_lib
25
- empty_directory File.join(name, "lib", name)
25
+ empty_directory File.join(name, 'lib', name)
26
26
  end
27
27
 
28
28
  end
29
29
 
30
30
  class Runner < Thor
31
- register Builder, :new, "new NAME", "create a new application"
31
+ register Builder, :new, 'new NAME', 'create a new application'
32
32
 
33
33
  desc 'console ENV', 'Launch console'
34
34
  def console(env='development')
@@ -1,5 +1,5 @@
1
1
  task :environment do
2
- require Bundler.root.join("config", "environment").to_s
2
+ require Bundler.root.join('config', 'environment').to_s
3
3
  end
4
4
 
5
5
  desc 'Launch console'
@@ -16,7 +16,7 @@ desc 'List all routes'
16
16
  task routes: :environment do
17
17
  Grape::App.routes.each do |route|
18
18
  method = route.request_method.ljust(7)
19
- path = route.path.sub(":version", route.version.to_s)
19
+ path = route.path.sub(':version', route.version.to_s)
20
20
  puts " #{method} #{path}"
21
21
  end
22
22
  end
@@ -22,13 +22,13 @@ namespace :db do # rubocop:disable Metrics/BlockLength
22
22
  end
23
23
  end
24
24
 
25
- desc "Create a new migration using NAME"
25
+ desc 'Create a new migration using NAME'
26
26
  task migration: :environment do
27
- abort "No NAME specified. Example usage: `rake db:migration NAME=create_widgets`" unless ENV["NAME"]
27
+ abort 'No NAME specified. Example usage: `rake db:migration NAME=create_widgets`' unless ENV['NAME']
28
28
 
29
29
  migrations_path = ActiveRecord::Migrator.migrations_paths.first
30
30
 
31
- name = ENV["NAME"]
31
+ name = ENV['NAME']
32
32
  path = File.join(migrations_path, "#{Time.now.utc.strftime('%Y%m%d%H%M%S')}_#{name}.rb")
33
33
 
34
34
  ar_version = [ActiveRecord::VERSION::MAJOR, ActiveRecord::VERSION::MINOR].join('.')
@@ -44,7 +44,7 @@ namespace :db do # rubocop:disable Metrics/BlockLength
44
44
  end
45
45
 
46
46
  namespace :test do
47
- desc "Prepare test DB"
47
+ desc 'Prepare test DB'
48
48
  task :prepare
49
49
  end
50
50
 
@@ -12,24 +12,24 @@ RSpec.describe Grape::App do
12
12
 
13
13
  it 'should have an env' do
14
14
  expect(subject.env).to be_instance_of(ActiveSupport::StringInquirer)
15
- expect(subject.env).to eq("test")
15
+ expect(subject.env).to eq('test')
16
16
  end
17
17
 
18
18
  it 'should have an root' do
19
19
  expect(subject.root).to be_instance_of(Pathname)
20
20
  end
21
21
 
22
- it 'should be an API' do
23
- expect(subject).to be < Grape::API
22
+ it 'should be an API instance' do
23
+ expect(subject).to be < Grape::API::Instance
24
24
  end
25
25
 
26
26
  it 'should init with default time zone' do
27
- expect(Time.zone.name).to eq("UTC")
28
- expect(Thread.new { Time.zone }.value.name).to eq("UTC")
27
+ expect(Time.zone.name).to eq('UTC')
28
+ expect(Thread.new { Time.zone }.value.name).to eq('UTC')
29
29
  end
30
30
 
31
31
  it 'should configure i18n' do
32
- expect(I18n.load_path).to include(subject.root.join("config", "locales", "en.yml").to_s)
32
+ expect(I18n.load_path).to include(subject.root.join('config', 'locales', 'en.yml').to_s)
33
33
  expect(I18n.default_locale).to eq(:en)
34
34
  expect(I18n.exception_handler).to be_instance_of(Proc)
35
35
  end
@@ -46,7 +46,7 @@ RSpec.describe Grape::App do
46
46
  it 'should prepare middleware' do
47
47
  expect(subject.middleware).to be_instance_of(Rack::Builder)
48
48
  expect(subject.middleware.send(:instance_variable_get, :@use).size).to eq(2)
49
- expect(subject.middleware.send(:instance_variable_get, :@run)).to eq(subject)
49
+ expect(subject.middleware.send(:instance_variable_get, :@run)).to be(subject)
50
50
  end
51
51
 
52
52
  it 'should apply middleware' do
@@ -55,8 +55,8 @@ RSpec.describe Grape::App do
55
55
  expect(last_response).to be_ok
56
56
  expect(last_response.body).to eq(%({"status":"OK"}))
57
57
  expect(last_response.headers).to include(
58
- "Access-Control-Allow-Origin" => "*",
59
- "X-MyApp" => "true",
58
+ 'Access-Control-Allow-Origin' => '*',
59
+ 'X-MyApp' => 'true',
60
60
  )
61
61
 
62
62
  header 'Origin', 'test.host'
@@ -64,9 +64,8 @@ RSpec.describe Grape::App do
64
64
  expect(last_response).to be_bad_request
65
65
  expect(last_response.body).to eq(%({"error":"bad request"}))
66
66
  expect(last_response.headers).to include(
67
- "Access-Control-Allow-Origin" => "*",
68
- "X-MyApp" => "true",
67
+ 'Access-Control-Allow-Origin' => '*',
68
+ 'X-MyApp' => 'true',
69
69
  )
70
70
  end
71
-
72
71
  end
@@ -11,7 +11,7 @@ class API::V1 < Grape::API
11
11
  end
12
12
 
13
13
  get '/failing' do
14
- raise MyLib::BadRequest, "bad request"
14
+ raise MyLib::BadRequest, 'bad request'
15
15
  end
16
16
 
17
17
  end
@@ -1,3 +1,3 @@
1
- ENV['RACK_ENV'] ||= "test"
1
+ ENV['RACK_ENV'] ||= 'test'
2
2
  require 'grape-app'
3
- require "rack/test"
3
+ require 'rack/test'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grape-app
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.3
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Black Square Media Ltd
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-09 00:00:00.000000000 Z
11
+ date: 2018-11-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 1.0.0
33
+ version: 1.2.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: 1.0.0
40
+ version: 1.2.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: grape-entity
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -268,7 +268,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
268
268
  version: '0'
269
269
  requirements: []
270
270
  rubyforge_project:
271
- rubygems_version: 2.7.3
271
+ rubygems_version: 2.7.6
272
272
  signing_key:
273
273
  specification_version: 4
274
274
  summary: Stanalone Grape API apps