configger 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2010 Jens Fahnenbruck
2
+
3
+ Permission is hereby granted, free of charge, to any person
4
+ obtaining a copy of this software and associated documentation
5
+ files (the "Software"), to deal in the Software without
6
+ restriction, including without limitation the rights to use,
7
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the
9
+ Software is furnished to do so, subject to the following
10
+ conditions:
11
+
12
+ The above copyright notice and this permission notice shall be
13
+ included in all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22
+ OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,7 @@
1
+ LICENSE
2
+ Manifest
3
+ README.md
4
+ Rakefile
5
+ init.rb
6
+ lib/configger.rb
7
+ rails/init.rb
File without changes
@@ -0,0 +1,14 @@
1
+ require 'rubygems'
2
+ require 'rake'
3
+ require 'echoe'
4
+
5
+ Echoe.new('configger', '0.0.1') do |p|
6
+ p.description = "A gem to simplify configuaration Loading"
7
+ p.url = "http://github.com/jigfox/configger"
8
+ p.author = "Jens Fahnenbruck"
9
+ p.email = "jigfox@me.com"
10
+ p.ignore_pattern = ["tmp/*","script/*"]
11
+ p.development_dependencies = []
12
+ end
13
+
14
+ Dir["#{File.dirname(__FILE__)}/tasks/*.rake"].sort.each { |ext| load ext }
@@ -0,0 +1,30 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = %q{configger}
5
+ s.version = "0.0.1"
6
+
7
+ s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
+ s.authors = ["Jens Fahnenbruck"]
9
+ s.date = %q{2010-05-12}
10
+ s.description = %q{A gem to simplify configuaration Loading}
11
+ s.email = %q{jigfox@me.com}
12
+ s.extra_rdoc_files = ["LICENSE", "README.md", "lib/configger.rb"]
13
+ s.files = ["LICENSE", "Manifest", "README.md", "Rakefile", "init.rb", "lib/configger.rb", "rails/init.rb", "configger.gemspec"]
14
+ s.homepage = %q{http://github.com/jigfox/configger}
15
+ s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Configger", "--main", "README.md"]
16
+ s.require_paths = ["lib"]
17
+ s.rubyforge_project = %q{configger}
18
+ s.rubygems_version = %q{1.3.6}
19
+ s.summary = %q{A gem to simplify configuaration Loading}
20
+
21
+ if s.respond_to? :specification_version then
22
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
23
+ s.specification_version = 3
24
+
25
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
26
+ else
27
+ end
28
+ else
29
+ end
30
+ end
data/init.rb ADDED
@@ -0,0 +1 @@
1
+ require File.dirname(__FILE__) + '/rails/init'
@@ -0,0 +1,22 @@
1
+ module ConfigLoader
2
+ @@configs = {}
3
+
4
+ def self.method_missing(m,*args,&block)
5
+ @@configs[m.to_sym] ||= Configuration.new File.join(Rails.root,"config","#{m}.yml")
6
+ end
7
+
8
+ class Configuration
9
+ def initialize(file_name)
10
+ @file_name = file_name.to_s
11
+ raise MissingConfiguration.new "#{@file_name} is missing!" unless File.exists? @file_name
12
+ @config = YAML.load_file(@file_name)[Rails.env]
13
+ end
14
+
15
+ def [](attribute)
16
+ @config[attribute]
17
+ end
18
+ end
19
+
20
+ class MissingConfiguration < Exception
21
+ end
22
+ end
@@ -0,0 +1 @@
1
+ require File.dirname(File.dirname(__FILE__)) + '/lib/configger'
metadata ADDED
@@ -0,0 +1,77 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: configger
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 0
8
+ - 1
9
+ version: 0.0.1
10
+ platform: ruby
11
+ authors:
12
+ - Jens Fahnenbruck
13
+ autorequire:
14
+ bindir: bin
15
+ cert_chain: []
16
+
17
+ date: 2010-05-12 00:00:00 +02:00
18
+ default_executable:
19
+ dependencies: []
20
+
21
+ description: A gem to simplify configuaration Loading
22
+ email: jigfox@me.com
23
+ executables: []
24
+
25
+ extensions: []
26
+
27
+ extra_rdoc_files:
28
+ - LICENSE
29
+ - README.md
30
+ - lib/configger.rb
31
+ files:
32
+ - LICENSE
33
+ - Manifest
34
+ - README.md
35
+ - Rakefile
36
+ - init.rb
37
+ - lib/configger.rb
38
+ - rails/init.rb
39
+ - configger.gemspec
40
+ has_rdoc: true
41
+ homepage: http://github.com/jigfox/configger
42
+ licenses: []
43
+
44
+ post_install_message:
45
+ rdoc_options:
46
+ - --line-numbers
47
+ - --inline-source
48
+ - --title
49
+ - Configger
50
+ - --main
51
+ - README.md
52
+ require_paths:
53
+ - lib
54
+ required_ruby_version: !ruby/object:Gem::Requirement
55
+ requirements:
56
+ - - ">="
57
+ - !ruby/object:Gem::Version
58
+ segments:
59
+ - 0
60
+ version: "0"
61
+ required_rubygems_version: !ruby/object:Gem::Requirement
62
+ requirements:
63
+ - - ">="
64
+ - !ruby/object:Gem::Version
65
+ segments:
66
+ - 1
67
+ - 2
68
+ version: "1.2"
69
+ requirements: []
70
+
71
+ rubyforge_project: configger
72
+ rubygems_version: 1.3.6
73
+ signing_key:
74
+ specification_version: 3
75
+ summary: A gem to simplify configuaration Loading
76
+ test_files: []
77
+