sinatra-mongo 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/lib/sinatra/mongo.rb +1 -0
- data/sinatra-mongo.gemspec +109 -0
- metadata +3 -2
data/Rakefile
CHANGED
@@ -10,7 +10,7 @@ begin
|
|
10
10
|
gem.email = "josh@technicalpickles.com"
|
11
11
|
gem.homepage = "http://github.com/technicalpickles/sinatra-mongo"
|
12
12
|
gem.authors = ["Joshua Nichols"]
|
13
|
-
gem.version = "0.0.
|
13
|
+
gem.version = "0.0.2"
|
14
14
|
gem.add_development_dependency "rspec", ">= 1.2.9"
|
15
15
|
gem.add_dependency "mongo"
|
16
16
|
gem.add_dependency 'sinatra', '>= 0.9.4'
|
data/lib/sinatra/mongo.rb
CHANGED
@@ -0,0 +1,109 @@
|
|
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-mongo}
|
8
|
+
s.version = "0.0.2"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Joshua Nichols"]
|
12
|
+
s.date = %q{2009-12-10}
|
13
|
+
s.description = %q{= sinatra-mongo
|
14
|
+
|
15
|
+
Extends Sinatra with an extension method for dealing with monogodb using the ruby driver.
|
16
|
+
|
17
|
+
|
18
|
+
Install it with gem:
|
19
|
+
|
20
|
+
$ gem install sinatra-mongo
|
21
|
+
|
22
|
+
Now we can use it an example application.
|
23
|
+
|
24
|
+
require 'sinatra'
|
25
|
+
require 'sinatra/mongo'
|
26
|
+
|
27
|
+
# Specify the database to use. Defaults to mongo://localhost:27017/default,
|
28
|
+
# so you will almost definitely want to change this.
|
29
|
+
#
|
30
|
+
# Alternatively, you can specify the MONGO_URL as an environment variable
|
31
|
+
set :mongo, 'mongo://localhost:27017/sinatra-mongo-example'
|
32
|
+
|
33
|
+
# At this point, you can access the Mongo::Database object using the 'mongo' helper:
|
34
|
+
|
35
|
+
puts mongo["testCollection"].insert {"name" => "MongoDB", "type" => "database", "count" => 1, "info" => {"x" => 203, "y" => '102'}}
|
36
|
+
|
37
|
+
get '/' do
|
38
|
+
mongo["testCollection"].find_one
|
39
|
+
end
|
40
|
+
|
41
|
+
If you need to use authentication, you can specify this in the mongo uri:
|
42
|
+
|
43
|
+
set :mongo, 'mongo://myuser:mypass@localhost:27017/sinatra-mongo-example'
|
44
|
+
|
45
|
+
== Mongo Reference
|
46
|
+
|
47
|
+
* http://www.mongodb.org/display/DOCS/Ruby+Tutorial
|
48
|
+
|
49
|
+
== Note on Patches/Pull Requests
|
50
|
+
|
51
|
+
* Fork the project.
|
52
|
+
* Make your feature addition or bug fix.
|
53
|
+
* Add tests for it. This is important so I don't break it in a
|
54
|
+
future version unintentionally.
|
55
|
+
* Commit, do not mess with rakefile, version, or history.
|
56
|
+
(if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
|
57
|
+
* Send me a pull request. Bonus points for topic branches.
|
58
|
+
|
59
|
+
== Copyright
|
60
|
+
|
61
|
+
Copyright (c) 2009 Joshua Nichols. See LICENSE for details.
|
62
|
+
}
|
63
|
+
s.email = %q{josh@technicalpickles.com}
|
64
|
+
s.extra_rdoc_files = [
|
65
|
+
"LICENSE",
|
66
|
+
"README.rdoc"
|
67
|
+
]
|
68
|
+
s.files = [
|
69
|
+
".document",
|
70
|
+
".gitignore",
|
71
|
+
"LICENSE",
|
72
|
+
"README.rdoc",
|
73
|
+
"Rakefile",
|
74
|
+
"lib/sinatra/mongo.rb",
|
75
|
+
"sinatra-mongo.gemspec",
|
76
|
+
"spec/sinatra-mongo_spec.rb",
|
77
|
+
"spec/spec.opts",
|
78
|
+
"spec/spec_helper.rb"
|
79
|
+
]
|
80
|
+
s.homepage = %q{http://github.com/technicalpickles/sinatra-mongo}
|
81
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
82
|
+
s.require_paths = ["lib"]
|
83
|
+
s.rubygems_version = %q{1.3.5}
|
84
|
+
s.summary = %q{A light extension to sinatra for using mongo}
|
85
|
+
s.test_files = [
|
86
|
+
"spec/sinatra-mongo_spec.rb",
|
87
|
+
"spec/spec_helper.rb"
|
88
|
+
]
|
89
|
+
|
90
|
+
if s.respond_to? :specification_version then
|
91
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
92
|
+
s.specification_version = 3
|
93
|
+
|
94
|
+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
95
|
+
s.add_development_dependency(%q<rspec>, [">= 1.2.9"])
|
96
|
+
s.add_runtime_dependency(%q<mongo>, [">= 0"])
|
97
|
+
s.add_runtime_dependency(%q<sinatra>, [">= 0.9.4"])
|
98
|
+
else
|
99
|
+
s.add_dependency(%q<rspec>, [">= 1.2.9"])
|
100
|
+
s.add_dependency(%q<mongo>, [">= 0"])
|
101
|
+
s.add_dependency(%q<sinatra>, [">= 0.9.4"])
|
102
|
+
end
|
103
|
+
else
|
104
|
+
s.add_dependency(%q<rspec>, [">= 1.2.9"])
|
105
|
+
s.add_dependency(%q<mongo>, [">= 0"])
|
106
|
+
s.add_dependency(%q<sinatra>, [">= 0.9.4"])
|
107
|
+
end
|
108
|
+
end
|
109
|
+
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sinatra-mongo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joshua Nichols
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-12-
|
12
|
+
date: 2009-12-10 00:00:00 -05:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -108,6 +108,7 @@ files:
|
|
108
108
|
- README.rdoc
|
109
109
|
- Rakefile
|
110
110
|
- lib/sinatra/mongo.rb
|
111
|
+
- sinatra-mongo.gemspec
|
111
112
|
- spec/sinatra-mongo_spec.rb
|
112
113
|
- spec/spec.opts
|
113
114
|
- spec/spec_helper.rb
|