grape-starter 0.4.1 → 0.4.2

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: d549f6e5ecd48d20c126a63de91a14ac9fb9262f
4
- data.tar.gz: 33174fb1dd003ee55acbe824a96c2a56588c4d55
3
+ metadata.gz: 567acba57f6b5bbef50e10c04ef3ed959d1d877b
4
+ data.tar.gz: 68dea7756db9323789392a89435adc899aab2c72
5
5
  SHA512:
6
- metadata.gz: c42c646d1248bd7d953049ddd80ae019ebe4df5220fddfd025e60c9910809009d2c8d7725472c53b7ac4307551c34ced33c5c3831002145587627887d4450c98
7
- data.tar.gz: 458945f18afcf926a97624405ec0591ec3adf5068776ad5746865bb85d827639a0a435980a7dfcac2125b1907fd98bbc42e4b883bdb93bfdf4b265a67882eb65
6
+ metadata.gz: 50e159bda1bd6411ca34f4ee63269fc6ae403e068e51b64926d29f50d5ba0badbc87d744d5fc1867ffd5fe46a894767d84523e3d6287f2a78a6de794dbbe26ba
7
+ data.tar.gz: 1065e7cc75744049be7df78c5a2ec275a3786596e37cf6486301bdc3d94b8ff1a4736650bf407f254afc87dabe3d67920b491ed2adcf866e0510b1bf81fbc028
data/.rubocop.yml CHANGED
@@ -5,6 +5,7 @@ AllCops:
5
5
  - '**/bin/**/*'
6
6
  - '**/tmp/**/*'
7
7
  - '**/script/**/*'
8
+ - '**/template/**/*'
8
9
  - grape-starter.gemspec
9
10
  UseCache: true
10
11
  TargetRubyVersion: 2.3
data/.travis.yml CHANGED
@@ -10,9 +10,5 @@ matrix:
10
10
  - rvm: 2.3.3
11
11
  - rvm: 2.2.6
12
12
  - rvm: ruby-head
13
- - rvm: jruby-9.1.6.0
14
- - rvm: jruby-head
15
13
  allow_failures:
16
14
  - rvm: ruby-head
17
- - rvm: jruby-9.1.6.0
18
- - rvm: jruby-head
data/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  ### NEXT
2
2
 
3
+ ### 0.4.2
4
+
5
+ - sets prefix after project name
6
+
7
+ ### 0.4.1
8
+
9
+ - refactores rack api mounting
10
+
11
+ ### 0.4.0
12
+
13
+ - adds ruby 2.4.0 support
14
+
15
+ ### 0.3.1
16
+
17
+ - server command supports port, thin tag would be named after project
18
+
3
19
  ### 0.3.0
4
20
 
5
21
  - adds redoc oapi documentation viewer
@@ -25,7 +25,10 @@ module Starter
25
25
 
26
26
  FileUtils.copy_entry source, destination
27
27
 
28
- replace_static(File.join('script', 'server'))
28
+ replace_static(File.join('script', 'server'), "API-#{resource}")
29
+ replace_static(File.join('api', 'base.rb'), ":#{resource}")
30
+
31
+ self
29
32
  end
30
33
 
31
34
  # would be called from add command
@@ -122,10 +125,10 @@ module Starter
122
125
  # will be called on project creation
123
126
  #
124
127
  # … static files such as under script folder,
125
- def replace_static(file)
128
+ def replace_static(file, replacement)
126
129
  server_file = File.join(destination, file)
127
130
 
128
- file_foo(server_file) { |content| content.gsub!('{{{grape-starter}}}', "API-#{resource}") }
131
+ file_foo(server_file) { |content| content.gsub!('{{{grape-starter}}}', replacement) }
129
132
  end
130
133
 
131
134
  # will be called an resource creation
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Starter
3
- VERSION = '0.4.1'
3
+ VERSION = '0.4.2'
4
4
  end
data/template/api/base.rb CHANGED
@@ -2,7 +2,8 @@
2
2
  module Api
3
3
  class Base < Grape::API
4
4
  # !!! a prefix is always required
5
- prefix :api
5
+ # would be set after project name, to provide a namespace
6
+ prefix {{{grape-starter}}}
6
7
  version 'v1', using: :path
7
8
  format :json
8
9
 
data/template/config.ru CHANGED
@@ -6,7 +6,7 @@ use Rack::CommonLogger
6
6
  use Rack::Cors do
7
7
  allow do
8
8
  origins '*'
9
- resource '*', headers: :any, methods: [:get, :post, :put, :delete, :options]
9
+ resource '*', headers: :any, methods: [:get, :post, :put, :patch, :delete, :options]
10
10
  end
11
11
  end
12
12
 
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: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - LeFnord
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-27 00:00:00.000000000 Z
11
+ date: 2016-12-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gli