grape-starter 1.2.2 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/dependabot.yml +14 -0
- data/.github/workflows/ruby.yml +21 -0
- data/.gitignore +1 -0
- data/.rubocop.yml +85 -9
- data/.travis.yml +7 -5
- data/CHANGELOG.md +32 -2
- data/Gemfile +2 -2
- data/bin/grape-starter +0 -1
- data/grape-starter.gemspec +4 -4
- data/lib/starter/builder.rb +8 -5
- data/lib/starter/builder/names.rb +2 -0
- data/lib/starter/builder/orms.rb +7 -5
- data/lib/starter/builder/templates/activerecord.rb +4 -2
- data/lib/starter/builder/templates/endpoints.rb +15 -5
- data/lib/starter/builder/templates/sequel.rb +1 -1
- data/lib/starter/rake/grape_tasks.rb +4 -6
- data/lib/starter/version.rb +1 -1
- data/template/.rubocop.yml +87 -4
- data/template/Gemfile +1 -1
- data/template/api/endpoints/root.rb +4 -3
- data/template/config/boot.rb +4 -4
- data/template/spec/spec_helper.rb +1 -2
- metadata +16 -15
- data/template/.rubocop_todo.yml +0 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7a26894e42ff2662719a173e14b263e31673e2d36cb720c21476c507f8ce7c64
|
4
|
+
data.tar.gz: 47f4d1c8049d154566f801c991893a135cd3c6d99f07d6a5138193ab43ba9e97
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 14a3786d6abf9af32f733a0cd5168ccad2af04c3811143af0cf601572aa8ef51d5f1bbc3e12767c69c70f6789f6c4dc3d4e30cdb4cd061e0159c6e7a30e3dca9
|
7
|
+
data.tar.gz: 1e25c66a61297aaf2fb8baac8055f86a008a80e7f4c8268d97002db78acb29254932b8eec3956eb4eb3e5983e088eb52bfd3304e8cde1db5c0b3f45a064f23df
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# To get started with Dependabot version updates, you'll need to specify which
|
2
|
+
# package ecosystems to update and where the package manifests are located.
|
3
|
+
# Please see the documentation for all configuration options:
|
4
|
+
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
|
5
|
+
|
6
|
+
version: 2
|
7
|
+
updates:
|
8
|
+
- package-ecosystem: "bundler" # See documentation for possible values
|
9
|
+
directory: "/" # Location of package manifests
|
10
|
+
schedule:
|
11
|
+
interval: "weekly"
|
12
|
+
day: "friday"
|
13
|
+
assignees:
|
14
|
+
- "LeFnord"
|
@@ -0,0 +1,21 @@
|
|
1
|
+
name: Ruby
|
2
|
+
|
3
|
+
on: [push]
|
4
|
+
|
5
|
+
jobs:
|
6
|
+
build:
|
7
|
+
|
8
|
+
runs-on: ubuntu-latest
|
9
|
+
|
10
|
+
steps:
|
11
|
+
- uses: actions/checkout@v1
|
12
|
+
- name: Set up Ruby 2.7
|
13
|
+
uses: actions/setup-ruby@v1
|
14
|
+
with:
|
15
|
+
ruby-version: 2.7.1
|
16
|
+
- name: Build and test with Rake
|
17
|
+
run: |
|
18
|
+
gem install bundler
|
19
|
+
bundle install --jobs 4 --retry 3
|
20
|
+
bundle exec rspec
|
21
|
+
bundle exec rubocop
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
@@ -5,24 +5,25 @@ AllCops:
|
|
5
5
|
- '**/bin/**/*'
|
6
6
|
- '**/tmp/**/*'
|
7
7
|
- '**/script/**/*'
|
8
|
-
# - '**/template/**/*'
|
9
8
|
- '**/template/api/**'
|
10
9
|
- grape-starter.gemspec
|
10
|
+
- template/spec/spec-helper.rb
|
11
11
|
UseCache: true
|
12
|
-
|
12
|
+
NewCops: enable
|
13
|
+
TargetRubyVersion: 2.7
|
13
14
|
|
14
15
|
Layout/IndentationWidth:
|
15
16
|
Exclude:
|
16
17
|
- 'lib/starter/builder/templates/files.rb'
|
17
18
|
- 'lib/starter/builder/templates/endpoints.rb'
|
18
19
|
|
20
|
+
Layout/LineLength:
|
21
|
+
Max: 120
|
22
|
+
|
19
23
|
Metrics/BlockLength:
|
20
24
|
Exclude:
|
21
25
|
- 'spec/**/*'
|
22
26
|
|
23
|
-
Metrics/LineLength:
|
24
|
-
Max: 120
|
25
|
-
|
26
27
|
Metrics/AbcSize:
|
27
28
|
Max: 20
|
28
29
|
|
@@ -38,7 +39,82 @@ Style/AsciiComments:
|
|
38
39
|
Enabled: false
|
39
40
|
|
40
41
|
Style/Documentation:
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
42
|
+
Enabled: false
|
43
|
+
|
44
|
+
# introduced in 0.88
|
45
|
+
Layout/EmptyLinesAroundAttributeAccessor:
|
46
|
+
Enabled: true
|
47
|
+
Layout/SpaceAroundMethodCallOperator:
|
48
|
+
Enabled: true
|
49
|
+
Lint/DeprecatedOpenSSLConstant:
|
50
|
+
Enabled: true
|
51
|
+
Lint/MixedRegexpCaptureTypes:
|
52
|
+
Enabled: true
|
53
|
+
Lint/RaiseException:
|
54
|
+
Enabled: true
|
55
|
+
Lint/StructNewOverride:
|
56
|
+
Enabled: true
|
57
|
+
Style/ExponentialNotation:
|
58
|
+
Enabled: true
|
59
|
+
Style/HashEachMethods:
|
60
|
+
Enabled: true
|
61
|
+
Style/HashTransformKeys:
|
62
|
+
Enabled: true
|
63
|
+
Style/HashTransformValues:
|
64
|
+
Enabled: true
|
65
|
+
Style/RedundantFetchBlock:
|
66
|
+
Enabled: true
|
67
|
+
Style/RedundantRegexpCharacterClass:
|
68
|
+
Enabled: true
|
69
|
+
Style/RedundantRegexpEscape:
|
70
|
+
Enabled: true
|
71
|
+
Style/SlicingWithRange:
|
72
|
+
Enabled: true
|
73
|
+
|
74
|
+
# introduced in 0.89
|
75
|
+
Lint/BinaryOperatorWithIdenticalOperands:
|
76
|
+
Enabled: true
|
77
|
+
Lint/DuplicateElsifCondition:
|
78
|
+
Enabled: true
|
79
|
+
Lint/DuplicateRescueException:
|
80
|
+
Enabled: true
|
81
|
+
Lint/EmptyConditionalBody:
|
82
|
+
Enabled: true
|
83
|
+
Lint/FloatComparison:
|
84
|
+
Enabled: true
|
85
|
+
Lint/MissingSuper:
|
86
|
+
Enabled: true
|
87
|
+
Lint/OutOfRangeRegexpRef:
|
88
|
+
Enabled: true
|
89
|
+
Lint/SelfAssignment:
|
90
|
+
Enabled: true
|
91
|
+
Lint/TopLevelReturnWithArgument:
|
92
|
+
Enabled: true
|
93
|
+
Lint/UnreachableLoop:
|
94
|
+
Enabled: true
|
95
|
+
Style/AccessorGrouping:
|
96
|
+
Enabled: false
|
97
|
+
Style/ArrayCoercion:
|
98
|
+
Enabled: true
|
99
|
+
Style/BisectedAttrAccessor:
|
100
|
+
Enabled: true
|
101
|
+
Style/CaseLikeIf:
|
102
|
+
Enabled: true
|
103
|
+
Style/ExplicitBlockArgument:
|
104
|
+
Enabled: true
|
105
|
+
Style/GlobalStdStream:
|
106
|
+
Enabled: true
|
107
|
+
Style/HashAsLastArrayItem:
|
108
|
+
Enabled: true
|
109
|
+
Style/HashLikeCase:
|
110
|
+
Enabled: true
|
111
|
+
Style/OptionalBooleanParameter:
|
112
|
+
Enabled: true
|
113
|
+
Style/RedundantAssignment:
|
114
|
+
Enabled: true
|
115
|
+
Style/RedundantFileExtensionInRequire:
|
116
|
+
Enabled: true
|
117
|
+
Style/SingleArgumentDig:
|
118
|
+
Enabled: true
|
119
|
+
Style/StringConcatenation:
|
120
|
+
Enabled: true
|
data/.travis.yml
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
language: ruby
|
2
|
-
|
2
|
+
os: linux
|
3
3
|
sudo: false
|
4
4
|
|
5
5
|
before_install:
|
@@ -7,11 +7,13 @@ before_install:
|
|
7
7
|
|
8
8
|
rvm:
|
9
9
|
- ruby-head
|
10
|
-
- 2.
|
11
|
-
- 2.5
|
10
|
+
- 2.7.0
|
11
|
+
- 2.6.5
|
12
|
+
- 2.5.7
|
12
13
|
|
13
|
-
|
14
|
+
jobs:
|
14
15
|
fast_finish: true
|
15
16
|
|
16
17
|
allow_failures:
|
17
|
-
- rvm:
|
18
|
+
- rvm:
|
19
|
+
- ruby-head
|
data/CHANGELOG.md
CHANGED
@@ -1,8 +1,38 @@
|
|
1
1
|
### NEXT
|
2
2
|
|
3
|
-
- contributions
|
3
|
+
- your contributions
|
4
4
|
|
5
|
-
|
5
|
+
### v1.3.0 2020-09-15
|
6
|
+
|
7
|
+
- Fixes migration name. [LeFnord](https://github.com/LeFnord)
|
8
|
+
- Fixes rubocop new cops handling. [LeFnord](https://github.com/LeFnord)
|
9
|
+
|
10
|
+
### v1.2.4--v1.2.6 2020-01-18--2020-08-13
|
11
|
+
|
12
|
+
- Prepapre releaase 1.2.6 [LeFnord](https://github.com/LeFnord)
|
13
|
+
- Updates used default rails deps versions. [LeFnord](https://github.com/LeFnord)
|
14
|
+
- Create dependabot.yml [peter scholz](https://github.com/LeFnord)
|
15
|
+
- Prepare release 1.2.5 [LeFnord](https://github.com/LeFnord)
|
16
|
+
- Minor improvements. [LeFnord](https://github.com/LeFnord)
|
17
|
+
- Lets run GH actions again. [LeFnord](https://github.com/LeFnord)
|
18
|
+
- Minor template improvements. [LeFnord](https://github.com/LeFnord)
|
19
|
+
- Changes ruby.yml to use 2.7 [LeFnord](https://github.com/LeFnord)
|
20
|
+
- Prepare release 1.2.4 [LeFnord](https://github.com/LeFnord)
|
21
|
+
- Respects froozen string stuff. [LeFnord](https://github.com/LeFnord)
|
22
|
+
- Updates Ruby and deps. (#23) [LeFnord](https://github.com/LeFnord)
|
23
|
+
- Create ruby.yml [LeFnord](https://github.com/LeFnord)
|
24
|
+
|
25
|
+
- Fixes gems for sequel. [LeFnord](https://github.com/LeFnord)
|
26
|
+
- Minor template improvements. [LeFnord](https://github.com/LeFnord)
|
27
|
+
|
28
|
+
### v1.2.3 / 2019-12-15
|
29
|
+
|
30
|
+
- Removes require pry. [LeFnord](LeFnord) closes [!21](https://github.com/LeFnord/grape-starter/issues/21)
|
31
|
+
- [#22](https://github.com/LeFnord/grape-starter/pull/22) - accomodate activerecord 6.0 (#22) [Ignacio Carrera](https://github.com/nachokb)
|
32
|
+
|
33
|
+
### v1.2.2 / 2019-02-28
|
34
|
+
|
35
|
+
- Fixes loading of `aplication` instead of `environment` in `config.ru`
|
6
36
|
- [#19](https://github.com/LeFnord/grape-starter/pull/19) - Adds a module under lib as namespace. [LeFnord](https://github.com/LeFnord)
|
7
37
|
|
8
38
|
### v1.2.1 / 2019-02-24
|
data/Gemfile
CHANGED
@@ -5,12 +5,12 @@ source 'http://rubygems.org'
|
|
5
5
|
gemspec
|
6
6
|
|
7
7
|
group :development, :test do
|
8
|
-
gem 'grape', '~> 1.
|
8
|
+
gem 'grape', '~> 1.4'
|
9
9
|
gem 'pry', platforms: [:mri]
|
10
10
|
gem 'pry-byebug', platforms: [:mri]
|
11
11
|
gem 'rack-cors', require: false
|
12
12
|
gem 'rack-test', require: false
|
13
|
-
gem 'rake', '~>
|
13
|
+
gem 'rake', '~> 13.0'
|
14
14
|
gem 'rspec', '~> 3.8'
|
15
15
|
gem 'rspec-command'
|
16
16
|
end
|
data/bin/grape-starter
CHANGED
data/grape-starter.gemspec
CHANGED
@@ -24,8 +24,8 @@ Gem::Specification.new do |spec|
|
|
24
24
|
|
25
25
|
spec.required_ruby_version = '>= 2.5'
|
26
26
|
|
27
|
-
spec.add_dependency 'gli', '~> 2.
|
28
|
-
spec.add_dependency 'activesupport', '~>
|
29
|
-
spec.add_dependency 'rubocop', '~> 0.
|
30
|
-
spec.add_dependency 'awesome_print', '~> 1.
|
27
|
+
spec.add_dependency 'gli', '~> 2.19'
|
28
|
+
spec.add_dependency 'activesupport', '~> 6.0'
|
29
|
+
spec.add_dependency 'rubocop', '~> 0.89'
|
30
|
+
spec.add_dependency 'awesome_print', '~> 1.8'
|
31
31
|
end
|
data/lib/starter/builder.rb
CHANGED
@@ -18,6 +18,7 @@ module Starter
|
|
18
18
|
|
19
19
|
class << self
|
20
20
|
attr_reader :prefix, :resource, :set, :force, :entity, :destination, :orm
|
21
|
+
|
21
22
|
#
|
22
23
|
# public methods
|
23
24
|
#
|
@@ -41,8 +42,10 @@ module Starter
|
|
41
42
|
config_static.each do |config|
|
42
43
|
replace_static(File.join(config[:file]), config[:pattern])
|
43
44
|
end
|
45
|
+
|
44
46
|
add_namespace_with_version
|
45
|
-
|
47
|
+
|
48
|
+
Orms.build(name, destination, options[:orm]) if options[:orm]
|
46
49
|
|
47
50
|
Starter::Config.save(
|
48
51
|
dest: destination,
|
@@ -84,8 +87,8 @@ module Starter
|
|
84
87
|
|
85
88
|
file_list.map { |x| send("#{x}_name") }.each do |file_to_remove|
|
86
89
|
FileUtils.rm file_to_remove
|
87
|
-
rescue StandardError =>
|
88
|
-
$stdout.puts
|
90
|
+
rescue StandardError => e
|
91
|
+
$stdout.puts e.to_s
|
89
92
|
end
|
90
93
|
|
91
94
|
remove_mount_point
|
@@ -125,9 +128,9 @@ module Starter
|
|
125
128
|
#
|
126
129
|
# replace something in static files
|
127
130
|
def replace_static(file, replacement)
|
128
|
-
|
131
|
+
file_path = File.join(destination, file)
|
129
132
|
|
130
|
-
FileFoo.call!(
|
133
|
+
FileFoo.call!(file_path) { |content| content.gsub!('{{{grape-starter}}}', replacement.to_s) }
|
131
134
|
end
|
132
135
|
|
133
136
|
# #add! a new resource releated helper methods
|
@@ -24,9 +24,11 @@ module Starter
|
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
27
|
+
# rubocop:disable Style/StringConcatenation
|
27
28
|
def base_file_name
|
28
29
|
@resource.tr('/', '-').downcase + '.rb'
|
29
30
|
end
|
31
|
+
# rubocop:enable Style/StringConcatenation
|
30
32
|
|
31
33
|
def base_spec_name
|
32
34
|
base_file_name.gsub(/.rb$/, '_spec.rb')
|
data/lib/starter/builder/orms.rb
CHANGED
@@ -3,10 +3,12 @@
|
|
3
3
|
module Starter
|
4
4
|
class Orms
|
5
5
|
class << self
|
6
|
-
def build(dest, orm)
|
6
|
+
def build(name, dest, orm)
|
7
7
|
load_orm(orm: orm)
|
8
8
|
return if @orm.nil?
|
9
9
|
|
10
|
+
@name = name
|
11
|
+
|
10
12
|
if @orm == 'ar' || @orm == 'activerecord'
|
11
13
|
# Fixes pooling
|
12
14
|
add_middleware(dest, 'ActiveRecord::Rack::ConnectionManagement')
|
@@ -35,21 +37,21 @@ module Starter
|
|
35
37
|
encoding: unicode
|
36
38
|
timeout: 5000
|
37
39
|
user: postgres
|
38
|
-
database:
|
40
|
+
database: #{@name}_development
|
39
41
|
|
40
42
|
test:
|
41
43
|
adapter: #{adapter}
|
42
44
|
encoding: unicode
|
43
45
|
timeout: 5000
|
44
46
|
user: postgres
|
45
|
-
database:
|
47
|
+
database: #{@name}_test
|
46
48
|
|
47
49
|
production:
|
48
50
|
adapter: #{adapter}
|
49
51
|
encoding: unicode
|
50
52
|
timeout: 5000
|
51
53
|
user: postgres
|
52
|
-
database:
|
54
|
+
database: #{@name}_production
|
53
55
|
FILE
|
54
56
|
end
|
55
57
|
|
@@ -57,7 +59,7 @@ module Starter
|
|
57
59
|
load_orm
|
58
60
|
return if @orm.nil?
|
59
61
|
|
60
|
-
file_name = "#{Time.now.strftime('%Y%m%d%H%m%S')}
|
62
|
+
file_name = "#{Time.now.strftime('%Y%m%d%H%m%S')}_create_#{klass_name.downcase}.rb"
|
61
63
|
migration_dest = File.join(Dir.pwd, 'db', 'migrate', file_name)
|
62
64
|
FileFoo.write_file(migration_dest, migration(klass_name, resource))
|
63
65
|
end
|
@@ -9,6 +9,8 @@ module Starter
|
|
9
9
|
|
10
10
|
def initializer
|
11
11
|
<<-FILE.strip_heredoc
|
12
|
+
# frozen_string_literal: true
|
13
|
+
|
12
14
|
require 'yaml'
|
13
15
|
require 'erb'
|
14
16
|
require 'active_record'
|
@@ -71,14 +73,14 @@ module Starter
|
|
71
73
|
gem 'standalone_migrations'
|
72
74
|
|
73
75
|
# DB stuff
|
74
|
-
gem 'activerecord', '
|
76
|
+
gem 'activerecord', '>= 6'
|
75
77
|
gem 'pg'
|
76
78
|
FILE
|
77
79
|
end
|
78
80
|
|
79
81
|
def migration(klass_name, resource)
|
80
82
|
<<-FILE.strip_heredoc
|
81
|
-
class Create#{klass_name} < ActiveRecord::Migration[
|
83
|
+
class Create#{klass_name} < ActiveRecord::Migration[6.0]
|
82
84
|
def change
|
83
85
|
create_table :#{resource} do |t|
|
84
86
|
|
@@ -29,7 +29,9 @@ module Starter
|
|
29
29
|
# POST
|
30
30
|
def post
|
31
31
|
"
|
32
|
-
desc 'create #{resource.singularize}'
|
32
|
+
desc 'create #{resource.singularize}' do
|
33
|
+
tags %w[#{resource.singularize}]
|
34
|
+
end
|
33
35
|
params do
|
34
36
|
# TODO: specify the parameters
|
35
37
|
end
|
@@ -41,17 +43,22 @@ module Starter
|
|
41
43
|
# GET
|
42
44
|
def get_all
|
43
45
|
"
|
44
|
-
desc 'get all of #{resource.pluralize}'
|
45
|
-
|
46
|
+
desc 'get all of #{resource.pluralize}' do
|
47
|
+
is_array true
|
48
|
+
tags %w[#{resource.singularize}]
|
49
|
+
end
|
46
50
|
get do
|
47
51
|
# your code goes here
|
48
52
|
end"
|
49
53
|
end
|
50
54
|
|
55
|
+
# rubocop:disable Style/CombinableLoops
|
51
56
|
%w[get put patch delete].each do |verb|
|
52
57
|
define_method(:"#{verb}_one") do
|
53
58
|
"
|
54
|
-
desc '#{verb} #{resource.singularize}'
|
59
|
+
desc '#{verb} #{resource.singularize}' do
|
60
|
+
tags %w[#{resource.singularize}]
|
61
|
+
end
|
55
62
|
#{verb} do
|
56
63
|
# your code goes here
|
57
64
|
end"
|
@@ -61,7 +68,9 @@ module Starter
|
|
61
68
|
%w[get put patch delete].each do |verb|
|
62
69
|
define_method(:"#{verb}_specific") do
|
63
70
|
"
|
64
|
-
desc '#{verb} specific #{resource.singularize}'
|
71
|
+
desc '#{verb} specific #{resource.singularize}' do
|
72
|
+
tags %w[#{resource.singularize}]
|
73
|
+
end
|
65
74
|
params do
|
66
75
|
requires :id
|
67
76
|
end
|
@@ -70,6 +79,7 @@ module Starter
|
|
70
79
|
end"
|
71
80
|
end
|
72
81
|
end
|
82
|
+
# rubocop:enable Style/CombinableLoops
|
73
83
|
|
74
84
|
# request specs shared examples
|
75
85
|
#
|
@@ -52,16 +52,14 @@ module Starter
|
|
52
52
|
def build_path(route)
|
53
53
|
path = route.path
|
54
54
|
|
55
|
-
path.sub
|
56
|
-
path.sub
|
55
|
+
path = path.sub(/\(\.\w+?\)$/, '')
|
56
|
+
path = path.sub('(.:format)', '')
|
57
57
|
|
58
58
|
if route.version
|
59
|
-
path.sub
|
59
|
+
path.sub(':version', route.version.to_s)
|
60
60
|
else
|
61
|
-
path.sub
|
61
|
+
path.sub('/:version', '')
|
62
62
|
end
|
63
|
-
|
64
|
-
path
|
65
63
|
end
|
66
64
|
|
67
65
|
def app
|
data/lib/starter/version.rb
CHANGED
data/template/.rubocop.yml
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
inherit_from: .rubocop_todo.yml
|
2
|
-
|
3
1
|
AllCops:
|
4
2
|
Exclude:
|
5
3
|
- '**/tmp/**/*'
|
@@ -7,16 +5,101 @@ AllCops:
|
|
7
5
|
- Rakefile
|
8
6
|
- Gemfile
|
9
7
|
UseCache: true
|
10
|
-
|
8
|
+
NewCops: enable
|
9
|
+
TargetRubyVersion: 2.7
|
11
10
|
|
12
|
-
|
11
|
+
Layout/LineLength:
|
13
12
|
Max: 120
|
14
13
|
|
15
14
|
Metrics/AbcSize:
|
16
15
|
Max: 20
|
17
16
|
|
17
|
+
Metrics/BlockLength:
|
18
|
+
Exclude:
|
19
|
+
- 'api/endpoints/**/*'
|
18
20
|
Metrics/MethodLength:
|
19
21
|
Max: 20
|
20
22
|
|
21
23
|
Style/AsciiComments:
|
22
24
|
Enabled: false
|
25
|
+
|
26
|
+
Style/Documentation:
|
27
|
+
Enabled: false
|
28
|
+
|
29
|
+
# introduced in 0.88
|
30
|
+
Layout/EmptyLinesAroundAttributeAccessor:
|
31
|
+
Enabled: true
|
32
|
+
Layout/SpaceAroundMethodCallOperator:
|
33
|
+
Enabled: true
|
34
|
+
Lint/DeprecatedOpenSSLConstant:
|
35
|
+
Enabled: true
|
36
|
+
Lint/MixedRegexpCaptureTypes:
|
37
|
+
Enabled: true
|
38
|
+
Lint/RaiseException:
|
39
|
+
Enabled: true
|
40
|
+
Lint/StructNewOverride:
|
41
|
+
Enabled: true
|
42
|
+
Style/ExponentialNotation:
|
43
|
+
Enabled: true
|
44
|
+
Style/HashEachMethods:
|
45
|
+
Enabled: true
|
46
|
+
Style/HashTransformKeys:
|
47
|
+
Enabled: true
|
48
|
+
Style/HashTransformValues:
|
49
|
+
Enabled: true
|
50
|
+
Style/RedundantFetchBlock:
|
51
|
+
Enabled: true
|
52
|
+
Style/RedundantRegexpCharacterClass:
|
53
|
+
Enabled: true
|
54
|
+
Style/RedundantRegexpEscape:
|
55
|
+
Enabled: true
|
56
|
+
Style/SlicingWithRange:
|
57
|
+
Enabled: true
|
58
|
+
|
59
|
+
# introduced in 0.89
|
60
|
+
Lint/BinaryOperatorWithIdenticalOperands:
|
61
|
+
Enabled: true
|
62
|
+
Lint/DuplicateElsifCondition:
|
63
|
+
Enabled: true
|
64
|
+
Lint/DuplicateRescueException:
|
65
|
+
Enabled: true
|
66
|
+
Lint/EmptyConditionalBody:
|
67
|
+
Enabled: true
|
68
|
+
Lint/FloatComparison:
|
69
|
+
Enabled: true
|
70
|
+
Lint/MissingSuper:
|
71
|
+
Enabled: true
|
72
|
+
Lint/OutOfRangeRegexpRef:
|
73
|
+
Enabled: true
|
74
|
+
Lint/SelfAssignment:
|
75
|
+
Enabled: true
|
76
|
+
Lint/TopLevelReturnWithArgument:
|
77
|
+
Enabled: true
|
78
|
+
Lint/UnreachableLoop:
|
79
|
+
Enabled: true
|
80
|
+
Style/AccessorGrouping:
|
81
|
+
Enabled: false
|
82
|
+
Style/ArrayCoercion:
|
83
|
+
Enabled: true
|
84
|
+
Style/BisectedAttrAccessor:
|
85
|
+
Enabled: true
|
86
|
+
Style/CaseLikeIf:
|
87
|
+
Enabled: true
|
88
|
+
Style/ExplicitBlockArgument:
|
89
|
+
Enabled: true
|
90
|
+
Style/GlobalStdStream:
|
91
|
+
Enabled: true
|
92
|
+
Style/HashAsLastArrayItem:
|
93
|
+
Enabled: true
|
94
|
+
Style/HashLikeCase:
|
95
|
+
Enabled: true
|
96
|
+
Style/OptionalBooleanParameter:
|
97
|
+
Enabled: true
|
98
|
+
Style/RedundantAssignment:
|
99
|
+
Enabled: true
|
100
|
+
Style/RedundantFileExtensionInRequire:
|
101
|
+
Enabled: true
|
102
|
+
Style/SingleArgumentDig:
|
103
|
+
Enabled: true
|
104
|
+
Style/StringConcatenation:
|
105
|
+
Enabled: true
|
data/template/Gemfile
CHANGED
@@ -6,9 +6,10 @@ module Api
|
|
6
6
|
module Endpoints
|
7
7
|
class Root < Grape::API
|
8
8
|
namespace :root do
|
9
|
-
desc 'Exposes all routes'
|
10
|
-
|
11
|
-
|
9
|
+
desc 'Exposes all routes' do
|
10
|
+
success Entities::Route
|
11
|
+
is_array true
|
12
|
+
end
|
12
13
|
get do
|
13
14
|
api_routes = Starter::Rake::GrapeTasks.new(::Api::Base).api_routes
|
14
15
|
|
data/template/config/boot.rb
CHANGED
@@ -9,18 +9,18 @@ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
|
9
9
|
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'api'))
|
10
10
|
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
11
11
|
|
12
|
-
Dir[File.expand_path('../config/initializers/*.rb', __dir__)].each do |initializer|
|
12
|
+
Dir[File.expand_path('../config/initializers/*.rb', __dir__)].sort.each do |initializer|
|
13
13
|
require initializer
|
14
14
|
end
|
15
15
|
|
16
|
-
Dir[File.expand_path('../lib/**/*.rb', __dir__)].each do |lib|
|
16
|
+
Dir[File.expand_path('../lib/**/*.rb', __dir__)].sort.each do |lib|
|
17
17
|
require lib
|
18
18
|
end
|
19
19
|
|
20
|
-
Dir[File.expand_path('../api/entities/*.rb', __dir__)].each do |entity|
|
20
|
+
Dir[File.expand_path('../api/entities/*.rb', __dir__)].sort.each do |entity|
|
21
21
|
require entity
|
22
22
|
end
|
23
23
|
|
24
|
-
Dir[File.expand_path('../api/endpoints/*.rb', __dir__)].each do |endpoint|
|
24
|
+
Dir[File.expand_path('../api/endpoints/*.rb', __dir__)].sort.each do |endpoint|
|
25
25
|
require endpoint
|
26
26
|
end
|
@@ -6,8 +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
|
-
|
10
|
-
Dir[grape_starter_gem + '/lib/starter/rspec/**/*.rb'].each { |f| require f }
|
9
|
+
Dir["#{grape_starter_gem}/lib/starter/rspec/**/*.rb"].sort.each { |f| require f }
|
11
10
|
|
12
11
|
RSpec.configure do |config|
|
13
12
|
include Rack::Test::Methods
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: grape-starter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- LeFnord
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-09-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gli
|
@@ -16,56 +16,56 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '2.
|
19
|
+
version: '2.19'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '2.
|
26
|
+
version: '2.19'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: activesupport
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '6.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: '
|
40
|
+
version: '6.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rubocop
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '0.
|
47
|
+
version: '0.89'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '0.
|
54
|
+
version: '0.89'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: awesome_print
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '1.
|
61
|
+
version: '1.8'
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '1.
|
68
|
+
version: '1.8'
|
69
69
|
description: CLI to create a API skeleton based on Grape and Rack
|
70
70
|
email:
|
71
71
|
- pscholz.le@gmail.com
|
@@ -74,6 +74,8 @@ executables:
|
|
74
74
|
extensions: []
|
75
75
|
extra_rdoc_files: []
|
76
76
|
files:
|
77
|
+
- ".github/dependabot.yml"
|
78
|
+
- ".github/workflows/ruby.yml"
|
77
79
|
- ".gitignore"
|
78
80
|
- ".inch.yml"
|
79
81
|
- ".rspec"
|
@@ -104,7 +106,6 @@ files:
|
|
104
106
|
- lib/starter/version.rb
|
105
107
|
- template/.gitignore
|
106
108
|
- template/.rubocop.yml
|
107
|
-
- template/.rubocop_todo.yml
|
108
109
|
- template/Dockerfile
|
109
110
|
- template/Gemfile
|
110
111
|
- template/LICENSE
|
@@ -136,7 +137,7 @@ homepage: https://github.com/LeFnord/grape-starter
|
|
136
137
|
licenses:
|
137
138
|
- MIT
|
138
139
|
metadata: {}
|
139
|
-
post_install_message:
|
140
|
+
post_install_message:
|
140
141
|
rdoc_options: []
|
141
142
|
require_paths:
|
142
143
|
- lib
|
@@ -151,8 +152,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
151
152
|
- !ruby/object:Gem::Version
|
152
153
|
version: '0'
|
153
154
|
requirements: []
|
154
|
-
rubygems_version: 3.
|
155
|
-
signing_key:
|
155
|
+
rubygems_version: 3.1.4
|
156
|
+
signing_key:
|
156
157
|
specification_version: 4
|
157
158
|
summary: Creates a Grape Rack skeleton
|
158
159
|
test_files: []
|
data/template/.rubocop_todo.yml
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
# This configuration was generated by
|
2
|
-
# `rubocop --auto-gen-config`
|
3
|
-
# on 2016-10-18 20:40:59 +0200 using RuboCop version 0.44.1.
|
4
|
-
# The point is for the user to remove these configuration records
|
5
|
-
# one by one as the offenses are removed from the code base.
|
6
|
-
# Note that changes in the inspected code, or installation of new
|
7
|
-
# versions of RuboCop, may require this file to be generated again.
|
8
|
-
|
9
|
-
# Offense count: 1
|
10
|
-
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes.
|
11
|
-
# URISchemes: http, https
|
12
|
-
|
13
|
-
# Offense count: 6
|
14
|
-
Style/Documentation:
|
15
|
-
Exclude:
|
16
|
-
- 'spec/**/*'
|
17
|
-
- 'api/**/*'
|
18
|
-
- 'lib/**/*'
|