Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

cleanup

  • Loading branch information...
commit a5fab0afedd4f7f4e6ea7282fdf7ca5fdf166018 1 parent 5bf39cd
@rkh authored
View
27 LICENSE
@@ -1,27 +0,0 @@
-copyright (c) 2010 Konstantin Haase. All rights reserved.
-
-Developed by: Konstantin Haase
- http://github.com/rkh/big_band
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to
-deal with the Software without restriction, including without limitation the
-rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-sell copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimers.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimers in the
- documentation and/or other materials provided with the distribution.
- 3. Neither the name of Konstantin Haase, nor the names of other contributors
- may be used to endorse or promote products derived from this Software without
- specific prior written permission.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-WITH THE SOFTWARE.
View
42 README.md
@@ -1,41 +1 @@
-Sinatra::ConfigFile
-===================
-
-Adds YAML config file support to [Sinatra](http://sinatrarb.com).
-
-Config files are expected to represent hashes. When parsing such a config file it will use set to store that value,
-ignoring those directly defined in the app (not those defined by the class it inherits from, i.e. Sinatra::Base).
-
-
-Installation
-------------
-
- gem install sinatra-config-file
-
-Example
--------
-
- require "sinatra"
- require "sinatra/config_file"
-
- configure do |c|
- set :foo, "bar"
- config_file "settings.yml" # general settings
- config_file "#{c.environment}.settings.yml" # environment specific settings
- foo # => "bar" (no matter what you put in your config file)
- end
-
-Now you could write in your settings.yml:
-
- ---
- server: [thin, webrick] # use only thin or webrick for #run!
- public: /var/www # load public files from /var/www
- port: 8080 # run on port 8080
- foo: baz
- database:
- adapter: sqlite
-
-In you development.settings.yml:
-
- database:
- db_file: development.db
+This project is now part of [sinatra-contrib](https://github.com/sinatra/sinatra-contrib/).
View
32 lib/sinatra/config_file.rb
@@ -1,32 +0,0 @@
-require 'sinatra/base'
-
-module Sinatra
- module ConfigFile
- unless defined? Parser
- begin
- require "psych"
- Parser = Psych
- rescue LoadError
- require "yaml"
- Parser = YAML
- end
- end
-
- def config_file(*paths)
- Dir.chdir root do
- paths.each do |pattern|
- files = Dir.glob pattern
- files.each do |file|
- yaml = Parser.load_file(file) || {}
- yaml.each_pair do |key, value|
- set key, value unless methods(false).any? { |m| m.to_s == key.to_s }
- end
- end
- warn "WARNING: could not load config file #{pattern}" if files.empty?
- end
- end
- end
- end
-
- register ConfigFile
-end
View
19 sinatra-config-file.gemspec
@@ -1,19 +0,0 @@
-SPEC = Gem::Specification.new do |s|
- # Get the facts.
- s.name = "sinatra-config-file"
- s.version = "0.6.1"
- s.description = "Load Sinatra settings from a yaml file."
-
- # External dependencies
- s.add_dependency "sinatra", "~> 1.0"
- s.add_development_dependency "rspec", ">= 1.3.0"
- s.add_development_dependency "sinatra-test-helper", "~> 0.5.0"
-
- s.authors = ["Konstantin Haase", "Dmitry A. Ustalov"]
- s.email = "konstantin.mailinglists@googlemail.com"
- s.files = Dir["**/*.{rb,md}"] << "LICENSE"
- s.has_rdoc = 'yard'
- s.homepage = "http://github.com/rkh/#{s.name}"
- s.require_paths = ["lib"]
- s.summary = s.description
-end
Please sign in to comment.
Something went wrong with that request. Please try again.