dependency_injection-sinatra 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: bed0b9a50f3eaea2de3a0cf5147c2b6195ca8247
4
+ data.tar.gz: f832fdc9b9be2a34089e29bc34f23bd3bb71c2fb
5
+ SHA512:
6
+ metadata.gz: abc06a4d0de3d3eb10889fecdb31767dff813b9c6b608b37e7c34c79b1bcee2c1895db2cb36f166a976102367fe403b49b4ea91c2827fd7b363f03ee05604183
7
+ data.tar.gz: fe630cfebbd6836ec66108b8b230f769ff6648e7715e3fe08f4c3dc11e285e18000d2eac0794abf3c3af210c2b551da77e245f2963b163ad45dcdb7c0b13c2b6
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,39 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ dependency_injection-sinatra (0.1.0)
5
+ dependency_injection (~> 0.4.1)
6
+ sinatra
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ activesupport (4.0.3)
12
+ i18n (~> 0.6, >= 0.6.4)
13
+ minitest (~> 4.2)
14
+ multi_json (~> 1.3)
15
+ thread_safe (~> 0.1)
16
+ tzinfo (~> 0.3.37)
17
+ atomic (1.1.14)
18
+ dependency_injection (0.4.1)
19
+ activesupport
20
+ i18n (0.6.9)
21
+ minitest (4.7.5)
22
+ multi_json (1.8.4)
23
+ rack (1.5.2)
24
+ rack-protection (1.5.2)
25
+ rack
26
+ sinatra (1.4.4)
27
+ rack (~> 1.4)
28
+ rack-protection (~> 1.4)
29
+ tilt (~> 1.3, >= 1.3.4)
30
+ thread_safe (0.1.3)
31
+ atomic
32
+ tilt (1.4.1)
33
+ tzinfo (0.3.38)
34
+
35
+ PLATFORMS
36
+ ruby
37
+
38
+ DEPENDENCIES
39
+ dependency_injection-sinatra!
@@ -0,0 +1,19 @@
1
+ $LOAD_PATH.unshift(File.expand_path('../lib', __FILE__))
2
+ require 'sinatra/dependency_injection/version'
3
+
4
+ Gem::Specification.new do |spec|
5
+ spec.name = 'dependency_injection-sinatra'
6
+ spec.version = Sinatra::DependencyInjection::VERSION
7
+ spec.summary = 'Dependency Injection system for Sinatra'
8
+ spec.description = 'A Sinatra wrapper for a fully customizable Dependency injection system'
9
+ spec.homepage = 'https://github.com/kdisneur/dependency_injection-sinatra'
10
+ spec.license = 'MIT'
11
+ spec.authors = ['Kevin Disneur']
12
+ spec.email = 'kevin@koboyz.org'
13
+ spec.files = `git ls-files`.split($/)
14
+ spec.require_paths = %w(lib)
15
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
16
+
17
+ spec.add_dependency('sinatra')
18
+ spec.add_dependency('dependency_injection', '~> 0.4.1')
19
+ end
@@ -0,0 +1,18 @@
1
+ require 'sinatra/base'
2
+ require 'sinatra/dependency_injection/helper'
3
+
4
+ module Sinatra
5
+ module DependencyInjection
6
+ def self.registered(base)
7
+ base.dependency_injection_path 'services.yml'
8
+ end
9
+
10
+ def dependency_injection_path(file_path=nil)
11
+ @dependency_injection_path = file_path if file_path
12
+ @dependency_injection_path
13
+ end
14
+ end
15
+
16
+ register Sinatra::DependencyInjection
17
+ Delegator.delegate :dependency_injection_path
18
+ end
@@ -0,0 +1,21 @@
1
+ require 'sinatra/base'
2
+ require 'dependency_injection/container'
3
+ require 'dependency_injection/loaders/yaml'
4
+
5
+ module Sinatra
6
+ module DependencyInjection
7
+ module Helper
8
+ def container
9
+ @dependency_injection_container if @dependency_injection_container
10
+
11
+ @dependency_injection_container = ::DependencyInjection::Container.new
12
+ loader = ::DependencyInjection::Loaders::Yaml.new(@dependency_injection_container)
13
+ loader.load(settings.dependency_injection_path)
14
+
15
+ @dependency_injection_container
16
+ end
17
+ end
18
+ end
19
+
20
+ Base.helpers DependencyInjection::Helper
21
+ end
@@ -0,0 +1,5 @@
1
+ module Sinatra
2
+ module DependencyInjection
3
+ VERSION = '0.1.0'
4
+ end
5
+ end
metadata ADDED
@@ -0,0 +1,77 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: dependency_injection-sinatra
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Kevin Disneur
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-02-24 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: sinatra
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '>='
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: dependency_injection
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: 0.4.1
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: 0.4.1
41
+ description: A Sinatra wrapper for a fully customizable Dependency injection system
42
+ email: kevin@koboyz.org
43
+ executables: []
44
+ extensions: []
45
+ extra_rdoc_files: []
46
+ files:
47
+ - Gemfile
48
+ - Gemfile.lock
49
+ - dependency_injection-sinatra.gemspec
50
+ - lib/sinatra/dependency_injection.rb
51
+ - lib/sinatra/dependency_injection/helper.rb
52
+ - lib/sinatra/dependency_injection/version.rb
53
+ homepage: https://github.com/kdisneur/dependency_injection-sinatra
54
+ licenses:
55
+ - MIT
56
+ metadata: {}
57
+ post_install_message:
58
+ rdoc_options: []
59
+ require_paths:
60
+ - lib
61
+ required_ruby_version: !ruby/object:Gem::Requirement
62
+ requirements:
63
+ - - '>='
64
+ - !ruby/object:Gem::Version
65
+ version: '0'
66
+ required_rubygems_version: !ruby/object:Gem::Requirement
67
+ requirements:
68
+ - - '>='
69
+ - !ruby/object:Gem::Version
70
+ version: '0'
71
+ requirements: []
72
+ rubyforge_project:
73
+ rubygems_version: 2.0.14
74
+ signing_key:
75
+ specification_version: 4
76
+ summary: Dependency Injection system for Sinatra
77
+ test_files: []