dependor-sinatra 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +20 -0
- data/Gemfile +4 -0
- data/Guardfile +14 -0
- data/LICENSE.md +9 -0
- data/LICENSE.txt +22 -0
- data/README.md +104 -0
- data/Rakefile +1 -0
- data/dependor-sinatra.gemspec +32 -0
- data/examples/hello.rb +17 -0
- data/lib/dependor-sinatra.rb +10 -0
- data/lib/dependor-sinatra/block_wrapper.rb +13 -0
- data/lib/dependor-sinatra/default_injector.rb +12 -0
- data/lib/dependor-sinatra/enabler.rb +19 -0
- data/lib/dependor-sinatra/has_injector.rb +25 -0
- data/lib/dependor-sinatra/monkey_patches.rb +9 -0
- data/lib/dependor-sinatra/objects.rb +15 -0
- data/lib/dependor-sinatra/version.rb +5 -0
- data/spec/integration/before_and_after_filters_spec.rb +47 -0
- data/spec/integration/conditions_spec.rb +44 -0
- data/spec/integration/custom_injector_spec.rb +25 -0
- data/spec/integration/injecting_sinatra_provided_data_spec.rb +27 -0
- data/spec/spec_helper.rb +8 -0
- metadata +254 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/Guardfile
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
# A sample Guardfile
|
2
|
+
# More info at https://github.com/guard/guard#readme
|
3
|
+
|
4
|
+
guard 'ctags-bundler', :src_path => ["lib", "spec"] do
|
5
|
+
watch(/^(lib|spec)\/.*\.rb$/)
|
6
|
+
watch('Gemfile.lock')
|
7
|
+
end
|
8
|
+
|
9
|
+
guard 'rspec' do
|
10
|
+
watch(%r{^spec/.+_spec\.rb$})
|
11
|
+
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
|
12
|
+
watch('spec/spec_helper.rb') { "spec" }
|
13
|
+
end
|
14
|
+
|
data/LICENSE.md
ADDED
@@ -0,0 +1,9 @@
|
|
1
|
+
# The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2012-2013 Adam Pohorecki
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in 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:
|
6
|
+
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
8
|
+
|
9
|
+
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 AUTHORS 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 IN THE SOFTWARE.
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2013 Adam Pohorecki
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,104 @@
|
|
1
|
+
# dependor-sinatra
|
2
|
+
|
3
|
+
This gem provides integration between [Dependor][dependor] and [Sinatra][sinatra].
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
gem 'dependor-sinatra'
|
10
|
+
|
11
|
+
And then execute:
|
12
|
+
|
13
|
+
$ bundle
|
14
|
+
|
15
|
+
Or install it yourself as:
|
16
|
+
|
17
|
+
$ gem install dependor-sinatra
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
Require dependor-sinatra:
|
22
|
+
|
23
|
+
require 'dependor-sinatra'
|
24
|
+
|
25
|
+
and (optionally), the shortcut notation for defining constructors:
|
26
|
+
|
27
|
+
require 'dependor/shorty'
|
28
|
+
|
29
|
+
This teaches Sinatra to inject dependencies into your actions:
|
30
|
+
|
31
|
+
```ruby
|
32
|
+
class Greeter
|
33
|
+
takes :params
|
34
|
+
|
35
|
+
def greet
|
36
|
+
"Hello, #{params[:name]}!"
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
get "/hello/:name" do |greeter|
|
41
|
+
greeter.greet
|
42
|
+
end
|
43
|
+
```
|
44
|
+
|
45
|
+
You can specify your own injector:
|
46
|
+
|
47
|
+
```ruby
|
48
|
+
# this is exacly how the default injector class (Dependor::Sinatra::DefaultInjector)
|
49
|
+
# looks like
|
50
|
+
class MyInjector
|
51
|
+
include Dependor::AutoInject
|
52
|
+
include Dependor::Sinatra::Objects
|
53
|
+
|
54
|
+
def initialize(objects)
|
55
|
+
sinatra_objects(objects)
|
56
|
+
end
|
57
|
+
|
58
|
+
# define anything you want here
|
59
|
+
def user_db
|
60
|
+
User
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
injector{ |objects| MyInjector.new(objects) }
|
65
|
+
|
66
|
+
get "/" do |user_db|
|
67
|
+
@users = user_db.all
|
68
|
+
end
|
69
|
+
```
|
70
|
+
|
71
|
+
You can dependency injection in the following Sinatra elements:
|
72
|
+
|
73
|
+
- routes (`get`, `post`, `put`, etc.)
|
74
|
+
- filters (`before`, `after`)
|
75
|
+
- conditions (`condition`)
|
76
|
+
|
77
|
+
By default, you can inject the following objects from Sinatra:
|
78
|
+
|
79
|
+
- params
|
80
|
+
- session
|
81
|
+
- request
|
82
|
+
- response
|
83
|
+
- env
|
84
|
+
|
85
|
+
You can read more about Dependor [here][dependor].
|
86
|
+
|
87
|
+
## Contributing
|
88
|
+
|
89
|
+
1. Fork it
|
90
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
91
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
92
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
93
|
+
5. Create new Pull Request
|
94
|
+
|
95
|
+
## License
|
96
|
+
|
97
|
+
MIT
|
98
|
+
|
99
|
+
## Author
|
100
|
+
|
101
|
+
Adam Pohorecki (adam [at] pohorecki [dot] pl)
|
102
|
+
|
103
|
+
[dependor]: https://github.com/psyho/dependor
|
104
|
+
[sinatra]: http://sinatrarb.com
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'dependor-sinatra/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |gem|
|
7
|
+
gem.name = "dependor-sinatra"
|
8
|
+
gem.version = Dependor::Sinatra::VERSION
|
9
|
+
gem.authors = ["Adam Pohorecki"]
|
10
|
+
gem.email = ["adam@pohorecki.pl"]
|
11
|
+
gem.description = %q{An extension to Sinatra enabling dependency injection}
|
12
|
+
gem.summary = %q{An extension to Sinatra enabling dependency injection}
|
13
|
+
gem.homepage = "https://github.com/psyho/dependor-sinatra"
|
14
|
+
|
15
|
+
gem.files = `git ls-files`.split($/)
|
16
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
17
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
18
|
+
gem.require_paths = ["lib"]
|
19
|
+
|
20
|
+
gem.add_dependency 'dependor'
|
21
|
+
gem.add_dependency 'sinatra'
|
22
|
+
|
23
|
+
gem.add_development_dependency 'rake'
|
24
|
+
gem.add_development_dependency 'rspec'
|
25
|
+
gem.add_development_dependency 'guard'
|
26
|
+
gem.add_development_dependency 'guard-rspec'
|
27
|
+
gem.add_development_dependency 'guard-ctags-bundler'
|
28
|
+
gem.add_development_dependency 'growl'
|
29
|
+
gem.add_development_dependency 'rb-inotify', '~> 0.8.8'
|
30
|
+
gem.add_development_dependency 'relish'
|
31
|
+
gem.add_development_dependency 'rack-test'
|
32
|
+
end
|
data/examples/hello.rb
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "sinatra"
|
4
|
+
require "dependor-sinatra"
|
5
|
+
require "dependor/shorty"
|
6
|
+
|
7
|
+
class Greeter
|
8
|
+
takes :params
|
9
|
+
|
10
|
+
def greet
|
11
|
+
"Hello, #{params[:name]}!"
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
get "/hello/:name" do |greeter|
|
16
|
+
greeter.greet
|
17
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
require "sinatra"
|
2
|
+
require "dependor"
|
3
|
+
|
4
|
+
require "dependor-sinatra/block_wrapper"
|
5
|
+
require "dependor-sinatra/enabler"
|
6
|
+
require "dependor-sinatra/has_injector"
|
7
|
+
require "dependor-sinatra/objects"
|
8
|
+
require "dependor-sinatra/version"
|
9
|
+
require "dependor-sinatra/default_injector"
|
10
|
+
require "dependor-sinatra/monkey_patches"
|
@@ -0,0 +1,13 @@
|
|
1
|
+
module Dependor
|
2
|
+
module Sinatra
|
3
|
+
module BlockWrapper
|
4
|
+
def self.wrap(block)
|
5
|
+
proc do
|
6
|
+
dependency_names = block.parameters.map(&:last)
|
7
|
+
dependencies = dependency_names.map{|name| injector.__send__(name)}
|
8
|
+
instance_exec(*dependencies, &block)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module Dependor
|
2
|
+
module Sinatra
|
3
|
+
module Enabler
|
4
|
+
def enable_dependor(method)
|
5
|
+
without_dependor = :"#{method}_without_dependor"
|
6
|
+
|
7
|
+
# the only way to alias a private method
|
8
|
+
instance_eval("alias #{without_dependor} #{method}")
|
9
|
+
|
10
|
+
define_singleton_method(method) do |*args, &block|
|
11
|
+
wrapped_block = Dependor::Sinatra::BlockWrapper.wrap(block)
|
12
|
+
__send__(without_dependor, *args) do
|
13
|
+
instance_eval(&wrapped_block)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module Dependor
|
2
|
+
module Sinatra
|
3
|
+
module HasInjector
|
4
|
+
def self.included(klass)
|
5
|
+
klass.extend ClassMethods
|
6
|
+
end
|
7
|
+
|
8
|
+
def injector
|
9
|
+
@injector ||= self.class.injector_creator.call(self)
|
10
|
+
end
|
11
|
+
|
12
|
+
module ClassMethods
|
13
|
+
attr_writer :injector_creator
|
14
|
+
|
15
|
+
def injector_creator
|
16
|
+
@injector_creator ||= proc{ |objects| Dependor::Sinatra::DefaultInjector.new(objects) }
|
17
|
+
end
|
18
|
+
|
19
|
+
def injector(&block)
|
20
|
+
self.injector_creator = block
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module Dependor
|
2
|
+
module Sinatra
|
3
|
+
module Objects
|
4
|
+
attr_reader :params, :env, :request, :response, :session
|
5
|
+
|
6
|
+
def sinatra_objects(objects)
|
7
|
+
@params = objects.params
|
8
|
+
@env = objects.env
|
9
|
+
@request = objects.request
|
10
|
+
@response = objects.response
|
11
|
+
@session = objects.session
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
class SetsCurrentUser
|
4
|
+
takes :params
|
5
|
+
|
6
|
+
def set(name)
|
7
|
+
params[:current_user] = name
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
class AppWithFilters < Sinatra::Base
|
12
|
+
set :environment, :test
|
13
|
+
|
14
|
+
before "/hello" do |sets_current_user|
|
15
|
+
sets_current_user.set("John")
|
16
|
+
end
|
17
|
+
|
18
|
+
after "/bye" do |sets_current_user|
|
19
|
+
sets_current_user.set("Betty")
|
20
|
+
body "After bye, #{params[:current_user]}"
|
21
|
+
end
|
22
|
+
|
23
|
+
get "/hello" do
|
24
|
+
body "Hello, #{params[:current_user]}"
|
25
|
+
end
|
26
|
+
|
27
|
+
get "/bye" do
|
28
|
+
body "Bye"
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
describe "Before and after filters" do
|
33
|
+
let(:app) { AppWithFilters }
|
34
|
+
|
35
|
+
it "injects dependencies into before filters" do
|
36
|
+
|
37
|
+
get "/hello"
|
38
|
+
|
39
|
+
last_response.body.should == "Hello, John"
|
40
|
+
end
|
41
|
+
|
42
|
+
it "injects dependencies into after filters" do
|
43
|
+
get "/bye"
|
44
|
+
|
45
|
+
last_response.body.should == "After bye, Betty"
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
class ChecksIfAdmin
|
4
|
+
takes :session
|
5
|
+
|
6
|
+
def admin?
|
7
|
+
!!session[:admin]
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
class AppWithConditions < Sinatra::Base
|
12
|
+
set(:admin_user) do |is_admin|
|
13
|
+
condition do |checks_if_admin|
|
14
|
+
checks_if_admin.admin? == is_admin
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
set :environment, :test
|
19
|
+
enable :sessions
|
20
|
+
|
21
|
+
post "/login" do
|
22
|
+
session[:admin] = true
|
23
|
+
"Hello!"
|
24
|
+
end
|
25
|
+
|
26
|
+
get "/admin", admin_user: true do
|
27
|
+
"Hello admin"
|
28
|
+
end
|
29
|
+
|
30
|
+
get "/admin", admin_user: false do
|
31
|
+
"Bye intruder"
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
describe "conditions" do
|
36
|
+
let(:app) { AppWithConditions }
|
37
|
+
|
38
|
+
it "injects objects into the conditions" do
|
39
|
+
post "/login"
|
40
|
+
get "/admin"
|
41
|
+
|
42
|
+
last_response.body.should == "Hello admin"
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
class AppWithCustomInjector < Sinatra::Base
|
4
|
+
injector{ |o| MyCustomInjector.new(o) }
|
5
|
+
|
6
|
+
get "/hello" do |current_user|
|
7
|
+
"Hello, #{current_user}!"
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
class MyCustomInjector < Dependor::Sinatra::DefaultInjector
|
12
|
+
def current_user
|
13
|
+
"John"
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
describe "providing a custom injector" do
|
18
|
+
let(:app) { AppWithCustomInjector }
|
19
|
+
|
20
|
+
it "injects objects from the injector" do
|
21
|
+
get "/hello"
|
22
|
+
|
23
|
+
last_response.body.should == "Hello, John!"
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe "Injecting Sinatra provided data" do
|
4
|
+
class Greeter
|
5
|
+
takes :params
|
6
|
+
|
7
|
+
def greet
|
8
|
+
"Hello, #{params[:name]}!"
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
class SinatraAppWithDependor < Sinatra::Base
|
13
|
+
set :environment, :test
|
14
|
+
|
15
|
+
get "/hello/:name" do |greeter|
|
16
|
+
greeter.greet
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
let(:app) { SinatraAppWithDependor }
|
21
|
+
|
22
|
+
it "uses the injected objects to generate a response" do
|
23
|
+
get "/hello/foo"
|
24
|
+
|
25
|
+
last_response.body.should == "Hello, foo!"
|
26
|
+
end
|
27
|
+
end
|
data/spec/spec_helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,254 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: dependor-sinatra
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Adam Pohorecki
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2013-02-14 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: dependor
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: sinatra
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
type: :runtime
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: rake
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: rspec
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ! '>='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
70
|
+
type: :development
|
71
|
+
prerelease: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
78
|
+
- !ruby/object:Gem::Dependency
|
79
|
+
name: guard
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
82
|
+
requirements:
|
83
|
+
- - ! '>='
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: '0'
|
86
|
+
type: :development
|
87
|
+
prerelease: false
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ! '>='
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '0'
|
94
|
+
- !ruby/object:Gem::Dependency
|
95
|
+
name: guard-rspec
|
96
|
+
requirement: !ruby/object:Gem::Requirement
|
97
|
+
none: false
|
98
|
+
requirements:
|
99
|
+
- - ! '>='
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: '0'
|
102
|
+
type: :development
|
103
|
+
prerelease: false
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
106
|
+
requirements:
|
107
|
+
- - ! '>='
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '0'
|
110
|
+
- !ruby/object:Gem::Dependency
|
111
|
+
name: guard-ctags-bundler
|
112
|
+
requirement: !ruby/object:Gem::Requirement
|
113
|
+
none: false
|
114
|
+
requirements:
|
115
|
+
- - ! '>='
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
none: false
|
122
|
+
requirements:
|
123
|
+
- - ! '>='
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: '0'
|
126
|
+
- !ruby/object:Gem::Dependency
|
127
|
+
name: growl
|
128
|
+
requirement: !ruby/object:Gem::Requirement
|
129
|
+
none: false
|
130
|
+
requirements:
|
131
|
+
- - ! '>='
|
132
|
+
- !ruby/object:Gem::Version
|
133
|
+
version: '0'
|
134
|
+
type: :development
|
135
|
+
prerelease: false
|
136
|
+
version_requirements: !ruby/object:Gem::Requirement
|
137
|
+
none: false
|
138
|
+
requirements:
|
139
|
+
- - ! '>='
|
140
|
+
- !ruby/object:Gem::Version
|
141
|
+
version: '0'
|
142
|
+
- !ruby/object:Gem::Dependency
|
143
|
+
name: rb-inotify
|
144
|
+
requirement: !ruby/object:Gem::Requirement
|
145
|
+
none: false
|
146
|
+
requirements:
|
147
|
+
- - ~>
|
148
|
+
- !ruby/object:Gem::Version
|
149
|
+
version: 0.8.8
|
150
|
+
type: :development
|
151
|
+
prerelease: false
|
152
|
+
version_requirements: !ruby/object:Gem::Requirement
|
153
|
+
none: false
|
154
|
+
requirements:
|
155
|
+
- - ~>
|
156
|
+
- !ruby/object:Gem::Version
|
157
|
+
version: 0.8.8
|
158
|
+
- !ruby/object:Gem::Dependency
|
159
|
+
name: relish
|
160
|
+
requirement: !ruby/object:Gem::Requirement
|
161
|
+
none: false
|
162
|
+
requirements:
|
163
|
+
- - ! '>='
|
164
|
+
- !ruby/object:Gem::Version
|
165
|
+
version: '0'
|
166
|
+
type: :development
|
167
|
+
prerelease: false
|
168
|
+
version_requirements: !ruby/object:Gem::Requirement
|
169
|
+
none: false
|
170
|
+
requirements:
|
171
|
+
- - ! '>='
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: '0'
|
174
|
+
- !ruby/object:Gem::Dependency
|
175
|
+
name: rack-test
|
176
|
+
requirement: !ruby/object:Gem::Requirement
|
177
|
+
none: false
|
178
|
+
requirements:
|
179
|
+
- - ! '>='
|
180
|
+
- !ruby/object:Gem::Version
|
181
|
+
version: '0'
|
182
|
+
type: :development
|
183
|
+
prerelease: false
|
184
|
+
version_requirements: !ruby/object:Gem::Requirement
|
185
|
+
none: false
|
186
|
+
requirements:
|
187
|
+
- - ! '>='
|
188
|
+
- !ruby/object:Gem::Version
|
189
|
+
version: '0'
|
190
|
+
description: An extension to Sinatra enabling dependency injection
|
191
|
+
email:
|
192
|
+
- adam@pohorecki.pl
|
193
|
+
executables: []
|
194
|
+
extensions: []
|
195
|
+
extra_rdoc_files: []
|
196
|
+
files:
|
197
|
+
- .gitignore
|
198
|
+
- Gemfile
|
199
|
+
- Guardfile
|
200
|
+
- LICENSE.md
|
201
|
+
- LICENSE.txt
|
202
|
+
- README.md
|
203
|
+
- Rakefile
|
204
|
+
- dependor-sinatra.gemspec
|
205
|
+
- examples/hello.rb
|
206
|
+
- lib/dependor-sinatra.rb
|
207
|
+
- lib/dependor-sinatra/block_wrapper.rb
|
208
|
+
- lib/dependor-sinatra/default_injector.rb
|
209
|
+
- lib/dependor-sinatra/enabler.rb
|
210
|
+
- lib/dependor-sinatra/has_injector.rb
|
211
|
+
- lib/dependor-sinatra/monkey_patches.rb
|
212
|
+
- lib/dependor-sinatra/objects.rb
|
213
|
+
- lib/dependor-sinatra/version.rb
|
214
|
+
- spec/integration/before_and_after_filters_spec.rb
|
215
|
+
- spec/integration/conditions_spec.rb
|
216
|
+
- spec/integration/custom_injector_spec.rb
|
217
|
+
- spec/integration/injecting_sinatra_provided_data_spec.rb
|
218
|
+
- spec/spec_helper.rb
|
219
|
+
homepage: https://github.com/psyho/dependor-sinatra
|
220
|
+
licenses: []
|
221
|
+
post_install_message:
|
222
|
+
rdoc_options: []
|
223
|
+
require_paths:
|
224
|
+
- lib
|
225
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
226
|
+
none: false
|
227
|
+
requirements:
|
228
|
+
- - ! '>='
|
229
|
+
- !ruby/object:Gem::Version
|
230
|
+
version: '0'
|
231
|
+
segments:
|
232
|
+
- 0
|
233
|
+
hash: 206932367
|
234
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
235
|
+
none: false
|
236
|
+
requirements:
|
237
|
+
- - ! '>='
|
238
|
+
- !ruby/object:Gem::Version
|
239
|
+
version: '0'
|
240
|
+
segments:
|
241
|
+
- 0
|
242
|
+
hash: 206932367
|
243
|
+
requirements: []
|
244
|
+
rubyforge_project:
|
245
|
+
rubygems_version: 1.8.24
|
246
|
+
signing_key:
|
247
|
+
specification_version: 3
|
248
|
+
summary: An extension to Sinatra enabling dependency injection
|
249
|
+
test_files:
|
250
|
+
- spec/integration/before_and_after_filters_spec.rb
|
251
|
+
- spec/integration/conditions_spec.rb
|
252
|
+
- spec/integration/custom_injector_spec.rb
|
253
|
+
- spec/integration/injecting_sinatra_provided_data_spec.rb
|
254
|
+
- spec/spec_helper.rb
|