require_infector 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: cd15ec8c94fde8c2c43d17e41e2c4812e8d09060
4
+ data.tar.gz: 8f5bb7f974e9aa40159ce1688ec4bcdc60d69a29
5
+ SHA512:
6
+ metadata.gz: 15248a993eb2ee3b013a45f3e91aa7e4a6dd898354ee865d0ecf60e3c3d5d4ce15a3d07f4a889e4eee07aa78a2ccb9304307c225b1270e84a866dfa7243ccdf3
7
+ data.tar.gz: d480fb49e8f1189895fc8de0ee94ed01bc5280b2234b7648f8563e448f2bdbe717fd48e16e0a471f5efd435753c36acc419db3c3c65e6be95025f440893f57f2
data/.gitignore ADDED
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in require_infector.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2015 shipiev
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,38 @@
1
+ # RequireInfector
2
+
3
+ The gem add 'require_infector' to ActionDispatch. It's using for patching.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'require_infector'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install require_infector
18
+
19
+ ## Usage
20
+
21
+ plugins/awesome_plugin/lib/awesome_plugin
22
+ plugins/awesome_plugin/lib/awesome_plugin/infectors/user.rb
23
+ plugins/awesome_plugin/lib/awesome_plugin/infectors/issue.rb
24
+ plugins/awesome_plugin/lib/awesome_plugin/infectors/users_controller.rb
25
+ plugins/awesome_plugin/lib/awesome_plugin/infectors/issues_helper.rb
26
+
27
+ # plugins/awesome_plugin/init.rb
28
+ Rails.config.to_prepare do
29
+ require_infector 'awesome_plugin', 'user', 'issue', 'user_controller', 'issue_helper'
30
+ end
31
+
32
+ ## Contributing
33
+
34
+ 1. Fork it ( http://github.com/<my-github-username>/require_infector/fork )
35
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
36
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
37
+ 4. Push to the branch (`git push origin my-new-feature`)
38
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,23 @@
1
+ require 'require_infector/version'
2
+
3
+ module RequireInfector
4
+ # It's including patches
5
+ # @param plugin_name [String] the plugin name
6
+ # @param *resources [String] names of resources which will need patching
7
+ # @example
8
+ # Rails.config.to_prepare do
9
+ # require_infector 'awesome_plugin', 'user', 'issue', 'user_controller', 'issue_helper'
10
+ # end
11
+ def require_infector(plugin_name, *resources)
12
+ resources.each do |resource|
13
+ require_dependency resource rescue Rails.logger.warn "Can't find '#{resource}' for require_dependency"
14
+
15
+ resource_patch = [plugin_name, 'infectors', resource].join('/')
16
+ resource_constant, resource_patch_constant = [resource, resource_patch].map(&:camelize).map(&:constantize)
17
+
18
+ resource_constant.send(:include, resource_patch_constant) unless resource_constant.included_modules.include? resource_patch_constant
19
+ end
20
+ end
21
+ end
22
+
23
+ ActionDispatch::Reloader.send(:include, ::RequireInfector) unless ActionDispatch::Reloader.included_modules.include? ::RequireInfector
@@ -0,0 +1,3 @@
1
+ module RequireInfector
2
+ VERSION = '0.0.1'
3
+ end
@@ -0,0 +1,22 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'require_infector/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'require_infector'
8
+ spec.version = RequireInfector::VERSION
9
+ spec.authors = ['Roman Shipiev']
10
+ spec.email = ['roman@shipiev.pro']
11
+ spec.summary = %q{The gem add 'require_infector' to ActionDispatch}
12
+ spec.description = %q{It's using for patching}
13
+ spec.homepage = 'https://github.com/shipiev/require_infector'
14
+ spec.license = 'MIT'
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ['lib']
20
+
21
+ spec.add_development_dependency 'rails'
22
+ end
metadata ADDED
@@ -0,0 +1,67 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: require_infector
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Roman Shipiev
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-05-13 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rails
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '>='
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ description: It's using for patching
28
+ email:
29
+ - roman@shipiev.pro
30
+ executables: []
31
+ extensions: []
32
+ extra_rdoc_files: []
33
+ files:
34
+ - .gitignore
35
+ - Gemfile
36
+ - LICENSE.txt
37
+ - README.md
38
+ - Rakefile
39
+ - lib/require_infector.rb
40
+ - lib/require_infector/version.rb
41
+ - require_infector.gemspec
42
+ homepage: https://github.com/shipiev/require_infector
43
+ licenses:
44
+ - MIT
45
+ metadata: {}
46
+ post_install_message:
47
+ rdoc_options: []
48
+ require_paths:
49
+ - lib
50
+ required_ruby_version: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ required_rubygems_version: !ruby/object:Gem::Requirement
56
+ requirements:
57
+ - - '>='
58
+ - !ruby/object:Gem::Version
59
+ version: '0'
60
+ requirements: []
61
+ rubyforge_project:
62
+ rubygems_version: 2.0.2
63
+ signing_key:
64
+ specification_version: 4
65
+ summary: The gem add 'require_infector' to ActionDispatch
66
+ test_files: []
67
+ has_rdoc: