Class: Kamaze::Project::Tools::Packager Abstract
- Inherits:
-
BaseTool
- Object
- Observable
- BaseTool
- Kamaze::Project::Tools::Packager
- Defined in:
- lib/kamaze/project/tools/packager.rb,
lib/kamaze/project/tools/packager.rb
Overview
This class is abstract.
Provides a packager
Packager is intended to provide basic packaging operations
Direct Known Subclasses
Defined Under Namespace
Classes: Filesystem
Instance Attribute Summary collapse
-
#fs ⇒ Kamaze::Project::Tools::Packager::Filesystem
readonly
Get filesystem.
- #observer_peers ⇒ Hash|nil included from Concern::Observable readonly protected
Instance Method Summary collapse
-
#initialize {|_self| ... } ⇒ Packager
constructor
A new instance of Packager.
-
#initialized? ⇒ Boolean
Denote class is initialized.
- #method_missing(method, *args, &block) ⇒ Object
- #respond_to_missing?(method, include_private = false) ⇒ Boolean
Constructor Details
#initialize {|_self| ... } ⇒ Packager
Returns a new instance of Packager.
41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/kamaze/project/tools/packager.rb', line 41 def initialize @initialized = false # fs mutable attributes are accessibles during initialization # @see method_missing @fs = Filesystem.new yield self if block_given? super @initialized = true end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object
61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/kamaze/project/tools/packager.rb', line 61 def method_missing(method, *args, &block) if respond_to_missing?(method) unless initialized? mutable = fs.mutable_attribute?(method) return fs.__send__(method, *args, &block) if mutable end return fs.public_send(method, *args, &block) end super end |
Instance Attribute Details
#fs ⇒ Kamaze::Project::Tools::Packager::Filesystem (readonly)
Get filesystem
39 40 41 |
# File 'lib/kamaze/project/tools/packager.rb', line 39 def fs @fs end |
#observer_peers ⇒ Hash|nil (readonly, protected) Originally defined in module Concern::Observable
Instance Method Details
#initialized? ⇒ Boolean
Denote class is initialized
57 58 59 |
# File 'lib/kamaze/project/tools/packager.rb', line 57 def initialized? @initialized end |
#respond_to_missing?(method, include_private = false) ⇒ Boolean
75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/kamaze/project/tools/packager.rb', line 75 def respond_to_missing?(method, include_private = false) if method.to_s[-1] == '=' unless initialized? return true if fs.mutable_attribute?(method) end end return true if fs.respond_to?(method, include_private) super(method, include_private) end |