initialize 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +9 -0
- data/Gemfile +3 -0
- data/LICENSE.txt +21 -0
- data/README.md +17 -0
- data/Rakefile +1 -0
- data/initialize.gemspec +19 -0
- data/lib/initialize.rb +2 -0
- data/lib/initialize/patch.rb +40 -0
- data/lib/initialize/version.rb +3 -0
- metadata +81 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 1cb57f683cd8289cf793b91b0598e0666fed7b5c
|
4
|
+
data.tar.gz: 327854f02a623893c0ce2dcbecc2f24ebcfbd587
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: c3e7f5057cdddc9433b596d53bbf7a638e172c401868daf4eda1985111b4bc958cacc8e49fa114feafc905c9a195ded94fc9900c3a466d8ac2c20d8cb472294e
|
7
|
+
data.tar.gz: c6f43588916b8dbcd0f1e24e3eee23271c5093048c43adeb7acaacc3f9adcbb602a961540b13e41be38766fbf2cf600e4424156958c9527f63fb5e96fb50d818
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2016 Luke Horvat
|
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,17 @@
|
|
1
|
+
# initialize [![Gem version](http://img.shields.io/gem/v/initialize.svg?style=flat-square)](http://rubygems.org/gems/initialize)
|
2
|
+
|
3
|
+
Ruby gem.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'initialize'
|
11
|
+
```
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
```bash
|
16
|
+
$ bundle install
|
17
|
+
```
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
data/initialize.gemspec
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'initialize/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "initialize"
|
8
|
+
spec.version = Initialize::VERSION
|
9
|
+
spec.authors = ["Luke Horvat"]
|
10
|
+
spec.email = ["lukehorvat@gmail.com"]
|
11
|
+
spec.summary = %q{Ruby gem.}
|
12
|
+
spec.description = %q{Ruby gem.}
|
13
|
+
spec.homepage = "https://github.com/lukehorvat/initialize"
|
14
|
+
spec.license = "MIT"
|
15
|
+
spec.files = `git ls-files -z`.split("\x0")
|
16
|
+
spec.require_paths = ["lib"]
|
17
|
+
spec.add_development_dependency "bundler", "~> 1.10"
|
18
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
19
|
+
end
|
data/lib/initialize.rb
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
module Initialize
|
2
|
+
module Patch
|
3
|
+
def run(*args)
|
4
|
+
if @name == :load_config_initializers
|
5
|
+
@block = lambda do |*args|
|
6
|
+
initializers_path = "config/initializers"
|
7
|
+
|
8
|
+
initializers = config.paths[initializers_path].existent.sort
|
9
|
+
|
10
|
+
initializer_dependencies = Hash[
|
11
|
+
config.initializer_dependencies.map do |initializer, dependencies|
|
12
|
+
[
|
13
|
+
"#{config.root}/#{initializers_path}/#{initializer}.rb",
|
14
|
+
dependencies.map do |dependency|
|
15
|
+
"#{config.root}/#{initializers_path}/#{dependency}.rb"
|
16
|
+
end
|
17
|
+
]
|
18
|
+
end
|
19
|
+
]
|
20
|
+
|
21
|
+
independent_initializers = initializers.select do |initializer|
|
22
|
+
!initializer_dependencies.key?(initializer)
|
23
|
+
end
|
24
|
+
|
25
|
+
dependent_initializers = initializers - independent_initializers
|
26
|
+
|
27
|
+
initializers = independent_initializers + dependent_initializers
|
28
|
+
|
29
|
+
initializers.each do |initializer|
|
30
|
+
load_config_initializer(initializer)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
@context.instance_exec(*args, &block)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
::Rails::Initializable::Initializer.send :prepend, Patch
|
40
|
+
end
|
metadata
ADDED
@@ -0,0 +1,81 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: initialize
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Luke Horvat
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-03-04 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.10'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.10'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
description: Ruby gem.
|
42
|
+
email:
|
43
|
+
- lukehorvat@gmail.com
|
44
|
+
executables: []
|
45
|
+
extensions: []
|
46
|
+
extra_rdoc_files: []
|
47
|
+
files:
|
48
|
+
- ".gitignore"
|
49
|
+
- Gemfile
|
50
|
+
- LICENSE.txt
|
51
|
+
- README.md
|
52
|
+
- Rakefile
|
53
|
+
- initialize.gemspec
|
54
|
+
- lib/initialize.rb
|
55
|
+
- lib/initialize/patch.rb
|
56
|
+
- lib/initialize/version.rb
|
57
|
+
homepage: https://github.com/lukehorvat/initialize
|
58
|
+
licenses:
|
59
|
+
- MIT
|
60
|
+
metadata: {}
|
61
|
+
post_install_message:
|
62
|
+
rdoc_options: []
|
63
|
+
require_paths:
|
64
|
+
- lib
|
65
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - ">="
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
70
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - ">="
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '0'
|
75
|
+
requirements: []
|
76
|
+
rubyforge_project:
|
77
|
+
rubygems_version: 2.4.5.1
|
78
|
+
signing_key:
|
79
|
+
specification_version: 4
|
80
|
+
summary: Ruby gem.
|
81
|
+
test_files: []
|