couchbase-settings 0.0.6 → 0.1.0

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.
@@ -1,3 +1,3 @@
1
1
  module CouchbaseSettings
2
- VERSION = "0.0.6"
2
+ VERSION = "0.1.0"
3
3
  end
@@ -1,12 +1,8 @@
1
+ require 'rails'
1
2
  require 'yaml'
2
3
  require 'erb'
3
4
  require "couchbase_settings/version"
4
5
 
5
- COUCHBASE_PATH = "#{File.dirname(__FILE__)}/couchbase_settings"
6
- puts COUCHBASE_PATH
7
- require "#{COUCHBASE_PATH}/railtie.rb"
8
-
9
-
10
6
  module CouchbaseSettings
11
7
  class UndefinedCouchbaseSettings < StandardError; end
12
8
  class << self
@@ -19,16 +15,16 @@ module CouchbaseSettings
19
15
  def find_ymls
20
16
  main_file = "#{Rails.root.to_s}/config/couchbase.yml"
21
17
  couchbase_main_file = File.exists?(main_file) ? [main_file] : []
22
- couchbase_namespaced_files = Dir.glob("#{Rails.root.to_s}/config/couchbase/**/*.yml")
23
- couchbase_main_file.concat(couchbase_namespaced_files)
24
18
  end
25
19
 
26
20
  def create_cbsettings_class(yml_file)
27
21
  hash = load_yml(yml_file)
28
- klass_name = File.basename(yml_file).gsub(".yml","").camelize
29
- klass_name = "#{klass_name}CouchbaseSetting" unless klass_name=="CouchbaseSetting"
22
+ #klass_name = File.basename(yml_file).gsub(".yml","").camelize
23
+ klass_name = "CouchbaseSetting"
24
+ #klass_name = "#{klass_name}CouchbaseSetting" unless klass_name=="CouchbaseSetting"
30
25
  klass = Object.const_set(klass_name,Class.new)
31
26
  hash.each do |key,value|
27
+ #Rails.logger.debug "hash: key = #{key}, value = #{value}"
32
28
  klass.define_singleton_method(key){ value }
33
29
  end
34
30
  klass.class_eval do
@@ -44,3 +40,8 @@ module CouchbaseSettings
44
40
  end
45
41
  end # class << self
46
42
  end
43
+
44
+
45
+ COUCHBASE_SETTINGS_PATH = "#{File.dirname(__FILE__)}/couchbase_settings"
46
+ Rails.logger.debug "COUCHBASE_SETTINGS_PATH = #{COUCHBASE_SETTINGS_PATH}"
47
+ require "#{COUCHBASE_SETTINGS_PATH}/railtie.rb"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: couchbase-settings
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: