eac_templates 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/eac_templates/core_ext.rb +4 -0
- data/lib/eac_templates/from_all_gems.rb +4 -0
- data/lib/eac_templates/from_gem.rb +35 -0
- data/lib/eac_templates/version.rb +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7f12706546bf46d8517098bc6c070cfc6fb805dc160c4eb0e9a8216f7d46852e
|
4
|
+
data.tar.gz: 88ed7d531bb707d9b9c0b03abf4dd40ca8444976ad6d9cdd6b5558f184706ce2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8673350ac1bcca993d36c03ecc8564707e3f3c72ec2428adfdaaaca9e8298ee1885677b4ddfa71f08f02628490d38fae6373273813478384400a29e1cd1dfb06
|
7
|
+
data.tar.gz: cc714645f6104566f1a15fc8d439bf95048f5ea82bf81f1e82796c4407b29a8a44b7a4a90aed98eb262ca248c5764a89303c3fa2a80933d0878b4ae032141429
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_templates/searcher'
|
4
|
+
|
5
|
+
module EacTemplates
|
6
|
+
class FromGem
|
7
|
+
class << self
|
8
|
+
def include_all(searcher = nil)
|
9
|
+
::Gem::Specification.each { |gemspec| new(gemspec, searcher).include }
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
TEMPLATES_DIR_SUBPATH = 'template'
|
14
|
+
|
15
|
+
common_constructor :gemspec, :searcher, default: [nil] do
|
16
|
+
self.searcher ||= ::EacTemplates::Searcher.default
|
17
|
+
end
|
18
|
+
|
19
|
+
# @return [Boolean]
|
20
|
+
delegate :exist?, to: :path
|
21
|
+
|
22
|
+
# @return [Pathname]
|
23
|
+
def include
|
24
|
+
return nil unless exist?
|
25
|
+
|
26
|
+
searcher.included_paths << path
|
27
|
+
path
|
28
|
+
end
|
29
|
+
|
30
|
+
# @return [Pathname]
|
31
|
+
def path
|
32
|
+
gemspec.gem_dir.to_pathname.join(TEMPLATES_DIR_SUBPATH)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eac_templates
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Put here the authors
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-12-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: eac_config
|
@@ -59,8 +59,11 @@ extensions: []
|
|
59
59
|
extra_rdoc_files: []
|
60
60
|
files:
|
61
61
|
- lib/eac_templates.rb
|
62
|
+
- lib/eac_templates/core_ext.rb
|
62
63
|
- lib/eac_templates/directory.rb
|
63
64
|
- lib/eac_templates/file.rb
|
65
|
+
- lib/eac_templates/from_all_gems.rb
|
66
|
+
- lib/eac_templates/from_gem.rb
|
64
67
|
- lib/eac_templates/patches.rb
|
65
68
|
- lib/eac_templates/patches/module.rb
|
66
69
|
- lib/eac_templates/patches/module/erb_template.rb
|