forked from ontoportal/goo
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'pr/feature/update-resource-seetings' of github.com:onto…
…portal-lirmm/goo into ontoportal-lirmm-pr/feature/update-resource-seetings
- Loading branch information
Showing
11 changed files
with
293 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,8 @@ Gem::Specification.new do |s| | |
s.email = "[email protected]" | ||
s.files = Dir["lib/**/*.rb"] | ||
s.homepage = "http://github.com/ncbo/goo" | ||
s.add_dependency("addressable", "~> 2.8") | ||
|
||
s.add_dependency("addressable", "~> 2.8") | ||
s.add_dependency("pry") | ||
s.add_dependency("rdf", "= 1.0.8") | ||
s.add_dependency("redis") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
require 'yaml' | ||
|
||
module Goo | ||
module Base | ||
module Settings | ||
module YAMLScheme | ||
attr_reader :yaml_settings | ||
|
||
def init_yaml_scheme_settings | ||
scheme_file_path = @model_settings[:scheme] | ||
@yaml_settings = read_yaml_settings_file(scheme_file_path) | ||
end | ||
|
||
def attribute_yaml_settings(attr) | ||
|
||
return {} if yaml_settings.nil? | ||
|
||
yaml_settings[attr.to_sym] | ||
end | ||
|
||
|
||
|
||
private | ||
|
||
def load_yaml_scheme_options(attr) | ||
settings = attribute_settings(attr) | ||
yaml_settings = attribute_yaml_settings(attr) | ||
settings.merge! yaml_settings unless yaml_settings.nil? || yaml_settings.empty? | ||
end | ||
|
||
def read_yaml_settings_file(scheme_file_path) | ||
return if scheme_file_path.nil? | ||
|
||
yaml_contents = File.read(scheme_file_path) rescue return | ||
|
||
YAML.safe_load(yaml_contents, symbolize_names: true) | ||
end | ||
end | ||
end | ||
end | ||
end | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.