sinatra-cmd 0.0.9 → 0.0.10

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: e2aea6399c56e334298a82eec51fc6795b47586a
4
- data.tar.gz: 29286d737994f05496378e0bed60d941fcfb4300
3
+ metadata.gz: c231852d46c97028e6f7bf026e5b4c99319d5a62
4
+ data.tar.gz: 1666085b4120ff9499744fe7b356c4e1f8d87b92
5
5
  SHA512:
6
- metadata.gz: c0ea7c435bc469513a5f481d11d3777c6b39d89f358d601edfeb7a75e3f3800d8f8891c79d5c193e4d7606569db118dc855789bd0d7b888cdb11bfcf32282532
7
- data.tar.gz: 5581cbe78165aeceef92a4d2aa1c1c92f2e19b5d02681fb4ab0875c47e9c5b8c173ca026075f9c5ccc9132ac996c16b0e4f712a2d85db531b89fb1679edd3631
6
+ metadata.gz: 9dce49b03030877ead66aa770d729afa07e436721c34ccb7bd549e95d370ef91b6d1ebb60d6228cf9650dd4e8ffca51a36a4faf2e200e36a79722723808de309
7
+ data.tar.gz: da302fe1b2a431745a050997fe96c65015ff26bb66d6b1a0be3b081b39e843eac9d1851592ec9b9113dde3a4723bf4aa419ad7dccad9e02d254c09d4c09b5a47
@@ -10,23 +10,23 @@ module SinatraCmd
10
10
  File.join(File.dirname(__FILE__), "../../", "templates")
11
11
  end
12
12
 
13
- def setup_helpers
14
- keep_file "#{app_name}/helpers"
15
- template "helpers/application.rb.erb", "#{app_name}/helpers/application.rb"
16
- template "helpers/error_handling.rb.erb", "#{app_name}/helpers/error_handling.rb"
13
+ def setup_utils
14
+ keep_file "#{app_name}/app/utils"
17
15
  end
18
16
 
19
- def setup_models
20
- keep_file "#{app_name}/models"
17
+ def setup_helpers
18
+ keep_file "#{app_name}/app/helpers"
19
+ template "app/helpers/application.rb.erb", "#{app_name}/app/helpers/application.rb"
20
+ template "app/helpers/error_handling.rb.erb", "#{app_name}/app/helpers/error_handling.rb"
21
21
  end
22
22
 
23
- def setup_utils
24
- keep_file "#{app_name}/utils"
23
+ def setup_models
24
+ keep_file "#{app_name}/app/models"
25
25
  end
26
26
 
27
27
  def setup_routes
28
- keep_file "#{app_name}/routes"
29
- template "routes/demo.rb.erb", "#{app_name}/routes/demo.rb"
28
+ keep_file "#{app_name}/app/routes"
29
+ template "app/routes/demo.rb.erb", "#{app_name}/app/routes/demo.rb"
30
30
  end
31
31
 
32
32
  def setup_config
@@ -1,3 +1,3 @@
1
1
  module SinatraCmd
2
- VERSION = '0.0.9'
2
+ VERSION = '0.0.10'
3
3
  end
File without changes
@@ -2,9 +2,9 @@
2
2
 
3
3
  require File.expand_path('../boot', __FILE__)
4
4
 
5
- Dir[File.expand_path('../../helpers/*.rb', __FILE__)].each { |f| require f }
6
- Dir[File.expand_path('../../models/*.rb', __FILE__)].each { |f| require f }
7
- Dir[File.expand_path('../../routes/*.rb', __FILE__)].each { |f| require f }
5
+ %w(utils helpers models routes).each do |folder|
6
+ Dir[File.expand_path("../../app/#{folder}/**/*.rb", __FILE__)].each {|file| require file}
7
+ end
8
8
 
9
9
  require File.expand_path('../scheduler', __FILE__)
10
10
 
@@ -17,9 +17,11 @@ end
17
17
  module <%= app_name.capitalize %>
18
18
  API_V1 = '/1'
19
19
 
20
- class App < Sinatra::Application
20
+ class App < Sinatra::Base
21
21
  register Sinatra::Namespace
22
22
  helpers Sinatra::JSON
23
+ # language automatic changed by params['locale']
24
+ register Sinatra::R18n
23
25
 
24
26
  configure do
25
27
  # Mongoid config file load
@@ -4,6 +4,5 @@ error_handling:
4
4
  forbidden: "Forbidden"
5
5
  not_found: "Not found"
6
6
  internal_server_error: "Internal server error"
7
-
8
7
  multi_json:
9
8
  decode: "Problems parsing JSON"
@@ -4,6 +4,5 @@ error_handling:
4
4
  forbidden: "Forbidden"
5
5
  not_found: "Not found"
6
6
  internal_server_error: "Internal server error"
7
-
8
7
  multi_json:
9
8
  decode: "Problems parsing JSON"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sinatra-cmd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - CBluowei
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-15 00:00:00.000000000 Z
11
+ date: 2015-04-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -76,6 +76,9 @@ files:
76
76
  - templates/Gemfile
77
77
  - templates/README.md.erb
78
78
  - templates/Rakefile
79
+ - templates/app/helpers/application.rb.erb
80
+ - templates/app/helpers/error_handling.rb.erb
81
+ - templates/app/routes/demo.rb.erb
79
82
  - templates/config.ru.erb
80
83
  - templates/config/application.rb.erb
81
84
  - templates/config/boot.rb.erb
@@ -84,9 +87,6 @@ files:
84
87
  - templates/config/i18n/en-us.yml
85
88
  - templates/config/i18n/zh-cn.yml
86
89
  - templates/config/scheduler.rb
87
- - templates/helpers/application.rb.erb
88
- - templates/helpers/error_handling.rb.erb
89
- - templates/routes/demo.rb.erb
90
90
  - templates/spec/spec_helper.rb
91
91
  homepage: https://github.com/hilotus/sinatra-cli
92
92
  licenses: