sinatraband 0.2.3 → 0.2.4
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/lib/templates/Gemfile.erb +1 -0
- data/lib/templates/app.erb +3 -8
- data/lib/templates/config/config.erb +27 -10
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 77ccc539d59df68401aefbd8aafa95067d88e8bc
|
4
|
+
data.tar.gz: 871c300229980da584a6f5f4fa3f07286c132fdc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9cae1ebf3628cc32e1e7db25f3957b4a8a56dea7dc088cb9b091665002399a704b99bd22e4e30675fe1b7f50e5ae320e3014f4eea9109b66ad11a24c7c53053e
|
7
|
+
data.tar.gz: ffa8feda9aa49dcfbf6df40a485fd721de59a1bfb37fb4ca41f021cb9c9ab38a1a8da65aaab9eaaf03bc8aa6ef0c307c1cd8414e383ac5ab891d7de82a0f21cd
|
data/lib/templates/Gemfile.erb
CHANGED
data/lib/templates/app.erb
CHANGED
@@ -2,15 +2,10 @@ require 'sinatra'
|
|
2
2
|
require 'sinatra/activerecord'
|
3
3
|
# require 'active_support/core_ext'
|
4
4
|
# require 'sinatra/flash'
|
5
|
+
# require 'i18n'
|
5
6
|
|
6
|
-
# Loads
|
7
|
-
|
8
|
-
|
9
|
-
# Loads all models in models directory
|
10
|
-
Dir["./models/*.rb"].each {|file| require_relative file }
|
11
|
-
|
12
|
-
# Loads all controllers in controllers directory
|
13
|
-
Dir["./controllers/*.rb"].each {|file| require_relative file }
|
7
|
+
# Loads application configuration
|
8
|
+
require './config/config.rb'
|
14
9
|
|
15
10
|
# Default root_route
|
16
11
|
get '/' do
|
@@ -1,6 +1,11 @@
|
|
1
1
|
# Adds gzip compression to requests
|
2
2
|
use Rack::Deflater
|
3
3
|
|
4
|
+
# I18n Internationalization
|
5
|
+
# I18n.enforce_available_locales = false
|
6
|
+
# I18n.load_path += Dir[File.join(File.dirname(__FILE__), 'locales', '*.yml').to_s]
|
7
|
+
# I18n.default_locale = :pt
|
8
|
+
|
4
9
|
# Register Flash Sinatra messages
|
5
10
|
# register Sinatra::Flash
|
6
11
|
|
@@ -18,19 +23,31 @@ set :database, "mysql2://root:@localhost/<%= @name %>"
|
|
18
23
|
# configure :production do
|
19
24
|
# db = URI.parse(ENV['DATABASE_URL'] || 'postgres:///localhost/<%= @name %>')
|
20
25
|
|
21
|
-
#
|
22
|
-
#
|
23
|
-
#
|
24
|
-
#
|
25
|
-
#
|
26
|
-
#
|
27
|
-
#
|
28
|
-
#
|
26
|
+
# ActiveRecord::Base.establish_connection(
|
27
|
+
# adapter: db.scheme == 'postgres' ? 'postgresql' : db.scheme,
|
28
|
+
# host: db.host,
|
29
|
+
# username: db.user,
|
30
|
+
# password: db.password,
|
31
|
+
# database: db.path[1..-1],
|
32
|
+
# encoding: 'utf8'
|
33
|
+
# )
|
29
34
|
# end
|
30
35
|
|
31
|
-
#
|
36
|
+
# Application helpers
|
32
37
|
# helpers do
|
38
|
+
# # html escape method
|
33
39
|
# def h(text)
|
34
40
|
# Rack::Utils.escape_html(text)
|
35
41
|
# end
|
36
|
-
|
42
|
+
|
43
|
+
# # I18n translate method
|
44
|
+
# def t(*args)
|
45
|
+
# I18n.t(*args)
|
46
|
+
# end
|
47
|
+
# end
|
48
|
+
|
49
|
+
# Loads all models in models directory
|
50
|
+
Dir["./models/*.rb"].each {|file| require file }
|
51
|
+
|
52
|
+
# Loads all controllers in controllers directory
|
53
|
+
Dir["./controllers/*.rb"].each {|file| require file }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sinatraband
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Julio Bueno
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-03-
|
11
|
+
date: 2014-03-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|