sushi_fabric 0.4.7 → 0.4.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
  # encoding: utf-8
3
- # Version = '20151009-135017'
3
+ # Version = '20151016-160119'
4
4
 
5
5
  require 'csv'
6
6
  require 'fileutils'
@@ -54,11 +54,19 @@ end
54
54
  # check if there is a sqlite3 database of Ruby on Rails
55
55
  if defined?(::Project)
56
56
  NO_ROR = false
57
- elsif File.exist?(File.join(SUSHI_APP_DIR, "app/models"))
57
+ elsif File.exist?(File.join(SUSHI_APP_DIR, "app/models")) and
58
+ database_yml = File.join(SUSHI_APP_DIR, "config/database.yml") and
59
+ File.exist?(database_yml)
60
+
58
61
  NO_ROR = false
62
+
63
+ database_config = YAML.load(File.read(database_yml))
64
+ db = database_config["production"]
59
65
  ActiveRecord::Base.establish_connection(
60
- :adapter => 'sqlite3',
61
- :database => "#{SUSHI_APP_DIR}/db/#{mode}.sqlite3"
66
+ :adapter => db["adapter"],
67
+ :database => db["database"],
68
+ :username => db["username"],
69
+ :password => db["password"]
62
70
  )
63
71
  require "#{SUSHI_APP_DIR}/app/models/project"
64
72
  require "#{SUSHI_APP_DIR}/app/models/data_set"
@@ -1,3 +1,3 @@
1
1
  module SushiFabric
2
- VERSION = "0.4.7"
2
+ VERSION = "0.4.8"
3
3
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: sushi_fabric
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.4.7
5
+ version: 0.4.8
6
6
  platform: ruby
7
7
  authors:
8
8
  - Functional Genomics Center Zurich
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2015-10-09 00:00:00 Z
13
+ date: 2015-10-16 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bundler