moomerman-rambo 0.4.4 → 0.4.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/README +9 -0
  2. data/lib/rambo/env.rb +8 -7
  3. metadata +1 -1
data/README CHANGED
@@ -11,3 +11,12 @@ rake db:setup # check config.yml for your specific db settings
11
11
  rake server
12
12
 
13
13
  head over to http://localhost:4000/
14
+
15
+ Features:
16
+ = No Ruby object base class modifications
17
+ = Lightweight and fast
18
+ = Rack-based so works with most web servers (thin, mongrel, passenger)
19
+ = Ability to proxy request to n backend app servers [experimental]
20
+ = Request caching built in
21
+ = fast static file serving
22
+ = works with erb or haml templates (more to come)
data/lib/rambo/env.rb CHANGED
@@ -4,20 +4,20 @@ module Rambo
4
4
  # TODO: config reload
5
5
  @@config ||= YAML.load_file("config.yml") rescue nil || {}
6
6
 
7
- if dbconf = @@config['database']
7
+ if dbconf = @@config['datamapper']
8
8
  require 'dm-core'
9
9
  require 'dm-validations'
10
10
  require 'dm-timestamps'
11
11
  #DataMapper.setup(:default, 'mysql://localhost/moo_development')
12
- @connection ||= DataMapper.setup(
13
- :default,
14
- :adapter => dbconf['adapter'],
12
+ @@connection ||= DataMapper.setup(
13
+ :default,
14
+ :adapter => :mysql,
15
15
  :host => dbconf['host'],
16
16
  :database => dbconf['database'],
17
17
  :username => dbconf['username'],
18
18
  :password => dbconf['password']
19
19
  )
20
- #DataObjects::Mysql.logger = DataObjects::Logger.new(STDOUT, :debug)
20
+ @@dblogger ||= DataObjects::Mysql.logger = DataObjects::Logger.new(STDOUT, dbconf['logging']) if dbconf['logging']
21
21
  end
22
22
 
23
23
  Dir["controller/*.rb"].each { |x| funkyload x }
@@ -31,9 +31,10 @@ module Rambo
31
31
  # request/response cycle
32
32
  def funkyload(file)
33
33
  @@loadcache ||= {}
34
- if cache = @@loadcache[file]
34
+ if cache = @@loadcache[file]
35
+ return unless @@config['rambo']['reload_classes']
35
36
  if (mtime = File.mtime(file)) > cache
36
- #puts "reloading: #{file}"
37
+ puts "rambo: reloading: #{file}"
37
38
  load file
38
39
  @@loadcache[file] = mtime
39
40
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: moomerman-rambo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.4
4
+ version: 0.4.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Taylor