active_support-lazy_load_patch 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: e9a958ed6a009f2a2b2cd203db9799e2fbf73574
4
+ data.tar.gz: c1580dcac9124f812db3c14fbc159a7c9f219bf6
5
+ SHA512:
6
+ metadata.gz: c500fb944ea9778e1c4e7b1600fff3163d1b40bd99870ff1591e4bf7cebc03581cf74adb61890c934104b4637c0afdb218e353eb50ab8af4a15abb94c4a43262
7
+ data.tar.gz: 1c9f23379bed072328ce25c35a430348ac58050a85550a80a6ea3594f459d5c5a9f0a55c46a7d1183fbdea4034371a36e747100b256ac76090f11ac54e473d39
@@ -0,0 +1,14 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ *.bundle
11
+ *.so
12
+ *.o
13
+ *.a
14
+ mkmf.log
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in active_support-lazy_load_patch.gemspec
4
+ gemspec
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2015 bibendi
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.
@@ -0,0 +1,29 @@
1
+ # ActiveSupport::LazyLoadPatch
2
+
3
+ Ensure load hooks can be called more than once with different contexts
4
+
5
+ Based on https://github.com/rails/rails/commit/c0a5b8505d0fa9095cbee8b709f9aadf630a3716
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'active_support-lazy_load_patch'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install active_support-lazy_load_patch
22
+
23
+ ## Contributing
24
+
25
+ 1. Fork it ( https://github.com/abak-press/active_support-lazy_load_patch/fork )
26
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
27
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
28
+ 4. Push to the branch (`git push origin my-new-feature`)
29
+ 5. Create a new Pull Request
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+
@@ -0,0 +1,24 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'active_support/lazy_load_patch/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "active_support-lazy_load_patch"
8
+ spec.version = ActiveSupport::LazyLoadPatch::VERSION
9
+ spec.authors = ["merkushin"]
10
+ spec.email = ["merkushin.m.s@gmail.com"]
11
+ spec.summary = "Ensure load hooks can be called more than once with different contexts"
12
+ spec.homepage = "https://github.com/abak-press/active_support-lazy_load_patch"
13
+ spec.license = "MIT"
14
+
15
+ spec.files = `git ls-files -z`.split("\x0")
16
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
17
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
+ spec.require_paths = ["lib"]
19
+
20
+ spec.add_runtime_dependency "activesupport", "~> 3.1.0"
21
+
22
+ spec.add_development_dependency "bundler", "~> 1.7"
23
+ spec.add_development_dependency "rake", "~> 10.0"
24
+ end
@@ -0,0 +1,23 @@
1
+ require "active_support/lazy_load_hooks"
2
+ require "active_support/lazy_load_patch/version"
3
+
4
+ module ActiveSupport
5
+ @loaded_prev = @loaded
6
+ @loaded = Hash.new { |h,k| h[k] = [] }
7
+ @loaded_prev.each { |k, v| @loaded[k] << v }
8
+
9
+ def self.on_load(name, options = {}, &block)
10
+ @loaded[name].each do |base|
11
+ execute_hook(base, options, block)
12
+ end
13
+
14
+ @load_hooks[name] << [block, options]
15
+ end
16
+
17
+ def self.run_load_hooks(name, base = Object)
18
+ @loaded[name] << base
19
+ @load_hooks[name].each do |hook, options|
20
+ execute_hook(base, options, hook)
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,5 @@
1
+ module ActiveSupport
2
+ module LazyLoadPatch
3
+ VERSION = "0.0.2"
4
+ end
5
+ end
metadata ADDED
@@ -0,0 +1,94 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: active_support-lazy_load_patch
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
5
+ platform: ruby
6
+ authors:
7
+ - merkushin
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-08-12 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ version_requirements: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - ~>
17
+ - !ruby/object:Gem::Version
18
+ version: 3.1.0
19
+ name: activesupport
20
+ requirement: !ruby/object:Gem::Requirement
21
+ requirements:
22
+ - - ~>
23
+ - !ruby/object:Gem::Version
24
+ version: 3.1.0
25
+ type: :runtime
26
+ prerelease: false
27
+ - !ruby/object:Gem::Dependency
28
+ version_requirements: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - ~>
31
+ - !ruby/object:Gem::Version
32
+ version: '1.7'
33
+ name: bundler
34
+ requirement: !ruby/object:Gem::Requirement
35
+ requirements:
36
+ - - ~>
37
+ - !ruby/object:Gem::Version
38
+ version: '1.7'
39
+ type: :development
40
+ prerelease: false
41
+ - !ruby/object:Gem::Dependency
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - ~>
45
+ - !ruby/object:Gem::Version
46
+ version: '10.0'
47
+ name: rake
48
+ requirement: !ruby/object:Gem::Requirement
49
+ requirements:
50
+ - - ~>
51
+ - !ruby/object:Gem::Version
52
+ version: '10.0'
53
+ type: :development
54
+ prerelease: false
55
+ description:
56
+ email:
57
+ - merkushin.m.s@gmail.com
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - .gitignore
63
+ - Gemfile
64
+ - LICENSE.txt
65
+ - README.md
66
+ - Rakefile
67
+ - active_support-lazy_load_patch.gemspec
68
+ - lib/active_support/lazy_load_patch.rb
69
+ - lib/active_support/lazy_load_patch/version.rb
70
+ homepage: https://github.com/abak-press/active_support-lazy_load_patch
71
+ licenses:
72
+ - MIT
73
+ metadata: {}
74
+ post_install_message:
75
+ rdoc_options: []
76
+ require_paths:
77
+ - lib
78
+ required_ruby_version: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - '>='
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ required_rubygems_version: !ruby/object:Gem::Requirement
84
+ requirements:
85
+ - - '>='
86
+ - !ruby/object:Gem::Version
87
+ version: '0'
88
+ requirements: []
89
+ rubyforge_project:
90
+ rubygems_version: 2.4.6
91
+ signing_key:
92
+ specification_version: 4
93
+ summary: Ensure load hooks can be called more than once with different contexts
94
+ test_files: []