openhood-sinatra_app_gen 0.1.3 → 0.1.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.
data/VERSION.yml
CHANGED
@@ -17,10 +17,6 @@ require "lib/rack_fix" # until rack escape UTF-8 as expected
|
|
17
17
|
module <%= name %>
|
18
18
|
class App < Sinatra::Base
|
19
19
|
|
20
|
-
def self.base_path
|
21
|
-
File.dirname(__FILE__)
|
22
|
-
end
|
23
|
-
|
24
20
|
# load environment config
|
25
21
|
def self.config
|
26
22
|
@@config ||= begin
|
@@ -29,21 +25,22 @@ module <%= name %>
|
|
29
25
|
end
|
30
26
|
end
|
31
27
|
|
32
|
-
configure do
|
28
|
+
configure do
|
29
|
+
set :root, File.dirname(__FILE__)
|
33
30
|
set :static, true
|
34
|
-
set :public, File.join(
|
35
|
-
set :views, File.join(
|
31
|
+
set :public, File.join(root, "public")
|
32
|
+
set :views, File.join(root, "views")
|
36
33
|
enable :logging
|
37
34
|
enable :sessions
|
38
35
|
|
39
36
|
# setup logger and connect to db
|
40
|
-
FileUtils.mkdir_p File.join(
|
41
|
-
logger = Logger.new(File.join(
|
37
|
+
FileUtils.mkdir_p File.join(root, "log")
|
38
|
+
logger = Logger.new(File.join(root, "log", "#{environment}.log"))
|
42
39
|
logger.level = production? ? Logger::ERROR : Logger::DEBUG
|
43
40
|
Sequel.connect(config[:db][:uri], :loggers => [logger])
|
44
41
|
|
45
42
|
# load models
|
46
|
-
Dir.glob(File.join(
|
43
|
+
Dir.glob(File.join(root, "models", "*.rb")).each do |m|
|
47
44
|
require m
|
48
45
|
end
|
49
46
|
|
@@ -53,7 +50,7 @@ module <%= name %>
|
|
53
50
|
def config
|
54
51
|
<%= name %>::App.config
|
55
52
|
end
|
56
|
-
Dir.glob(File.join(
|
53
|
+
Dir.glob(File.join(root, "helpers", "*.rb")).each do |h|
|
57
54
|
require h
|
58
55
|
module_name = "#{File.basename(h, ".rb").camelize}Helper"
|
59
56
|
include <%= name %>.const_get(module_name) if <%= name %>.const_defined?(module_name)
|
@@ -65,7 +62,7 @@ module <%= name %>
|
|
65
62
|
end
|
66
63
|
|
67
64
|
# load fake controllers
|
68
|
-
Dir.glob(File.join(
|
65
|
+
Dir.glob(File.join(root, "controllers", "*.rb")).each do |c|
|
69
66
|
require c
|
70
67
|
end
|
71
68
|
|
@@ -45,7 +45,7 @@ Before do
|
|
45
45
|
Sequel::Model.db.tables.each do |table_name|
|
46
46
|
Sequel::Model.db.drop_table table_name
|
47
47
|
end
|
48
|
-
dirname = File.join(
|
48
|
+
dirname = File.join(<%= name %>::App.root, "..", "..", "migrations")
|
49
49
|
Sequel::Migrator.apply(Sequel::Model.db, dirname) if File.directory?(dirname)
|
50
50
|
end
|
51
51
|
|
@@ -23,7 +23,7 @@ Spec::Runner.configure do |config|
|
|
23
23
|
Sequel::Model.db.tables.each do |table_name|
|
24
24
|
Sequel::Model.db.drop_table table_name
|
25
25
|
end
|
26
|
-
dirname = File.join(
|
26
|
+
dirname = File.join(<%= name %>::App.root, "..", "migrations")
|
27
27
|
Sequel::Migrator.apply(Sequel::Model.db, dirname) if File.directory?(dirname)
|
28
28
|
end
|
29
29
|
|
data/sinatra_app_gen.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{sinatra_app_gen}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.4"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Jonathan Tron", "Joseph Halter"]
|
12
|
-
s.date = %q{2009-08-
|
12
|
+
s.date = %q{2009-08-29}
|
13
13
|
s.default_executable = %q{sinatra_app}
|
14
14
|
s.description = %q{Our default app template}
|
15
15
|
s.email = %q{team@openhood.com}
|
@@ -35,12 +35,12 @@ Gem::Specification.new do |s|
|
|
35
35
|
s.homepage = %q{http://github.com/openhood/sinatra_app_gen}
|
36
36
|
s.rdoc_options = ["--charset=UTF-8"]
|
37
37
|
s.require_paths = ["lib"]
|
38
|
-
s.rubygems_version = %q{1.3.
|
38
|
+
s.rubygems_version = %q{1.3.1}
|
39
39
|
s.summary = %q{Creates a new Sinatra / Sequel / rspec / cucumber app.}
|
40
40
|
|
41
41
|
if s.respond_to? :specification_version then
|
42
42
|
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
43
|
-
s.specification_version =
|
43
|
+
s.specification_version = 2
|
44
44
|
|
45
45
|
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
46
46
|
s.add_runtime_dependency(%q<rspec>, ["~> 1.2.6"])
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: openhood-sinatra_app_gen
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonathan Tron
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2009-08-
|
13
|
+
date: 2009-08-29 00:00:00 -07:00
|
14
14
|
default_executable: sinatra_app
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
@@ -69,6 +69,7 @@ files:
|
|
69
69
|
- sinatra_app_gen.gemspec
|
70
70
|
has_rdoc: true
|
71
71
|
homepage: http://github.com/openhood/sinatra_app_gen
|
72
|
+
licenses:
|
72
73
|
post_install_message:
|
73
74
|
rdoc_options:
|
74
75
|
- --charset=UTF-8
|
@@ -89,9 +90,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
89
90
|
requirements: []
|
90
91
|
|
91
92
|
rubyforge_project:
|
92
|
-
rubygems_version: 1.
|
93
|
+
rubygems_version: 1.3.5
|
93
94
|
signing_key:
|
94
|
-
specification_version:
|
95
|
+
specification_version: 2
|
95
96
|
summary: Creates a new Sinatra / Sequel / rspec / cucumber app.
|
96
97
|
test_files: []
|
97
98
|
|