require_patch 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -3
- data/README.md +11 -2
- data/lib/require_patch/version.rb +1 -1
- data/lib/require_patch.rb +10 -2
- data/require_patch.gemspec +8 -8
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 194f3b04e525afb6858c6f700795cf49eab23448
|
4
|
+
data.tar.gz: 09f421519b77b1425835ae650d47919f03e17cc9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 33f42928543ea2384aa7c5fbc18b0ca5f3a987429aed85b439c7f3b10c03d45c7a1dc6d48ce7b07d90d405d3d0e27cbdbbaacb65a20f61bbe38f75796f014199
|
7
|
+
data.tar.gz: 5d074f866ebf364ea213b052dca7b593706f43205a814d5f469bb32129cc824f56e4635dc8029d17a44805ae94d70b1b18d6d32b3017e1a3be129fac4467186a
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# RequirePatch
|
2
2
|
|
3
|
-
|
3
|
+
The gem adds a command "require_patch" that connects patches plugins. It used by my team to develop Redmine plugins
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
@@ -18,7 +18,16 @@ Or install it yourself as:
|
|
18
18
|
|
19
19
|
## Usage
|
20
20
|
|
21
|
-
|
21
|
+
plugins/awesome_plugin/lib/awesome_plugin
|
22
|
+
plugins/awesome_plugin/lib/awesome_plugin/user_patch.rb
|
23
|
+
plugins/awesome_plugin/lib/awesome_plugin/issue_patch.rb
|
24
|
+
plugins/awesome_plugin/lib/awesome_plugin/user_controller_patch.rb
|
25
|
+
plugins/awesome_plugin/lib/awesome_plugin/issue_helper_patch.rb
|
26
|
+
|
27
|
+
# plugins/awesome_plugin/init.rb
|
28
|
+
Rails.config.to_prepare do
|
29
|
+
require_patch 'awesome_plugin', 'user', 'issue', 'user_controller', 'issue_helper'
|
30
|
+
end
|
22
31
|
|
23
32
|
## Contributing
|
24
33
|
|
data/lib/require_patch.rb
CHANGED
@@ -1,9 +1,17 @@
|
|
1
|
-
require
|
1
|
+
require 'require_patch/version'
|
2
2
|
|
3
3
|
module RequirePatch
|
4
|
+
|
5
|
+
# It includes resources patches for plugin
|
6
|
+
# @param plugin_name [String] the plugin name
|
7
|
+
# @param *resources [String] names of resources which will need patching
|
8
|
+
# @example
|
9
|
+
# Rails.config.to_prepare do
|
10
|
+
# require_patch 'awesome_plugin', 'user', 'issue', 'user_controller', 'issue_helper'
|
11
|
+
# end
|
4
12
|
def require_patch(plugin_name, *resources)
|
5
13
|
resources.each do |resource|
|
6
|
-
require_dependency resource
|
14
|
+
require_dependency resource rescue Rails.logger.warn "Can't find '#{resource}' for require_dependency"
|
7
15
|
|
8
16
|
resource_patch = [plugin_name, [resource, 'patch'].join('_')].join('/')
|
9
17
|
resource_constant, resource_patch_constant = [resource, resource_patch].map(&:camelize).map(&:constantize)
|
data/require_patch.gemspec
CHANGED
@@ -4,20 +4,20 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
require 'require_patch/version'
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
|
-
spec.name =
|
7
|
+
spec.name = 'require_patch'
|
8
8
|
spec.version = RequirePatch::VERSION
|
9
|
-
spec.authors = [
|
10
|
-
spec.email = [
|
9
|
+
spec.authors = ['Roman Shipiev']
|
10
|
+
spec.email = ['roman@shipiev.pro']
|
11
11
|
spec.summary = %q{The gem adds a command "require_patch" that connects patches plugins}
|
12
12
|
spec.description = %q{The gem used by our team to develop Redmine plugins}
|
13
|
-
spec.homepage =
|
14
|
-
spec.license =
|
13
|
+
spec.homepage = 'https://github.com/shipiev/require_patch'
|
14
|
+
spec.license = 'MIT'
|
15
15
|
|
16
16
|
spec.files = `git ls-files -z`.split("\x0")
|
17
17
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
-
spec.require_paths = [
|
19
|
+
spec.require_paths = ['lib']
|
20
20
|
|
21
|
-
spec.add_development_dependency
|
22
|
-
spec.add_development_dependency
|
21
|
+
spec.add_development_dependency 'bundler', '~> 1.5'
|
22
|
+
spec.add_development_dependency 'rake'
|
23
23
|
end
|