gitmodel-rails 0.1.1 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.1
1
+ 0.1.3
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "gitmodel-rails"
8
- s.version = "0.1.1"
8
+ s.version = "0.1.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["mcasimir"]
@@ -7,23 +7,21 @@ module GitmodelRails
7
7
 
8
8
  gitmodel_config_file = Rails.root.join("config", "gitmodel.yml")
9
9
 
10
- unless File.exist?(gitmodel_config_file)
11
- raise "Gitmodel: configuration file not found"
12
- end
13
-
14
- gitmodel_config = YAML.load_file(gitmodel_config_file)
15
- gitmodel_config = gitmodel_config.is_a?(Hash) ? gitmodel_config : {}
16
- GitModel.db_root = gitmodel_config.fetch("gitmodel", nil).try(:fetch, "db_root", GitModel.db_root)
17
- GitModel.default_branch = gitmodel_config.fetch("gitmodel", nil).try(:fetch, "default_branch", GitModel.default_branch)
18
- GitModel.git_user_name = gitmodel_config.fetch("gitmodel", nil).try(:fetch, "git_user_name", GitModel.git_user_name)
19
- GitModel.git_user_email = gitmodel_config.fetch("gitmodel", nil).try(:fetch, "git_user_email", GitModel.git_user_email)
20
- GitModel.memcache_servers = Array.wrap gitmodel_config.fetch("gitmodel", nil).try(:fetch, "memcache_servers", nil)
21
- GitModel.memcache_namespace = gitmodel_config.fetch("gitmodel", nil).try(:fetch, "memcache_namespace", GitModel.git_user_email)
10
+ if File.exist?(gitmodel_config_file)
11
+ gitmodel_config = YAML.load_file(gitmodel_config_file)
12
+ gitmodel_config = gitmodel_config.is_a?(Hash) ? gitmodel_config : {}
13
+ GitModel.db_root = gitmodel_config.fetch("gitmodel", nil).try(:fetch, "db_root", GitModel.db_root)
14
+ GitModel.default_branch = gitmodel_config.fetch("gitmodel", nil).try(:fetch, "default_branch", GitModel.default_branch)
15
+ GitModel.git_user_name = gitmodel_config.fetch("gitmodel", nil).try(:fetch, "git_user_name", GitModel.git_user_name)
16
+ GitModel.git_user_email = gitmodel_config.fetch("gitmodel", nil).try(:fetch, "git_user_email", GitModel.git_user_email)
17
+ GitModel.memcache_servers = Array.wrap gitmodel_config.fetch("gitmodel", nil).try(:fetch, "memcache_servers", nil)
18
+ GitModel.memcache_namespace = gitmodel_config.fetch("gitmodel", nil).try(:fetch, "memcache_namespace", GitModel.git_user_email)
22
19
 
23
- GitModel.db_root = Rails.root.join(GitModel.db_root)
20
+ GitModel.db_root = Rails.root.join(GitModel.db_root)
24
21
 
25
- unless File.exist?(GitModel.db_root)
26
- GitModel.create_db!
22
+ unless File.exist?(GitModel.db_root)
23
+ GitModel.create_db!
24
+ end
27
25
  end
28
26
 
29
27
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitmodel-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -110,7 +110,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
110
110
  version: '0'
111
111
  segments:
112
112
  - 0
113
- hash: 1926084905046772441
113
+ hash: -3965994780301818265
114
114
  required_rubygems_version: !ruby/object:Gem::Requirement
115
115
  none: false
116
116
  requirements: