frecon 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/frecon +2 -2
- data/lib/frecon/base/variables.rb +1 -1
- data/lib/frecon/database.rb +13 -2
- 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: 0c2b4116037363c5580518c012f3f9f539928742
|
4
|
+
data.tar.gz: 25724f6f99f6a82ff6d559c77e4ef35e079091ff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 46530c063a1616ea0e691a5fcf85c2bad581ca936a7bdee6ce5180084574b6387141fea2e5fc9106b43d82e1295464da897f65dfc37371e3ec182ac9b99d7fce
|
7
|
+
data.tar.gz: 843fba889e81bf13534267dc43d929a919f891ca5d7dcaa6705b0c802456edef05c6378bfa021fae0ceba9eb27a16aba6fde10545846a4a0bdfdb809abe9b814
|
data/bin/frecon
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
1
3
|
# bin/frecon
|
2
4
|
#
|
3
5
|
# Copyright (C) 2014 Christopher Cooper, Sam Craig, Tiger Huang, Vincent Mai, Sam Mercier, and Kristofer Rye
|
@@ -7,8 +9,6 @@
|
|
7
9
|
# license with this program. If not, please see
|
8
10
|
# <http://opensource.org/licenses/MIT>.
|
9
11
|
|
10
|
-
#!/usr/bin/env ruby
|
11
|
-
|
12
12
|
# Include rel-path ../lib/ in the $LOAD_PATH if it's not there already.
|
13
13
|
lib_directory = File.class_eval('expand_path(join(dirname(__FILE__), "..", "lib"))')
|
14
14
|
$LOAD_PATH.unshift(lib_directory) unless $LOAD_PATH.include?(lib_directory)
|
data/lib/frecon/database.rb
CHANGED
@@ -10,12 +10,23 @@
|
|
10
10
|
require "logger"
|
11
11
|
require "mongoid"
|
12
12
|
|
13
|
+
require "tempfile"
|
14
|
+
require "yaml"
|
15
|
+
|
13
16
|
require "frecon/models"
|
14
17
|
|
15
18
|
module FReCon
|
16
19
|
class Database
|
17
|
-
def self.setup(environment)
|
18
|
-
|
20
|
+
def self.setup(environment, mongoid_hash = nil)
|
21
|
+
if mongoid_hash.is_a?(Hash)
|
22
|
+
mongoid_tempfile = Tempfile.new("FReCon")
|
23
|
+
mongoid_tempfile.write(mongoid_hash.to_yaml)
|
24
|
+
mongoid_tempfile.rewind
|
25
|
+
|
26
|
+
Mongoid.load!(mongoid_tempfile.path, environment)
|
27
|
+
else
|
28
|
+
Mongoid.load!(File.join(File.dirname(__FILE__), "mongoid.yml"), environment)
|
29
|
+
end
|
19
30
|
|
20
31
|
Mongoid.logger.level = Logger::DEBUG
|
21
32
|
Mongoid.logger = Logger.new($stdout)
|