halfling 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/halfling/base.rb +3 -8
- data/lib/halfling/version.rb +1 -1
- 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: 1cd0462a495c741750f1cffd0077eb4c789fd9ff
|
4
|
+
data.tar.gz: 9be361dc0bcf1106ae6ccebc4601f0d679804bca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 775cdda1defcda56dcd6d82b7bc2d6577372149f3e4148c0b4f6c1180f95da092624eac5e92797ee0a47f6fa4fd240c14bd81fe077f7b241d885f6b78f8acad3
|
7
|
+
data.tar.gz: 4053b59dcc16e9a6b1f1a82614dfc683b5655bc44984a43ce4eac7fd46ca54028d6af395aad5848462392a59b4b1c2cd3862230e15669edd2b554a1577c06db7
|
data/lib/halfling/base.rb
CHANGED
@@ -16,13 +16,12 @@ module Hobbit
|
|
16
16
|
CONTROLLERS_PATH='app/controllers/**/*.rb'
|
17
17
|
|
18
18
|
def inherited(sub)
|
19
|
-
puts "inherited #{sub}, #{sub.superclass}, #{Base}"
|
20
|
-
|
21
19
|
if sub.superclass == Base
|
22
20
|
#config stuff
|
23
21
|
if File.exists?('config/env.yml')
|
24
22
|
all_conf=YAML.load_file 'config/env.yml'
|
25
23
|
conf=all_conf[ENV['RACK_ENV']]
|
24
|
+
@@templates={}
|
26
25
|
@@config=conf
|
27
26
|
@@application=sub
|
28
27
|
use Rack::Config do |env|
|
@@ -34,8 +33,6 @@ module Hobbit
|
|
34
33
|
|
35
34
|
class << sub
|
36
35
|
def inherited(sub)
|
37
|
-
puts "#{self} REALLY inherited from #{sub}"
|
38
|
-
|
39
36
|
name=sub.name.match(".*?::(.*)Controller")[1].downcase!
|
40
37
|
if name == "root"
|
41
38
|
@@root_controller = sub
|
@@ -99,17 +96,15 @@ module Hobbit
|
|
99
96
|
end
|
100
97
|
|
101
98
|
def initialize
|
102
|
-
if
|
99
|
+
if self.class.class_variable_defined? :@@controller_routes
|
103
100
|
@@controller_routes.each do |route, controller|
|
104
|
-
puts "map #{route} to #{controller.name}"
|
105
101
|
@@application.map(route) do
|
106
102
|
run controller.new
|
107
103
|
end
|
108
104
|
end
|
109
105
|
@@controller_routes = nil
|
110
106
|
end
|
111
|
-
if
|
112
|
-
puts "map root / to #{@@root_controller.name}"
|
107
|
+
if self.class.class_variable_defined? :@@root_controller
|
113
108
|
root_controller = @@root_controller
|
114
109
|
@@application.map("/") do
|
115
110
|
run root_controller.new
|
data/lib/halfling/version.rb
CHANGED