grape-starter 0.5.2 → 0.5.3

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
  SHA1:
3
- metadata.gz: f0924fa2656e0afe0edf8a5f44a0d071d100f1e2
4
- data.tar.gz: 4851ccfce72492e85ce55d9f52e991455ca8eb68
3
+ metadata.gz: c9a107b2658802ec45e956daba099eaf30ddb37c
4
+ data.tar.gz: c40cf86001873ac609536d7abbe6c65af5a119d4
5
5
  SHA512:
6
- metadata.gz: df09d9ada09636a3d5a54d2ff3532adf842776f0fce191e069d307d4ce2bd14576a47e405b96a119fa2015aa89e1f810d46067a90297a496ab64e8097f1397a7
7
- data.tar.gz: 5abba6c6cd9fa615bd79d37a8361b1c9e65a179a640207e0c69cdd4f51fff1abe2a225a1d36701934bb8a2c6eb0d1957234f0b57d45f0aa0b5e5c0b1e821ab97
6
+ metadata.gz: 38fe1d590985b01caea0ed5dc3a33a786b257ed1fe6707f3ab2d6b288decee3f79d6c80a49647fd0a2e657d87bb508e0ef3f4a93ba76c01b92a050d91929786a
7
+ data.tar.gz: c0190b8d0f884a3e841079ba642763dc4ff2e411a3ce0b9a9789e677d4a02801450773a8d9c407ef811796a8b3930fcc8581bab36c2c4ec85ccc0ba7ea9bf330
data/.gitignore CHANGED
@@ -11,3 +11,6 @@ tmp/
11
11
  .rspec
12
12
  pkg/
13
13
  template/Gemfile.lock
14
+ grape-starter.md
15
+ .Ulysses-Group.plist
16
+ .Ulysses-favorites.plist
data/.travis.yml CHANGED
@@ -7,10 +7,11 @@ before_install:
7
7
  - gem install bundler
8
8
 
9
9
  rvm:
10
- - 2.4.0
11
- - 2.3.3
12
- - 2.2.6
10
+ - 2.4.1
11
+ - 2.3.4
12
+ - 2.2.7
13
13
  - ruby-head
14
+
14
15
  matrix:
15
16
  fast_finish: true
16
17
  allow_failures:
data/Gemfile CHANGED
@@ -1,11 +1,12 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  source 'http://rubygems.org'
3
4
 
4
5
  gemspec
5
6
 
6
7
  group :development, :test do
7
8
  gem 'awesome_print', require: false
8
- gem 'grape', '>= 0.18'
9
+ gem 'grape', '>= 0.19.1'
9
10
  gem 'pry', platforms: [:mri]
10
11
  gem 'pry-byebug', platforms: [:mri]
11
12
  gem 'rack-cors', require: false
data/Rakefile CHANGED
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'bundler/gem_tasks'
3
4
 
4
5
  require 'rake'
@@ -11,4 +12,4 @@ RSpec::Core::RakeTask.new(:spec)
11
12
  require 'rubocop/rake_task'
12
13
  RuboCop::RakeTask.new(:rubocop)
13
14
 
14
- task default: [:spec, :rubocop]
15
+ task default: %i[spec rubocop]
@@ -24,7 +24,7 @@ Gem::Specification.new do |spec|
24
24
 
25
25
  spec.required_ruby_version = '>= 2.2.6'
26
26
 
27
- spec.add_dependency 'gli', '>= 2.14'
28
- spec.add_dependency 'activesupport', '>= 5.0.0'
29
- spec.add_dependency 'rubocop', '>= 0.47.0'
27
+ spec.add_dependency 'gli', '~> 2.16'
28
+ spec.add_dependency 'activesupport', '~> 5.0'
29
+ spec.add_dependency 'rubocop', '~> 0.48'
30
30
  end
data/lib/starter.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'awesome_print'
3
4
 
4
5
  require 'starter/version'
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'active_support/core_ext/string'
3
4
 
4
5
  module Starter
@@ -139,7 +140,7 @@ module Starter
139
140
  #
140
141
  # provides a file list for the new resource
141
142
  def file_list
142
- standards = %w(api_file lib_file api_spec lib_spec)
143
+ standards = %w[api_file lib_file api_spec lib_spec]
143
144
 
144
145
  entity ? standards + ['entity_file'] : standards
145
146
  end
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module Starter
3
4
  module BaseFile
4
5
  # add it in api base
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module Starter
3
4
  class FileFoo
4
5
  class << self
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module Starter
3
4
  module Names
4
5
  def klass_name
@@ -1,27 +1,28 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module Starter
3
4
  module Template
4
5
  # defining the endpoints -> http methods of a resource
5
6
  module Endpoints
6
7
  def crud
7
- %i(
8
+ %i[
8
9
  post
9
10
  get_all
10
11
  get_specific
11
12
  put_specific
12
13
  patch_specific
13
14
  delete_specific
14
- )
15
+ ]
15
16
  end
16
17
 
17
18
  def singular_one
18
- %i(
19
+ %i[
19
20
  post
20
21
  get_one
21
22
  put_one
22
23
  patch_one
23
24
  delete_one
24
- )
25
+ ]
25
26
  end
26
27
 
27
28
  # available API/HTTP methods
@@ -47,7 +48,7 @@ module Starter
47
48
  end"
48
49
  end
49
50
 
50
- %w(get put patch delete).each do |verb|
51
+ %w[get put patch delete].each do |verb|
51
52
  define_method(:"#{verb}_one") do
52
53
  "
53
54
  desc '#{verb} #{resource.singularize}'
@@ -57,7 +58,7 @@ module Starter
57
58
  end
58
59
  end
59
60
 
60
- %w(get put patch delete).each do |verb|
61
+ %w[get put patch delete].each do |verb|
61
62
  define_method(:"#{verb}_specific") do
62
63
  "
63
64
  desc '#{verb} specific #{resource.singularize}'
@@ -80,25 +81,25 @@ module Starter
80
81
  "it_behaves_like 'GET all'"
81
82
  end
82
83
 
83
- %w(get delete).each do |verb|
84
+ %w[get delete].each do |verb|
84
85
  define_method(:"#{verb}_one_spec") do
85
86
  "it_behaves_like '#{verb.upcase} one'"
86
87
  end
87
88
  end
88
89
 
89
- %w(put patch).each do |verb|
90
+ %w[put patch].each do |verb|
90
91
  define_method(:"#{verb}_one_spec") do
91
92
  "it_behaves_like '#{verb.upcase} one', params: {}"
92
93
  end
93
94
  end
94
95
 
95
- %w(get delete).each do |verb|
96
+ %w[get delete].each do |verb|
96
97
  define_method(:"#{verb}_specific_spec") do
97
98
  "it_behaves_like '#{verb.upcase} specific', key: 1"
98
99
  end
99
100
  end
100
101
 
101
- %w(put patch).each do |verb|
102
+ %w[put patch].each do |verb|
102
103
  define_method(:"#{verb}_specific_spec") do
103
104
  "it_behaves_like '#{verb.upcase} specific', key: 1, params: {}"
104
105
  end
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'active_support/core_ext/string'
3
4
 
4
5
  module Starter
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'rake'
3
4
  require 'rake/tasklib'
4
5
  require 'rack/test'
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module Starter
3
- VERSION = '0.5.2'
4
+ VERSION = '0.5.3'
4
5
  end
data/template/Gemfile CHANGED
@@ -6,12 +6,11 @@ gem 'thin'
6
6
  gem 'rack'
7
7
  gem 'rack-cors'
8
8
 
9
- # TODO: revert to gem after mörge and release
9
+ # FIXME: lock to specific version before you are going into production
10
10
  gem 'grape', git: 'git@github.com:ruby-grape/grape.git'
11
- # gem 'grape', '~> 0.18'
12
- gem 'grape-entity', '>= 0.6.0'
13
- gem 'grape-swagger', '>= 0.25.0'
14
- gem 'grape-swagger-entity', '>= 0.1.5'
11
+ gem 'grape-entity', git: 'git@github.com:ruby-grape/grape-entity.git'
12
+ gem 'grape-swagger', git: 'git@github.com:ruby-grape/grape-swagger.git'
13
+ gem 'grape-swagger-entity', git: 'git@github.com:ruby-grape/grape-swagger-entity.git'
15
14
 
16
15
  group :development, :test do
17
16
  gem 'grape-starter'
@@ -9,7 +9,6 @@ require 'rack'
9
9
 
10
10
  # provides the documentation of the API
11
11
  class DocApp
12
- attr_reader :env
13
12
  def call(env)
14
13
  @env = env
15
14
  [200, { 'Content-Type' => 'text/html' }, [template]]
@@ -39,7 +38,7 @@ class DocApp
39
38
  end
40
39
  end
41
40
 
42
- # provides the routing between the API and the html documentation of it
41
+ # provides the routing between the API and the ReDoc documentation of it
43
42
  class App
44
43
  def initialize
45
44
  @apps = {}
@@ -0,0 +1 @@
1
+ … includes public available stuff
metadata CHANGED
@@ -1,57 +1,57 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grape-starter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - LeFnord
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-10 00:00:00.000000000 Z
11
+ date: 2017-04-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gli
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '2.14'
19
+ version: '2.16'
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.14'
26
+ version: '2.16'
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: 5.0.0
33
+ version: '5.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: 5.0.0
40
+ version: '5.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.0
47
+ version: '0.48'
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.47.0
54
+ version: '0.48'
55
55
  description: CLI to create a API skeleton based on Grape and Rack
56
56
  email:
57
57
  - pscholz.le@gmail.com
@@ -100,7 +100,7 @@ files:
100
100
  - template/config/environment.rb
101
101
  - template/lib/api.rb
102
102
  - template/lib/api/version.rb
103
- - template/public/redoc.html
103
+ - template/public/README
104
104
  - template/script/console
105
105
  - template/script/server
106
106
  - template/script/setup
@@ -131,7 +131,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
131
131
  version: '0'
132
132
  requirements: []
133
133
  rubyforge_project:
134
- rubygems_version: 2.6.8
134
+ rubygems_version: 2.6.11
135
135
  signing_key:
136
136
  specification_version: 4
137
137
  summary: Create a Grape Rack skeleton
@@ -1,22 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>ReDoc</title>
5
- <!-- needed for adaptive design -->
6
- <meta name="viewport" content="width=device-width, initial-scale=1">
7
-
8
- <!--
9
- ReDoc doesn't change outer page styles
10
- -->
11
- <style>
12
- body {
13
- margin: 0;
14
- padding: 0;
15
- }
16
- </style>
17
- </head>
18
- <body>
19
- <redoc spec-url='http://localhost:9292/api/v1/oapi.json'></redoc>
20
- <script src="https://rebilly.github.io/ReDoc/releases/latest/redoc.min.js"> </script>
21
- </body>
22
- </html>