frecon 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f12c1949f95e5a56005e8ba75f01a49a5bf672db
4
- data.tar.gz: 64a01d87ee6f1720e51802033cbd17a4447e7c4b
3
+ metadata.gz: 0c2b4116037363c5580518c012f3f9f539928742
4
+ data.tar.gz: 25724f6f99f6a82ff6d559c77e4ef35e079091ff
5
5
  SHA512:
6
- metadata.gz: 47d90c65cce4893bc961ebc606bda4145f75bf0930a9c8fa10fa391cd036e2bfd0f16bb366106177461db1b4ebe0d0d5b0f61852a3d0330559503eb121f22499
7
- data.tar.gz: 01d19cb9ca9c02d2cb5874fb8a02c477795595034986cace87291750ac5775862f4219836ccaaf0064072050917ca38908d489d52af31ffb67e5d19f913ec745
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)
@@ -8,7 +8,7 @@
8
8
  # <http://opensource.org/licenses/MIT>.
9
9
 
10
10
  module FReCon
11
- VERSION = "0.1.2"
11
+ VERSION = "0.1.3"
12
12
 
13
13
  @environment_variable = :development
14
14
 
@@ -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
- Mongoid.load!(File.join(File.dirname(__FILE__), "mongoid.yml"), environment)
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)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: frecon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Craig