moomerman-rambo 0.4.3 → 0.4.4
Sign up to get free protection for your applications and to get access to all the features.
- data/README +1 -1
- data/lib/rambo/env.rb +19 -15
- metadata +1 -1
data/README
CHANGED
@@ -7,7 +7,7 @@ To run the example:
|
|
7
7
|
|
8
8
|
git clone git://github.com/moomerman/rambo.git
|
9
9
|
cd rambo/example/blog/
|
10
|
-
rake db:setup #
|
10
|
+
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/
|
data/lib/rambo/env.rb
CHANGED
@@ -1,21 +1,25 @@
|
|
1
1
|
module Rambo
|
2
2
|
class Env
|
3
3
|
def initialize
|
4
|
-
#
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
:
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
4
|
+
# TODO: config reload
|
5
|
+
@@config ||= YAML.load_file("config.yml") rescue nil || {}
|
6
|
+
|
7
|
+
if dbconf = @@config['database']
|
8
|
+
require 'dm-core'
|
9
|
+
require 'dm-validations'
|
10
|
+
require 'dm-timestamps'
|
11
|
+
#DataMapper.setup(:default, 'mysql://localhost/moo_development')
|
12
|
+
@connection ||= DataMapper.setup(
|
13
|
+
:default,
|
14
|
+
:adapter => dbconf['adapter'],
|
15
|
+
:host => dbconf['host'],
|
16
|
+
:database => dbconf['database'],
|
17
|
+
:username => dbconf['username'],
|
18
|
+
:password => dbconf['password']
|
19
|
+
)
|
20
|
+
#DataObjects::Mysql.logger = DataObjects::Logger.new(STDOUT, :debug)
|
21
|
+
end
|
22
|
+
|
19
23
|
Dir["controller/*.rb"].each { |x| funkyload x }
|
20
24
|
Dir["model/*.rb"].each { |x| funkyload x }
|
21
25
|
Dir["lib/*.rb"].each { |x| funkyload x }
|