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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 747c619ec18a6e6eb2ba6694c0aff48fb53587c0
4
- data.tar.gz: 2477d8a7da9a1d98957a4a01f90efee73a8d7fcb
3
+ metadata.gz: 1cd0462a495c741750f1cffd0077eb4c789fd9ff
4
+ data.tar.gz: 9be361dc0bcf1106ae6ccebc4601f0d679804bca
5
5
  SHA512:
6
- metadata.gz: c4071e8d86b682d3c266ff66f3937a6f6fd3c42a606d16227e9655ddcd4d236f59d20523332c950c7b43eb69bd94c44a3ea4cb155a01ce426541f4bd63cab9c2
7
- data.tar.gz: 4b39859879a0c28892efe6804dd6809540f0b3aa820d4b91b2bf7a708b2d0b4677a6fbe75bf94dbc3c68e13bbe089698a86d55aea65f622d23e0ba7788e0d082
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 @@controller_routes
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 @@root_controller
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
@@ -1,3 +1,3 @@
1
1
  module Halfling
2
- VERSION = '0.0.5'
2
+ VERSION = '0.0.6'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: halfling
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Leo P.