sinatra-mongoid 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +2 -0
- data/LICENSE +21 -0
- data/README.md +46 -0
- data/Rakefile +16 -0
- data/VERSION +1 -0
- data/lib/sinatra/mongoid.rb +22 -0
- data/sinatra-mongoid.gemspec +53 -0
- metadata +91 -0
data/.gitignore
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2010 Dan Croak
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,46 @@
|
|
1
|
+
Sinatra Mongoid
|
2
|
+
===============
|
3
|
+
|
4
|
+
A Mongoid extension for Sinatra.
|
5
|
+
|
6
|
+
Usage
|
7
|
+
-----
|
8
|
+
|
9
|
+
Install the gem:
|
10
|
+
|
11
|
+
sudo gem install sinatra-mongoid
|
12
|
+
|
13
|
+
Create your Sinatra app:
|
14
|
+
|
15
|
+
require 'rubygems'
|
16
|
+
require 'sinatra'
|
17
|
+
require 'sinatra/mongoid'
|
18
|
+
|
19
|
+
set :mongo_db, 'job-board'
|
20
|
+
|
21
|
+
configure :production do
|
22
|
+
set :mongo_host, 'db.mongohq.com'
|
23
|
+
end
|
24
|
+
|
25
|
+
Configuration
|
26
|
+
-------------
|
27
|
+
|
28
|
+
All Sinatra options you can set are:
|
29
|
+
|
30
|
+
:mongo_host
|
31
|
+
:mongo_db
|
32
|
+
:mongo_user
|
33
|
+
:mongo_password
|
34
|
+
|
35
|
+
Their default values are:
|
36
|
+
|
37
|
+
ENV['MONGO_HOST'] || 'localhost'
|
38
|
+
ENV['MONGO_DB']
|
39
|
+
ENV['MONGO_USER']
|
40
|
+
ENV['MONGO_PASSWORD']
|
41
|
+
|
42
|
+
Resources
|
43
|
+
---------
|
44
|
+
|
45
|
+
* [Mongoid](http://mongoid.org)
|
46
|
+
* [Sinatra](http://sinatrarb.com)
|
data/Rakefile
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'jeweler'
|
2
|
+
|
3
|
+
Jeweler::Tasks.new do |gem|
|
4
|
+
gem.name = "sinatra-mongoid"
|
5
|
+
gem.summary = "A Mongoid extension for Sinatra."
|
6
|
+
gem.description = "Like a blind date for the nastiest Ruby Mongo ORM and web framework."
|
7
|
+
gem.email = "dcroak@thoughtbot.com"
|
8
|
+
gem.homepage = "http://github.com/dancroak/sinatra-mongoid"
|
9
|
+
gem.authors = ["Dan Croak"]
|
10
|
+
|
11
|
+
gem.add_dependency("sinatra")
|
12
|
+
gem.add_dependency("mongoid")
|
13
|
+
gem.add_dependency("mongo_ext")
|
14
|
+
end
|
15
|
+
|
16
|
+
Jeweler::GemcutterTasks.new
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.0.1
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'sinatra/base'
|
2
|
+
require 'mongoid'
|
3
|
+
|
4
|
+
module Sinatra
|
5
|
+
module MongoidExtension
|
6
|
+
def self.registered(app)
|
7
|
+
app.set :mongo_host, ENV['MONGO_HOST'] || 'localhost'
|
8
|
+
app.set :mongo_db, ENV['MONGO_DB'] || 'changeme'
|
9
|
+
app.set :mongo_user, ENV['MONGO_USER']
|
10
|
+
app.set :mongo_password, ENV['MONGO_PASSWORD']
|
11
|
+
|
12
|
+
Mongoid.database = Mongo::Connection.new(app.mongo_host).
|
13
|
+
db(app.mongo_db)
|
14
|
+
if app.mongo_user
|
15
|
+
Mongoid.database.authenticate(app.mongo_user,
|
16
|
+
app.mongo_password)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
register MongoidExtension
|
22
|
+
end
|
@@ -0,0 +1,53 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{sinatra-mongoid}
|
8
|
+
s.version = "0.0.1"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Dan Croak"]
|
12
|
+
s.date = %q{2010-01-14}
|
13
|
+
s.description = %q{Like a blind date for the nastiest Ruby Mongo ORM and web framework.}
|
14
|
+
s.email = %q{dcroak@thoughtbot.com}
|
15
|
+
s.extra_rdoc_files = [
|
16
|
+
"LICENSE",
|
17
|
+
"README.md"
|
18
|
+
]
|
19
|
+
s.files = [
|
20
|
+
".gitignore",
|
21
|
+
"LICENSE",
|
22
|
+
"README.md",
|
23
|
+
"Rakefile",
|
24
|
+
"VERSION",
|
25
|
+
"lib/sinatra/mongoid.rb",
|
26
|
+
"sinatra-mongoid.gemspec"
|
27
|
+
]
|
28
|
+
s.homepage = %q{http://github.com/dancroak/sinatra-mongoid}
|
29
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
30
|
+
s.require_paths = ["lib"]
|
31
|
+
s.rubygems_version = %q{1.3.5}
|
32
|
+
s.summary = %q{A Mongoid extension for Sinatra.}
|
33
|
+
|
34
|
+
if s.respond_to? :specification_version then
|
35
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
36
|
+
s.specification_version = 3
|
37
|
+
|
38
|
+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
39
|
+
s.add_runtime_dependency(%q<sinatra>, [">= 0"])
|
40
|
+
s.add_runtime_dependency(%q<mongoid>, [">= 0"])
|
41
|
+
s.add_runtime_dependency(%q<mongo_ext>, [">= 0"])
|
42
|
+
else
|
43
|
+
s.add_dependency(%q<sinatra>, [">= 0"])
|
44
|
+
s.add_dependency(%q<mongoid>, [">= 0"])
|
45
|
+
s.add_dependency(%q<mongo_ext>, [">= 0"])
|
46
|
+
end
|
47
|
+
else
|
48
|
+
s.add_dependency(%q<sinatra>, [">= 0"])
|
49
|
+
s.add_dependency(%q<mongoid>, [">= 0"])
|
50
|
+
s.add_dependency(%q<mongo_ext>, [">= 0"])
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
metadata
ADDED
@@ -0,0 +1,91 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: sinatra-mongoid
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Dan Croak
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2010-01-14 00:00:00 -05:00
|
13
|
+
default_executable:
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: sinatra
|
17
|
+
type: :runtime
|
18
|
+
version_requirement:
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: "0"
|
24
|
+
version:
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: mongoid
|
27
|
+
type: :runtime
|
28
|
+
version_requirement:
|
29
|
+
version_requirements: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: "0"
|
34
|
+
version:
|
35
|
+
- !ruby/object:Gem::Dependency
|
36
|
+
name: mongo_ext
|
37
|
+
type: :runtime
|
38
|
+
version_requirement:
|
39
|
+
version_requirements: !ruby/object:Gem::Requirement
|
40
|
+
requirements:
|
41
|
+
- - ">="
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: "0"
|
44
|
+
version:
|
45
|
+
description: Like a blind date for the nastiest Ruby Mongo ORM and web framework.
|
46
|
+
email: dcroak@thoughtbot.com
|
47
|
+
executables: []
|
48
|
+
|
49
|
+
extensions: []
|
50
|
+
|
51
|
+
extra_rdoc_files:
|
52
|
+
- LICENSE
|
53
|
+
- README.md
|
54
|
+
files:
|
55
|
+
- .gitignore
|
56
|
+
- LICENSE
|
57
|
+
- README.md
|
58
|
+
- Rakefile
|
59
|
+
- VERSION
|
60
|
+
- lib/sinatra/mongoid.rb
|
61
|
+
- sinatra-mongoid.gemspec
|
62
|
+
has_rdoc: true
|
63
|
+
homepage: http://github.com/dancroak/sinatra-mongoid
|
64
|
+
licenses: []
|
65
|
+
|
66
|
+
post_install_message:
|
67
|
+
rdoc_options:
|
68
|
+
- --charset=UTF-8
|
69
|
+
require_paths:
|
70
|
+
- lib
|
71
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: "0"
|
76
|
+
version:
|
77
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - ">="
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: "0"
|
82
|
+
version:
|
83
|
+
requirements: []
|
84
|
+
|
85
|
+
rubyforge_project:
|
86
|
+
rubygems_version: 1.3.5
|
87
|
+
signing_key:
|
88
|
+
specification_version: 3
|
89
|
+
summary: A Mongoid extension for Sinatra.
|
90
|
+
test_files: []
|
91
|
+
|