Permalink
Browse files

Added recipe for Settingslogic (https://github.com/binarylogic/settin…

  • Loading branch information...
1 parent 4fbb465 commit 270e2b4d0c573fb554838181a7adab0ec094ccdc @elandesign elandesign committed Mar 24, 2011
Showing with 43 additions and 0 deletions.
  1. +43 −0 recipes/settingslogic.rb
View
@@ -0,0 +1,43 @@
+gem 'settingslogic'
+
+say_wizard "Generating config/application.yml..."
+
+append_file "config/application.rb", <<-RUBY
+
+require 'settings'
+RUBY
+
+create_file "lib/settings.rb", <<-RUBY
+class Settings < Settingslogic
+ source "#\{Rails.root\}/config/application.yml"
+ namespace Rails.env
+end
+
+RUBY
+
+create_file "config/application.yml", <<-YAML
+defaults: &defaults
+ cool:
+ saweet: nested settings
+ neat_setting: 24
+ awesome_setting: <%= "Did you know 5 + 5 = #{5 + 5}?" %>
+
+development:
+ <<: *defaults
+ neat_setting: 800
+
+test:
+ <<: *defaults
+
+production:
+ <<: *defaults
+YAML
+
+__END__
+
+name: Settingslogic
+description: "A simple and straightforward settings solution that uses an ERB enabled YAML file and a singleton design pattern."
+author: elandesign
+
+category: other
+tags: [utilities, configuration]

0 comments on commit 270e2b4

Please sign in to comment.