From f0d8a71e5c69fdaa0ae694b6f9c647fae1315e1d Mon Sep 17 00:00:00 2001 From: Jordan Prince Date: Mon, 26 Nov 2012 15:32:20 -0600 Subject: [PATCH 1/5] stuff --- activeconfig.gemspec | 1 + 1 file changed, 1 insertion(+) diff --git a/activeconfig.gemspec b/activeconfig.gemspec index 844b069..daf5755 100644 --- a/activeconfig.gemspec +++ b/activeconfig.gemspec @@ -7,6 +7,7 @@ Gem::Specification.new do |s| s.name = "activeconfig" s.version = "0.6.2" + s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= s.authors = ["Jeremy Lawler"] s.date = "2012-08-27" From e1fbdad58524de266b025ea18414dcf71fd06fb5 Mon Sep 17 00:00:00 2001 From: Jordan Prince Date: Mon, 26 Nov 2012 15:59:31 -0600 Subject: [PATCH 2/5] Looking at markdown --- activeconfig.gemspec | 1 - readme.md | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 readme.md diff --git a/activeconfig.gemspec b/activeconfig.gemspec index daf5755..844b069 100644 --- a/activeconfig.gemspec +++ b/activeconfig.gemspec @@ -7,7 +7,6 @@ Gem::Specification.new do |s| s.name = "activeconfig" s.version = "0.6.2" - s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= s.authors = ["Jeremy Lawler"] s.date = "2012-08-27" diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..a00d109 --- /dev/null +++ b/readme.md @@ -0,0 +1,36 @@ +ActiveConfig +============ + + +1. In your gemfile: + + gem 'therubyracer' + gem 'activeconfig' + +2. On the command line: + + rails generate active_config:install + +3. Create etc/defaults.yml: + + environmental_var: "foo" + +4. Create etc/defaults_production.yml + + environmental_var: "bar" + +5. Run this code in IRB in development: + + CONF.defaults.environmental_var + +You will get "foo" + +6. Run this code in IRB in production: + + CONF.defaults.environment_var + +And get "bar" + + +An extremely flexible configuration system. Gives the ability for certain values to be overridden when conditions are met. For example, you could have your production API keys only get read when the Rails.env == production + From 31427a76261ce04f0026a4289c2d3cf479ee63ce Mon Sep 17 00:00:00 2001 From: Jordan Prince Date: Mon, 26 Nov 2012 16:03:34 -0600 Subject: [PATCH 3/5] Made readme --- readme.md | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/readme.md b/readme.md index a00d109..b74ca72 100644 --- a/readme.md +++ b/readme.md @@ -4,18 +4,18 @@ ActiveConfig 1. In your gemfile: - gem 'therubyracer' + gem 'therubyracer'; gem 'activeconfig' 2. On the command line: rails generate active_config:install -3. Create etc/defaults.yml: +3. Create etc/defaults.yml and insert: environmental_var: "foo" -4. Create etc/defaults_production.yml +4. Create etc/defaults_production.yml and insert environmental_var: "bar" @@ -31,6 +31,19 @@ You will get "foo" And get "bar" +What is it? +----------- -An extremely flexible configuration system. Gives the ability for certain values to be overridden when conditions are met. For example, you could have your production API keys only get read when the Rails.env == production +An extremely flexible configuration system. Gives the ability for certain values to be overridden when conditions are met. For example, you could have your production API keys only get read when the Rails.env == production. +Specifically, you can create yaml files in the etc directory, and the variables you set there will be accessible in code via CONF., which is a hash representing the key-value pairs in the file. Note that it allows for environment specialization: defaults.yml will be used to populate CONF.defaults in development, so will defaults_development.yml, but defaults_production.yml will be used in production. + + +What other cool things does it do? +---------------------------------- +Moves your database.yml into the etc folder. + +Author Jordan Prince + +License +MIT/X11 From b3626ad60636697171a15d1abe9e11e6dfcb2483 Mon Sep 17 00:00:00 2001 From: Jordan Prince Date: Mon, 26 Nov 2012 16:05:40 -0600 Subject: [PATCH 4/5] removed irb ref --- readme.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/readme.md b/readme.md index b74ca72..01a8082 100644 --- a/readme.md +++ b/readme.md @@ -19,13 +19,13 @@ ActiveConfig environmental_var: "bar" -5. Run this code in IRB in development: +5. Run this code in development: CONF.defaults.environmental_var You will get "foo" -6. Run this code in IRB in production: +6. Run this code in production: CONF.defaults.environment_var From f9412e68cfc895f6cf44b0f1c3925bf3da84d69f Mon Sep 17 00:00:00 2001 From: Jordan Prince Date: Mon, 26 Nov 2012 16:06:38 -0600 Subject: [PATCH 5/5] More revisions --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 01a8082..6db0878 100644 --- a/readme.md +++ b/readme.md @@ -36,7 +36,7 @@ What is it? An extremely flexible configuration system. Gives the ability for certain values to be overridden when conditions are met. For example, you could have your production API keys only get read when the Rails.env == production. -Specifically, you can create yaml files in the etc directory, and the variables you set there will be accessible in code via CONF., which is a hash representing the key-value pairs in the file. Note that it allows for environment specialization: defaults.yml will be used to populate CONF.defaults in development, so will defaults_development.yml, but defaults_production.yml will be used in production. +Specifically, you can create yaml files filled with key-value pairs in the etc directory, and the variables you set there will be accessible in code via CONF., which is a hash representing the key-value pairs in the file. Note that it allows for environment specialization: defaults.yml will be used to populate CONF.defaults in development, so will defaults_development.yml, but defaults_production.yml will be used in production. What other cool things does it do?