sinatra-cmd 0.0.12 → 0.0.13
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 +4 -4
- data/README.md +10 -3
- data/lib/sinatra_cmd/version.rb +1 -1
- data/templates/Gemfile +12 -10
- data/templates/README.md.erb +1 -1
- data/templates/config/application.rb.erb +1 -1
- data/templates/config/boot.rb.erb +1 -1
- data/templates/config.ru.erb +1 -1
- data/templates/helpers/application.rb.erb +1 -1
- data/templates/helpers/error_handling.rb.erb +1 -1
- data/templates/routes/demo.rb.erb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ee23e6d0369a54c958d548bf8c69497884303002
|
4
|
+
data.tar.gz: 0e03622da8c384f10d581b119f614915acc62cee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 956439ae61b1e9cc6ee8b087fdb68c8b91fab7e7f92c599d775f2251001e8da5f584c9648f94cccd9f66abf65b4900e2a7cca97a3897b8a602c5906c628d35d4
|
7
|
+
data.tar.gz: 5d71b93001342962f597f10c814ac9070906466dcdc955b7c82acfac437a005989456b359ffe9136efcac9cab6fba8102728a4b475ca77eed4a549c107559061
|
data/README.md
CHANGED
@@ -18,11 +18,18 @@ Or install it yourself as:
|
|
18
18
|
|
19
19
|
## Usage
|
20
20
|
|
21
|
-
|
21
|
+
```ruby
|
22
|
+
# app_name format could be:
|
23
|
+
# 1. aaa_bbb_ccc
|
24
|
+
# 2. aaa-bbb-ccc
|
25
|
+
# 3. aaa
|
26
|
+
|
27
|
+
sinatra {app_name}
|
28
|
+
```
|
22
29
|
|
23
|
-
##How to use pry
|
30
|
+
##How to use pry (option, latest version is unnecessary)
|
24
31
|
|
25
|
-
create .pryrc file in `/Users/username` folder.
|
32
|
+
create .pryrc file in `/Users/username` or `/home/username` folder.
|
26
33
|
|
27
34
|
```shell
|
28
35
|
#!/usr/bin/ruby
|
data/lib/sinatra_cmd/version.rb
CHANGED
data/templates/Gemfile
CHANGED
@@ -1,18 +1,20 @@
|
|
1
1
|
source "https://rubygems.org"
|
2
2
|
|
3
|
-
gem '
|
4
|
-
|
5
|
-
gem 'sinatra
|
3
|
+
gem 'thin'
|
4
|
+
|
5
|
+
gem 'sinatra'
|
6
|
+
gem 'sinatra-contrib', require: false
|
7
|
+
gem 'sinatra-r18n'
|
6
8
|
|
7
9
|
group :test, :development do
|
8
|
-
gem 'pry'
|
9
|
-
gem 'pry-stack_explorer'
|
10
|
-
gem 'pry-byebug'
|
10
|
+
gem 'pry'
|
11
|
+
gem 'pry-stack_explorer'
|
12
|
+
gem 'pry-byebug'
|
11
13
|
end
|
12
14
|
|
13
15
|
group :test do
|
14
|
-
gem 'rspec'
|
15
|
-
gem 'ci_reporter_rspec'
|
16
|
-
gem 'simplecov',
|
17
|
-
gem 'simplecov-rcov',
|
16
|
+
gem 'rspec'
|
17
|
+
gem 'ci_reporter_rspec'
|
18
|
+
gem 'simplecov', :require => false
|
19
|
+
gem 'simplecov-rcov', :require => false
|
18
20
|
end
|
data/templates/README.md.erb
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
<%= app_name.capitalize %>
|
1
|
+
<%= app_name.split(/\-|\_/).map(&:capitalize).join('') %>
|
2
2
|
====================
|
@@ -6,7 +6,7 @@ require File.expand_path('../boot', __FILE__)
|
|
6
6
|
Dir[File.expand_path("../../#{folder}/**/*.rb", __FILE__)].each {|file| require file}
|
7
7
|
end
|
8
8
|
|
9
|
-
module <%= app_name.capitalize %>
|
9
|
+
module <%= app_name.split(/\-|\_/).map(&:capitalize).join('') %>
|
10
10
|
class App
|
11
11
|
# custome register
|
12
12
|
register ErrorHandling
|
data/templates/config.ru.erb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
|
-
module <%= app_name.capitalize %>
|
3
|
+
module <%= app_name.split(/\-|\_/).map(&:capitalize).join('') %>
|
4
4
|
class App
|
5
|
-
namespace "/#{<%= app_name.capitalize %>::API_VERSION}" do
|
5
|
+
namespace "/#{<%= app_name.split(/\-|\_/).map(&:capitalize).join('') %>::API_VERSION}" do
|
6
6
|
get '/demo' do
|
7
7
|
unless params[:error].nil?
|
8
8
|
raise 'There are some errors.'
|