sinatra-config-file 0.6.1 → 1.0
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.
- metadata +30 -91
- data/LICENSE +0 -27
- data/README.md +0 -41
- data/lib/sinatra/config_file.rb +0 -32
metadata
CHANGED
@@ -1,116 +1,55 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: sinatra-config-file
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: '1.0'
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 6
|
9
|
-
- 1
|
10
|
-
version: 0.6.1
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Konstantin Haase
|
14
|
-
- Dmitry A. Ustalov
|
15
9
|
autorequire:
|
16
10
|
bindir: bin
|
17
11
|
cert_chain: []
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
name: sinatra
|
24
|
-
prerelease: false
|
25
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
12
|
+
date: 2011-10-28 00:00:00.000000000Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: sinatra-contrib
|
16
|
+
requirement: &2152483640 !ruby/object:Gem::Requirement
|
26
17
|
none: false
|
27
|
-
requirements:
|
28
|
-
- -
|
29
|
-
- !ruby/object:Gem::Version
|
30
|
-
|
31
|
-
segments:
|
32
|
-
- 1
|
33
|
-
- 0
|
34
|
-
version: "1.0"
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
35
22
|
type: :runtime
|
36
|
-
version_requirements: *id001
|
37
|
-
- !ruby/object:Gem::Dependency
|
38
|
-
name: rspec
|
39
|
-
prerelease: false
|
40
|
-
requirement: &id002 !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
|
-
requirements:
|
43
|
-
- - ">="
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
hash: 27
|
46
|
-
segments:
|
47
|
-
- 1
|
48
|
-
- 3
|
49
|
-
- 0
|
50
|
-
version: 1.3.0
|
51
|
-
type: :development
|
52
|
-
version_requirements: *id002
|
53
|
-
- !ruby/object:Gem::Dependency
|
54
|
-
name: sinatra-test-helper
|
55
23
|
prerelease: false
|
56
|
-
|
57
|
-
|
58
|
-
requirements:
|
59
|
-
- - ~>
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
hash: 11
|
62
|
-
segments:
|
63
|
-
- 0
|
64
|
-
- 5
|
65
|
-
- 0
|
66
|
-
version: 0.5.0
|
67
|
-
type: :development
|
68
|
-
version_requirements: *id003
|
69
|
-
description: Load Sinatra settings from a yaml file.
|
24
|
+
version_requirements: *2152483640
|
25
|
+
description: ! 'Dummy gem, sinatra-config-file is now part of sinatra-contrib: http://www.sinatrarb.com/contrib/'
|
70
26
|
email: konstantin.mailinglists@googlemail.com
|
71
27
|
executables: []
|
72
|
-
|
73
28
|
extensions: []
|
74
|
-
|
75
29
|
extra_rdoc_files: []
|
76
|
-
|
77
|
-
|
78
|
-
- lib/sinatra/config_file.rb
|
79
|
-
- README.md
|
80
|
-
- LICENSE
|
81
|
-
has_rdoc: true
|
82
|
-
homepage: http://github.com/rkh/sinatra-config-file
|
30
|
+
files: []
|
31
|
+
homepage: http://github.com/sinatra/sinatra-contrib
|
83
32
|
licenses: []
|
84
|
-
|
85
33
|
post_install_message:
|
86
34
|
rdoc_options: []
|
87
|
-
|
88
|
-
require_paths:
|
35
|
+
require_paths:
|
89
36
|
- lib
|
90
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
37
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
91
38
|
none: false
|
92
|
-
requirements:
|
93
|
-
- -
|
94
|
-
- !ruby/object:Gem::Version
|
95
|
-
|
96
|
-
|
97
|
-
- 0
|
98
|
-
version: "0"
|
99
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
39
|
+
requirements:
|
40
|
+
- - ! '>='
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: '0'
|
43
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
100
44
|
none: false
|
101
|
-
requirements:
|
102
|
-
- -
|
103
|
-
- !ruby/object:Gem::Version
|
104
|
-
|
105
|
-
segments:
|
106
|
-
- 0
|
107
|
-
version: "0"
|
45
|
+
requirements:
|
46
|
+
- - ! '>='
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: '0'
|
108
49
|
requirements: []
|
109
|
-
|
110
50
|
rubyforge_project:
|
111
|
-
rubygems_version: 1.
|
51
|
+
rubygems_version: 1.8.10
|
112
52
|
signing_key:
|
113
53
|
specification_version: 3
|
114
|
-
summary:
|
54
|
+
summary: Dummy gem, sinatra-config-file is now part of sinatra-contrib.
|
115
55
|
test_files: []
|
116
|
-
|
data/LICENSE
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
copyright (c) 2010 Konstantin Haase. All rights reserved.
|
2
|
-
|
3
|
-
Developed by: Konstantin Haase
|
4
|
-
http://github.com/rkh/big_band
|
5
|
-
|
6
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
|
-
of this software and associated documentation files (the "Software"), to
|
8
|
-
deal with the Software without restriction, including without limitation the
|
9
|
-
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
10
|
-
sell copies of the Software, and to permit persons to whom the Software is
|
11
|
-
furnished to do so, subject to the following conditions:
|
12
|
-
1. Redistributions of source code must retain the above copyright notice,
|
13
|
-
this list of conditions and the following disclaimers.
|
14
|
-
2. Redistributions in binary form must reproduce the above copyright
|
15
|
-
notice, this list of conditions and the following disclaimers in the
|
16
|
-
documentation and/or other materials provided with the distribution.
|
17
|
-
3. Neither the name of Konstantin Haase, nor the names of other contributors
|
18
|
-
may be used to endorse or promote products derived from this Software without
|
19
|
-
specific prior written permission.
|
20
|
-
|
21
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
22
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
23
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
24
|
-
CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
25
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
26
|
-
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
27
|
-
WITH THE SOFTWARE.
|
data/README.md
DELETED
@@ -1,41 +0,0 @@
|
|
1
|
-
Sinatra::ConfigFile
|
2
|
-
===================
|
3
|
-
|
4
|
-
Adds YAML config file support to [Sinatra](http://sinatrarb.com).
|
5
|
-
|
6
|
-
Config files are expected to represent hashes. When parsing such a config file it will use set to store that value,
|
7
|
-
ignoring those directly defined in the app (not those defined by the class it inherits from, i.e. Sinatra::Base).
|
8
|
-
|
9
|
-
|
10
|
-
Installation
|
11
|
-
------------
|
12
|
-
|
13
|
-
gem install sinatra-config-file
|
14
|
-
|
15
|
-
Example
|
16
|
-
-------
|
17
|
-
|
18
|
-
require "sinatra"
|
19
|
-
require "sinatra/config_file"
|
20
|
-
|
21
|
-
configure do
|
22
|
-
set :foo, "bar"
|
23
|
-
config_file "settings.yml" # general settings
|
24
|
-
config_file "#{environment}.settings.yml" # environment specific settings
|
25
|
-
foo # => "bar" (no matter what you put in your config file)
|
26
|
-
end
|
27
|
-
|
28
|
-
Now you could write in your settings.yml:
|
29
|
-
|
30
|
-
---
|
31
|
-
server: [thin, webrick] # use only thin or webrick for #run!
|
32
|
-
public: /var/www # load public files from /var/www
|
33
|
-
port: 8080 # run on port 8080
|
34
|
-
foo: baz
|
35
|
-
database:
|
36
|
-
adapter: sqlite
|
37
|
-
|
38
|
-
In you development.settings.yml:
|
39
|
-
|
40
|
-
database:
|
41
|
-
db_file: development.db
|
data/lib/sinatra/config_file.rb
DELETED
@@ -1,32 +0,0 @@
|
|
1
|
-
require 'sinatra/base'
|
2
|
-
|
3
|
-
module Sinatra
|
4
|
-
module ConfigFile
|
5
|
-
unless defined? Parser
|
6
|
-
begin
|
7
|
-
require "psych"
|
8
|
-
Parser = Psych
|
9
|
-
rescue LoadError
|
10
|
-
require "yaml"
|
11
|
-
Parser = YAML
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
def config_file(*paths)
|
16
|
-
Dir.chdir root do
|
17
|
-
paths.each do |pattern|
|
18
|
-
files = Dir.glob pattern
|
19
|
-
files.each do |file|
|
20
|
-
yaml = Parser.load_file(file) || {}
|
21
|
-
yaml.each_pair do |key, value|
|
22
|
-
set key, value unless methods(false).any? { |m| m.to_s == key.to_s }
|
23
|
-
end
|
24
|
-
end
|
25
|
-
warn "WARNING: could not load config file #{pattern}" if files.empty?
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
register ConfigFile
|
32
|
-
end
|