grape-starter 2.1.3 → 3.0.0

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: d3c1d52c31b0631f1ea31beeaeff14f2336979b0c3c187e5d13b1a57a4d1d30f
4
- data.tar.gz: d8943b15a89ec8ade4a356acffb790d490887c528e6a5a38434f2f8b7d795db8
3
+ metadata.gz: 16ec3abd585c9a25a9fdf30d877561ccbd9b7c1b848b539cd8c63ec648492c60
4
+ data.tar.gz: f98a11d9d911ca17d66a69302067f110431dd423224a0104ca5649f9268e9c76
5
5
  SHA512:
6
- metadata.gz: f1a6e22693674c78bc15a24ac2f32500998ae236d0c1cb9828840eba8c52d4a0408e1440546b739c143f1cc4eaa4bee88a0a0a8f6371cf1f215281fb44d4dce2
7
- data.tar.gz: 652defd0f40d8ad17e7543f18cfe71f6fe171d442a54f283e80cbf572fa14a1c22bd361a405a7ab58661bf86a3e1e6730887dcc056a4bd4559544ecf19ea9524
6
+ metadata.gz: 2d2e6eff8352128af22fa344d6d7ddf80b208b3a2ecb65077023fffe6b5b0a5199d09958a70b586c79f94479bda70b69e80e0a5c2a3b599326b7d8a1a5cf0514
7
+ data.tar.gz: fab8485bdc93e8853e37e6fc345eb87da1f281d78584fe88d50a90706adf1876b7d9fcd3d0d4ed732333415cf0d34c877822a64ac3438e5e9175cadb58337add
@@ -16,7 +16,7 @@ jobs:
16
16
  - uses: actions/checkout@v3
17
17
  - uses: ruby/setup-ruby@v1
18
18
  with:
19
- ruby-version: '3.2'
19
+ ruby-version: '3.4'
20
20
  bundler-cache: true
21
21
  - name: Run rubocop
22
22
  run: bundle exec rubocop --parallel --format progress
@@ -28,7 +28,7 @@ jobs:
28
28
  RACK_ENV: test
29
29
  strategy:
30
30
  matrix:
31
- ruby-version: ['3.1', '3.2', head]
31
+ ruby-version: ['3.2', '3.3', '3.4', head]
32
32
 
33
33
  steps:
34
34
  - uses: actions/checkout@v3
data/.rubocop.yml CHANGED
@@ -15,8 +15,8 @@ AllCops:
15
15
  - api/**/*
16
16
  UseCache: true
17
17
  NewCops: enable
18
- TargetRubyVersion: 3.2
19
18
  SuggestExtensions: false
19
+ TargetRubyVersion: 3.4
20
20
 
21
21
  Layout/IndentationWidth:
22
22
  Exclude:
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 3.4.2
data/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  - contributions
4
4
 
5
+ ### v3.0.0 / 2025-04-14
6
+
7
+
8
+ - [(bb23d)](https://github.com/LeFnord/grape-starter/commit/bb23d62cbd04b445c616565c6788b28cde03507c) Updates grape requirement to ~> 2.0 [LeFnord](https://github.com/LeFnord)
9
+ - [(#50)](https://github.com/LeFnord/grape-starter/pull/50) Adds Ruby 3.4, drops 3.1 [LeFnord](https://github.com/LeFnord)
10
+
5
11
  ### v2.1.3 / 2023-10-31
6
12
 
7
13
  - [(#47)](https://github.com/LeFnord/grape-starter/pull/47) Minor Fixes. [LeFnord](https://github.com/LeFnord)
data/Gemfile CHANGED
@@ -5,7 +5,7 @@ source 'http://rubygems.org'
5
5
  gemspec
6
6
 
7
7
  group :development, :test do
8
- gem 'grape', '~> 1.5'
8
+ gem 'grape', '~> 2.0'
9
9
  gem 'pry', require: false
10
10
  gem 'pry-byebug', require: false
11
11
  gem 'rack-cors', require: false
@@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
22
22
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
23
23
  spec.require_paths = ['lib']
24
24
 
25
- spec.required_ruby_version = '>= 3.1'
25
+ spec.required_ruby_version = '>= 3.2'
26
26
 
27
27
  spec.add_dependency 'gli', '~> 2.20'
28
28
  spec.add_dependency 'activesupport', '>= 6', '< 8'
@@ -95,7 +95,7 @@ module Starter
95
95
  #
96
96
  def object?(definition:)
97
97
  definition['type'] == 'object' ||
98
- definition['content']&.keys&.first&.include?('application/json')
98
+ definition['content']&.keys&.first&.include?('application/json') # rubocop:disable Style/SafeNavigationChainLength
99
99
  end
100
100
 
101
101
  def simple_object?(properties:)
@@ -135,7 +135,7 @@ module Starter
135
135
 
136
136
  def serialized
137
137
  type = definition['type'] || definition['schema']['type']
138
- type.scan(/\w+/).each { |x| type.match?('JSON') ? type : type.sub!(x, x.capitalize) }
138
+ type.scan(/\w+/).each { |x| type.match?('JSON') ? type : type.sub!(x, x.capitalize) } # rubocop:disable Lint/Void
139
139
 
140
140
  if type == 'Array' && definition.key?('items')
141
141
  sub = definition.dig('items', 'type').to_s.capitalize
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Starter
4
- VERSION = '2.1.3'
4
+ VERSION = '3.0.0'
5
5
  end
@@ -7,6 +7,7 @@ AllCops:
7
7
  UseCache: true
8
8
  NewCops: enable
9
9
  SuggestExtensions: false
10
+ TargetRubyVersion: 3.4
10
11
 
11
12
  Layout/LineLength:
12
13
  Max: 120
data/template/Gemfile CHANGED
@@ -2,14 +2,17 @@
2
2
 
3
3
  source 'http://rubygems.org'
4
4
 
5
+ # moved from StdLib to gems
6
+ gem 'ostruct', require: false
7
+
5
8
  # Server stuff
6
9
  gem 'puma'
7
10
 
8
- gem 'rack', '< 3.0'
11
+ gem 'rack'
9
12
  gem 'rack-cors'
10
13
 
11
14
  # API stuff
12
- gem 'grape'
15
+ gem 'grape', '~> 2.0'
13
16
  gem 'grape-entity'
14
17
  gem 'grape-swagger'
15
18
  gem 'grape-swagger-entity'
@@ -10,18 +10,18 @@ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
10
10
  $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'api'))
11
11
  $LOAD_PATH.unshift(File.dirname(__FILE__))
12
12
 
13
- Dir[File.expand_path('../config/initializers/*.rb', __dir__)].sort.each do |initializer|
13
+ Dir[File.expand_path('../config/initializers/*.rb', __dir__)].each do |initializer|
14
14
  require initializer
15
15
  end
16
16
 
17
- Dir[File.expand_path('../lib/**/*.rb', __dir__)].sort.each do |lib|
17
+ Dir[File.expand_path('../lib/**/*.rb', __dir__)].each do |lib|
18
18
  require lib
19
19
  end
20
20
 
21
- Dir[File.expand_path('../api/entities/*.rb', __dir__)].sort.each do |entity|
21
+ Dir[File.expand_path('../api/entities/*.rb', __dir__)].each do |entity|
22
22
  require entity
23
23
  end
24
24
 
25
- Dir[File.expand_path('../api/endpoints/*.rb', __dir__)].sort.each do |endpoint|
25
+ Dir[File.expand_path('../api/endpoints/*.rb', __dir__)].each do |endpoint|
26
26
  require endpoint
27
27
  end
@@ -1,4 +1,9 @@
1
1
  #!/usr/bin/env ruby
2
+
3
+ ENV['RACK_ENV'] = 'development'
4
+
5
+ require File.expand_path('../config/application', __dir__)
6
+
2
7
  $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
3
8
 
4
9
  require 'bundler/setup'
@@ -6,7 +6,7 @@ require 'rack/test'
6
6
  require File.expand_path('../config/application', __dir__)
7
7
 
8
8
  grape_starter_gem = Gem::Specification.find_by_name('grape-starter').gem_dir
9
- Dir["#{grape_starter_gem}/lib/starter/rspec/**/*.rb"].sort.each { |f| require f }
9
+ Dir["#{grape_starter_gem}/lib/starter/rspec/**/*.rb"].each { |f| require f }
10
10
 
11
11
  RSpec.configure do |config|
12
12
  include Rack::Test::Methods
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grape-starter
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.3
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - LeFnord
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2023-10-31 00:00:00.000000000 Z
10
+ date: 2025-04-14 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: gli
@@ -101,6 +100,7 @@ files:
101
100
  - ".rspec"
102
101
  - ".rubocop.yml"
103
102
  - ".rubocop_todo.yml"
103
+ - ".ruby-version"
104
104
  - CHANGELOG.md
105
105
  - Gemfile
106
106
  - LICENSE
@@ -162,7 +162,6 @@ homepage: https://github.com/LeFnord/grape-starter
162
162
  licenses:
163
163
  - MIT
164
164
  metadata: {}
165
- post_install_message:
166
165
  rdoc_options: []
167
166
  require_paths:
168
167
  - lib
@@ -170,15 +169,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
170
169
  requirements:
171
170
  - - ">="
172
171
  - !ruby/object:Gem::Version
173
- version: '3.1'
172
+ version: '3.2'
174
173
  required_rubygems_version: !ruby/object:Gem::Requirement
175
174
  requirements:
176
175
  - - ">="
177
176
  - !ruby/object:Gem::Version
178
177
  version: '0'
179
178
  requirements: []
180
- rubygems_version: 3.4.21
181
- signing_key:
179
+ rubygems_version: 3.6.2
182
180
  specification_version: 4
183
181
  summary: Creates a Grape Rack skeleton
184
182
  test_files: []