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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 860b59723bc6fce5d5556ed3976f95df281af964
4
- data.tar.gz: b8279af5abd2aafe17c5b7671d1a17bea0f78635
3
+ metadata.gz: ee23e6d0369a54c958d548bf8c69497884303002
4
+ data.tar.gz: 0e03622da8c384f10d581b119f614915acc62cee
5
5
  SHA512:
6
- metadata.gz: df8b384b25f49cade5699da4abb9432fd62d8c10ec7f6f2d2f5d3c8e2a83a47bd26347fdece865e8593d7d6af1d7560f035614959d9ae50563056ae2da2ea151
7
- data.tar.gz: 178fa0785054c9f559cc2d7c08d4284c461f8a1a8ec651cc4453220b018a2fee07f456dd79b5c678bd5a927f921385d0a63c85c6a446e3ffed3d8a2c98f15fdb
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
- sinatra app_name
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
@@ -1,3 +1,3 @@
1
1
  module SinatraCmd
2
- VERSION = '0.0.12'
2
+ VERSION = '0.0.13'
3
3
  end
data/templates/Gemfile CHANGED
@@ -1,18 +1,20 @@
1
1
  source "https://rubygems.org"
2
2
 
3
- gem 'sinatra', '~> 1.4.6'
4
- gem 'sinatra-contrib', '~> 1.4.2', require: false
5
- gem 'sinatra-r18n', '~> 2.0.3'
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', '~> 0.10.1'
9
- gem 'pry-stack_explorer', '~> 0.4.9.2'
10
- gem 'pry-byebug', '~> 3.1.0'
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', '~> 3.2.0'
15
- gem 'ci_reporter_rspec', '~> 1.0.0'
16
- gem 'simplecov', '~> 0.9.2', :require => false
17
- gem 'simplecov-rcov', '~> 0.2.3', :require => false
16
+ gem 'rspec'
17
+ gem 'ci_reporter_rspec'
18
+ gem 'simplecov', :require => false
19
+ gem 'simplecov-rcov', :require => false
18
20
  end
@@ -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
@@ -8,7 +8,7 @@ require 'sinatra/reloader' if development?
8
8
  require 'sinatra/namespace'
9
9
  require 'sinatra/json'
10
10
 
11
- module <%= app_name.capitalize %>
11
+ module <%= app_name.split(/\-|\_/).map(&:capitalize).join('') %>
12
12
  API_VERSION = '1'
13
13
 
14
14
  class App < Sinatra::Base
@@ -1,3 +1,3 @@
1
1
  require ::File.expand_path('../config/environment', __FILE__)
2
2
 
3
- run <%= app_name.capitalize %>::App
3
+ run <%= app_name.split(/\-|\_/).map(&:capitalize).join('') %>::App
@@ -1,6 +1,6 @@
1
1
  require 'fileutils'
2
2
 
3
- module <%= app_name.capitalize %>
3
+ module <%= app_name.split(/\-|\_/).map(&:capitalize).join('') %>
4
4
  module ApplicationHelper
5
5
  def logger
6
6
  return @logger unless @logger.nil?
@@ -1,4 +1,4 @@
1
- module <%= app_name.capitalize %>
1
+ module <%= app_name.split(/\-|\_/).map(&:capitalize).join('') %>
2
2
  module ErrorHandling
3
3
  module Helpers
4
4
  def halt_with_400(message=nil)
@@ -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.'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sinatra-cmd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.12
4
+ version: 0.0.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - CBluowei