envision 0.0.1

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.
data/README.md ADDED
@@ -0,0 +1,2 @@
1
+ Envision
2
+ ==============================================================================
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
data/lib/envision.rb ADDED
@@ -0,0 +1,21 @@
1
+ require 'envision/version'
2
+ require 'yaml'
3
+
4
+ module Envision
5
+ Configuration ||= {}
6
+
7
+ def self.load(options = {})
8
+ environment = options[:environment].to_s
9
+
10
+ options[:files].each do |fileset|
11
+ Dir[fileset].each do |file|
12
+ configuration_key = File.basename(file).gsub(/\.yml\z/, '').to_sym
13
+
14
+ Configuration[configuration_key] ||= {}
15
+ Configuration[configuration_key].merge! YAML.load_file(file)[environment].symbolize_keys
16
+ end
17
+ end
18
+ end
19
+ end
20
+
21
+ require 'envision/railtie' if defined?(Rails) and defined?(Rails::Railtie)
@@ -0,0 +1,20 @@
1
+ module Envision
2
+ class Railtie < Rails::Railtie
3
+ include Rake::DSL if defined?(Rake)
4
+
5
+ rake_tasks do
6
+ desc 'Load Envision environment files'
7
+ task :envision do
8
+ Envision.load :files => [Rails.root.join('config', 'envision', '*.yml')],
9
+ :environment => Rails.env
10
+ end
11
+
12
+ task :environment => :envision
13
+ end
14
+
15
+ initializer 'envision', :before => 'load_environment_config' do |app|
16
+ Envision.load :files => [Rails.root.join('config', 'envision', '*.yml')],
17
+ :environment => Rails.env
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,3 @@
1
+ module Envision
2
+ VERSION = '0.0.1'
3
+ end
metadata ADDED
@@ -0,0 +1,52 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: envision
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - jfelchner
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-01-25 00:00:00.000000000 Z
13
+ dependencies: []
14
+ description: ''
15
+ email: accounts+git@thekompanee.com
16
+ executables: []
17
+ extensions: []
18
+ extra_rdoc_files:
19
+ - README.md
20
+ files:
21
+ - lib/envision/railtie.rb
22
+ - lib/envision/version.rb
23
+ - lib/envision.rb
24
+ - Rakefile
25
+ - README.md
26
+ homepage: https://github.com/jfelchner/envision
27
+ licenses: []
28
+ post_install_message:
29
+ rdoc_options:
30
+ - --charset = UTF-8
31
+ require_paths:
32
+ - lib
33
+ required_ruby_version: !ruby/object:Gem::Requirement
34
+ none: false
35
+ requirements:
36
+ - - ! '>='
37
+ - !ruby/object:Gem::Version
38
+ version: '0'
39
+ required_rubygems_version: !ruby/object:Gem::Requirement
40
+ none: false
41
+ requirements:
42
+ - - ! '>='
43
+ - !ruby/object:Gem::Version
44
+ version: '0'
45
+ requirements: []
46
+ rubyforge_project: envision
47
+ rubygems_version: 1.8.24
48
+ signing_key:
49
+ specification_version: 3
50
+ summary: Easy per-environment configuration loading for your projects.
51
+ test_files: []
52
+ has_rdoc: