Module: Dapp::Dimg::Dapp::Dappfile
- Included in:
- Dapp
- Defined in:
- lib/dapp/dimg/dapp/dappfile.rb
Instance Method Summary collapse
- #build_configs ⇒ Object
- #dimg_name! ⇒ Object
- #dimgs_names ⇒ Object
- #dimgs_patterns ⇒ Object
- #nameless_dimg? ⇒ Boolean
- #one_dimg! ⇒ Object
Instance Method Details
#build_configs ⇒ Object
23 24 25 26 27 28 29 30 31 |
# File 'lib/dapp/dimg/dapp/dappfile.rb', line 23 def build_configs @build_configs ||= begin config._dimg.select do |dimg| dimgs_patterns.any? { |pattern| dimg._name.nil? || File.fnmatch(pattern, dimg._name) } end.tap do |dimgs| raise ::Dapp::Error::Dapp, code: :no_such_dimg, data: { dimgs_patterns: dimgs_patterns.join('`, `') } if dimgs.empty? end end end |
#dimg_name! ⇒ Object
9 10 11 12 |
# File 'lib/dapp/dimg/dapp/dappfile.rb', line 9 def dimg_name! one_dimg! build_configs.first._name end |
#dimgs_names ⇒ Object
19 20 21 |
# File 'lib/dapp/dimg/dapp/dappfile.rb', line 19 def dimgs_names build_configs.map(&:_name) end |
#dimgs_patterns ⇒ Object
33 34 35 36 37 38 39 |
# File 'lib/dapp/dimg/dapp/dappfile.rb', line 33 def dimgs_patterns @dimgs_patterns ||= begin ([:dimgs_patterns] || []).tap do |dimgs_patterns| dimgs_patterns << '*' unless dimgs_patterns.any? end end end |
#nameless_dimg? ⇒ Boolean
5 6 7 |
# File 'lib/dapp/dimg/dapp/dappfile.rb', line 5 def nameless_dimg? dimgs_names.first.nil? end |