Permalink
Browse files

v0.4.0

  • Loading branch information...
1 parent 1cb653f commit 9ebefbc52d196aadeaee6cc61e19806a2c184313 @rahmal committed Mar 27, 2012
Showing with 1,331 additions and 1,800 deletions.
  1. +3 −7 .gitignore
  2. +1 −0 .rspec
  3. +1 −0 .rvmrc
  4. +10 −3 ChangeLog
  5. 0 Credits
  6. +9 −0 Gemfile
  7. +30 −0 Gemfile.lock
  8. +20 −21 LICENSE → LICENSE.txt
  9. +0 −31 Manifest
  10. 0 README.rdoc
  11. 0 Rakefile
  12. +0 −1 VERSION
  13. 0 doc/classes/ClassVariables.html
  14. 0 doc/classes/ConfigError.html
  15. 0 doc/classes/ConfigHash.html
  16. 0 doc/classes/Constants.html
  17. 0 doc/classes/Hash.html
  18. 0 doc/classes/InvalidConfigPathError.html
  19. 0 doc/classes/Object.html
  20. 0 doc/classes/PropertiesFileParser.html
  21. 0 doc/classes/RConfig.html
  22. 0 doc/created.rid
  23. 0 doc/files/README_rdoc.html
  24. 0 doc/files/lib/rconfig/class_variables_rb.html
  25. 0 doc/files/lib/rconfig/config_hash_rb.html
  26. 0 doc/files/lib/rconfig/constants_rb.html
  27. 0 doc/files/lib/rconfig/core_ext/hash_rb.html
  28. 0 doc/files/lib/rconfig/core_ext/object_rb.html
  29. 0 doc/files/lib/rconfig/core_ext_rb.html
  30. 0 doc/files/lib/rconfig/exceptions_rb.html
  31. 0 doc/files/lib/rconfig/properties_file_parser_rb.html
  32. 0 doc/files/lib/rconfig/rconfig_rb.html
  33. 0 doc/files/lib/rconfig_rb.html
  34. 0 doc/fr_class_index.html
  35. 0 doc/fr_file_index.html
  36. 0 doc/fr_method_index.html
  37. 0 doc/index.html
  38. 0 doc/rdoc-style.css
  39. +13 −0 lib/generators/rconfig/install_generator.rb
  40. +82 −0 lib/generators/rconfig/templates/rconfig.rb
  41. +98 −38 lib/rconfig.rb
  42. +11 −16 lib/rconfig/{mixins → }/callbacks.rb
  43. +56 −0 lib/rconfig/cascade.rb
  44. +103 −0 lib/rconfig/config.rb
  45. +0 −101 lib/rconfig/config_hash.rb
  46. +58 −0 lib/rconfig/constants.rb
  47. +0 −5 lib/rconfig/core_ext.rb
  48. +3 −0 lib/rconfig/core_ext/array.rb
  49. 0 lib/rconfig/core_ext/hash.rb
  50. +5 −0 lib/rconfig/core_ext/nil.rb
  51. +0 −46 lib/rconfig/core_ext/object.rb
  52. +3 −0 lib/rconfig/core_ext/string.rb
  53. +276 −0 lib/rconfig/core_methods.rb
  54. +19 −7 lib/rconfig/exceptions.rb
  55. +55 −0 lib/rconfig/load_paths.rb
  56. +67 −28 lib/rconfig/logger.rb
  57. +0 −10 lib/rconfig/mixins.rb
  58. +0 −71 lib/rconfig/mixins/class_variables.rb
  59. +0 −119 lib/rconfig/mixins/config_paths.rb
  60. +0 −54 lib/rconfig/mixins/constants.rb
  61. +0 −67 lib/rconfig/mixins/overlay.rb
  62. +0 −72 lib/rconfig/mixins/reload.rb
  63. +0 −120 lib/rconfig/mixins/utils.rb
  64. +0 −42 lib/rconfig/options.rb
  65. +52 −50 lib/rconfig/properties_file_parser.rb
  66. +0 −398 lib/rconfig/rconfig.rb
  67. +75 −0 lib/rconfig/reload.rb
  68. +92 −0 lib/rconfig/settings.rb
  69. +157 −0 lib/rconfig/utils.rb
  70. 0 { → lib}/tasks/gem.rake
  71. 0 { → lib}/tasks/rdoc.rake
  72. 0 { → lib}/tasks/spec.rake
  73. +0 −1 new-gem
  74. BIN rconfig-0.3.2.gem
  75. +25 −24 rconfig.gemspec
  76. 0 spec/core_ext/object_spec.rb
  77. +7 −0 spec/rconfig_spec.rb
  78. 0 spec/spec.opts
  79. 0 spec/spec_helper.rb
  80. +0 −3 test/config_files/application.yml
  81. +0 −5 test/config_files/my_class.yml
  82. +0 −14 test/config_files/test.yml
  83. +0 −13 test/config_files/test_GB.yml
  84. +0 −15 test/config_files/test_US.yml
  85. +0 −9 test/config_files/test_local.yml
  86. +0 −15 test/config_files/test_production.yml
  87. +0 −394 test/rconfig_test.rb
View
10 .gitignore 100755 → 100644
@@ -1,21 +1,17 @@
*.iws
*.ipr
*.iml
-*.log
*.tmproj
+*.log
*.swp
*.*~
*~
.bundle
.directory
+.document
.idea
.project
-.redcar
-.rvmrc
-.rakeTasks
-.svn
-.yardoc
.DS_Store
+.rakeTasks
log
tmp
-doc
View
1 .rspec
@@ -0,0 +1 @@
+--color --format progress --backtrace
View
1 .rvmrc
@@ -0,0 +1 @@
+rvm use 1.9.2@rconfig
View
13 ChangeLog 100755 → 100644
@@ -1,16 +1,23 @@
0.4.0
=====
-* Extend object to add short-hand access to config.
-* Break rconfig core into separate modules to decrease core class size.
+* Broke RConfig core into separate modules to decrease core class size.
+* Added Rails generator to override RConfig settings in Rails projects
+* Added support for git-like config files, giving key/value properties files potentially three levels.
+* Refactored settings module to allow for clean defaults, and overriding.
+* Added RConfig logger.
+* Renamed overlay to cascade
* Fixed a syntax error in when clause of config_hash.rb for ruby 1.9.1 - From dvyjones/rconfig (github).
* Fixed raise on allow_reload method.
* Fixed unit test, rconfig_test.rb.
* Fixed minor typos, comments, and bugs.
* Refactored Hash#weave signature; changed dont_clobber=true, to clobber=false (reads more intuitively).
-* Added support for git-like config files, giving key/value properties files potentially three levels.
* Removed redundant validate method from PropertiesFileParser.
* Moved PropertiesFileParser regexps to constants.
+0.3.3
+=====
+* Fixed overlay class variable not loaded warning.
+
0.3.2
=====
* Fixed bug in 0.3.1 causing stackrace
View
0 Credits 100755 → 100644
No changes.
View
@@ -0,0 +1,9 @@
+source 'http://rubygems.org'
+
+gem 'activesupport', '~> 3.0', :require => 'active_support'
+
+group :development do
+ gem 'rspec', '~> 2.3.0'
+ gem 'bundler', '~> 1.0.0'
+ gem 'jeweler', '~> 1.6.4'
+end
View
@@ -0,0 +1,30 @@
+GEM
+ remote: http://rubygems.org/
+ specs:
+ activesupport (3.1.1)
+ multi_json (~> 1.0)
+ diff-lcs (1.1.3)
+ git (1.2.5)
+ jeweler (1.6.4)
+ bundler (~> 1.0)
+ git (>= 1.2.5)
+ rake
+ multi_json (1.1.0)
+ rake (0.9.2.2)
+ rspec (2.3.0)
+ rspec-core (~> 2.3.0)
+ rspec-expectations (~> 2.3.0)
+ rspec-mocks (~> 2.3.0)
+ rspec-core (2.3.1)
+ rspec-expectations (2.3.0)
+ diff-lcs (~> 1.1.2)
+ rspec-mocks (2.3.0)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ activesupport (~> 3.0)
+ bundler (~> 1.0.0)
+ jeweler (~> 1.6.4)
+ rspec (~> 2.3.0)
View
41 LICENSE → LICENSE.txt 100755 → 100644
@@ -1,21 +1,20 @@
-Copyright (C) 2009 Rahmal H. Conda
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
+Copyright (c) 2011 Rahmal Conda
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
View
@@ -1,31 +0,0 @@
-ChangeLog
-demo/
-demo/demo.conf
-demo/demo.rb
-demo/demo.xml
-demo/demo.yml
-demo/global.yml
-lib/
-lib/rconfig/
-lib/rconfig/config_hash.rb
-lib/rconfig/config_parser.rb
-lib/rconfig/core_ext/
-lib/rconfig/core_ext/hash.rb
-rconfig.rb
-LICENSE
-Manifest
-Rakefile
-rconfig.gemspec
-README
-tasks/
-tasks/docs.rake
-tasks/gemspec.rake
-test/
-test/rconfig_test.rb
-test/test_files/
-test/test_files/global.yml
-test/test_files/test_development.yml
-test/test_files/test_local.yml
-test/test_files/test_production.yml
-test/test_files/test.yml
-VERSION
View
0 README.rdoc 100755 → 100644
No changes.
View
0 Rakefile 100755 → 100644
No changes.
View
@@ -1 +0,0 @@
-0.3.3
View
0 doc/classes/ClassVariables.html 100755 → 100644
No changes.
View
0 doc/classes/ConfigError.html 100755 → 100644
No changes.
View
0 doc/classes/ConfigHash.html 100755 → 100644
No changes.
View
0 doc/classes/Constants.html 100755 → 100644
No changes.
View
0 doc/classes/Hash.html 100755 → 100644
No changes.
View
No changes.
View
0 doc/classes/Object.html 100755 → 100644
No changes.
View
No changes.
View
0 doc/classes/RConfig.html 100755 → 100644
No changes.
View
0 doc/created.rid 100755 → 100644
No changes.
View
0 doc/files/README_rdoc.html 100755 → 100644
No changes.
View
No changes.
View
No changes.
View
No changes.
View
No changes.
View
No changes.
View
No changes.
View
No changes.
No changes.
View
No changes.
View
0 doc/files/lib/rconfig_rb.html 100755 → 100644
No changes.
View
0 doc/fr_class_index.html 100755 → 100644
No changes.
View
0 doc/fr_file_index.html 100755 → 100644
No changes.
View
0 doc/fr_method_index.html 100755 → 100644
No changes.
View
0 doc/index.html 100755 → 100644
No changes.
View
0 doc/rdoc-style.css 100755 → 100644
No changes.
@@ -0,0 +1,13 @@
+module RConfig
+ module Generators
+ class InstallGenerator < Rails::Generators::Base
+ desc "Create RConfig settings initializer file"
+ source_root File.expand_path("../templates", __FILE__)
+
+ def create_initializer_file
+ template "rconfig.rb", "config/initializers/rconfig.rb"
+ end
+ end
+ end
+end
+
@@ -0,0 +1,82 @@
+# Use this hook to configure rconfig mailer, warden hooks and so forth. The first
+# four configuration values can also be set straight in your models.
+RConfig.setup do |config|
+
+ # ==> Configuration File Load Paths
+ # The list of directories from which to load configuration files.
+ # If This is a Rails Application, it will default to "#{Rail.root}/config",
+ # It will also check for the existence of a CONFIG_ROOT constant, and adds
+ # it, if found. I will also attempt to use "config" if such a directory
+ # exists in the application root. Otherwise it will be empty, in which case
+ # one or more paths must be added manually here.
+ #
+ # config.load_paths = []
+
+ # ==> Overlay Suffix
+ # Use this to add a custom cascade to be used beyond that of environment,
+ # or platform cascades. For instance, besides supporting configuration for
+ # development as 'application_development.yml', you can use cascade to also
+ # provide a locale, by setting config.cascade = 'GB', RConfig will look for
+ # the file 'application_development_GB.yml'
+ # See documentation for details on how cascading configurations work.
+ #
+ # config.cascade = false
+
+ # ==> Configuration File Types
+ # The type of configuration files to load within the configuration
+ # directories. The supported file types are yaml, xml, and property
+ # files (.property). One or more can be used at once.
+ # The default is to use yml files only, but other types can added
+ # by using the pre-defined constants or simply setting an new array.
+ #
+ # Pre-defined Constants
+ # YML_FILE_TYPES = [:yml, :yaml] # yml, yaml => yaml files, parsable by YAML library
+ # XML_FILE_TYPES = [:xml] # xml => self-explanatory
+ # CNF_FILE_TYPES = [:cnf, :conf, :config, :properties] # conf, properties => key=value based config files
+ # CONFIG_FILE_TYPES = YML + XML + CNF # All => All of the above file types combined
+ #
+ # Examples:
+ # config.file_types = CONFIG_FILE_TYPES
+ # config.file_types = [ :yml, :xml, :property ]
+ #
+ # config.file_types = [ :yml ]
+
+ # ==> Enable/Disable Cache Reload
+ # Flag variable indicating whether or not periodic reloads should
+ # be performed. Defaults to false.
+ #
+ # config.enabled_reload = false
+
+ # ==> Interval for Reloading Configuration Data
+ # The interval in which to perform periodic reloading of config files (in
+ # seconds). Files are checked befor reload is executed. They are not reloaded
+ # if the data has not changed. Defaults to 300 seconds (5 minutes).
+ #
+ # config.reload_interval = 300
+
+ # ==> Logger
+ # The logger rconfig will log to. By default RConfig uses the Rails logger,
+ # or the standard Ruby logger if this is not a rails environment. The
+ # The logger can be changed to a different logger, like Log4r. You can also stick with the RConfig logger, but customize
+ # it's log options The available options are as follows:
+ # * level: The log level to log at. Default: ERROR
+ # * output: The outputter to send messages to. Default: STDERR
+ # * file: The name of the file to log to (cannot be used with output).
+ # * date_format: The format of the timestamp when something is logged.
+ # Options are passed in a hash to the new method.
+ # Example:
+ # RConfig::Logger.new(
+ # :file => "#{Rails.root}/log/production.log",
+ # :date_format => "%Y-%m-%d %H:%M:%S",
+ # :level => RConfig::Logger::ERROR
+ # )
+ #
+ # config.logger = RConfig::Logger.new
+
+ # ==> Log Level
+ # The log level the specified logger will be set to. By default it is set to WARN.
+ # It can also be set when initializing the logger, specifying the level in the options.
+ #
+ # config.log_level = RConfig::Logger::WARN
+end
+
Oops, something went wrong.

0 comments on commit 9ebefbc

Please sign in to comment.