Class: Ready::Readyfile::Executable
- Inherits:
-
Object
- Object
- Ready::Readyfile::Executable
- Defined in:
- lib/ready/readyfile/executable.rb
Overview
A single executable declared in a readyfile, mapping its name to the compiled path under the build directory.
Instance Attribute Summary collapse
-
#build_dir ⇒ Object
readonly
Returns the value of attribute build_dir.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#prefix ⇒ Object
readonly
Returns the value of attribute prefix.
Instance Method Summary collapse
-
#initialize(name, build_dir:, prefix: "ready_") ⇒ Executable
constructor
A new instance of Executable.
- #mapping ⇒ Object
- #ready_name ⇒ Object
- #realpath ⇒ Object
Constructor Details
#initialize(name, build_dir:, prefix: "ready_") ⇒ Executable
Returns a new instance of Executable.
7 8 9 10 11 12 13 |
# File 'lib/ready/readyfile/executable.rb', line 7 def initialize(name, build_dir:, prefix: "ready_") @name = name @prefix = prefix @build_dir = Pathname(build_dir) validate! end |
Instance Attribute Details
#build_dir ⇒ Object (readonly)
Returns the value of attribute build_dir.
5 6 7 |
# File 'lib/ready/readyfile/executable.rb', line 5 def build_dir @build_dir end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/ready/readyfile/executable.rb', line 5 def name @name end |
#prefix ⇒ Object (readonly)
Returns the value of attribute prefix.
5 6 7 |
# File 'lib/ready/readyfile/executable.rb', line 5 def prefix @prefix end |
Instance Method Details
#mapping ⇒ Object
15 16 17 |
# File 'lib/ready/readyfile/executable.rb', line 15 def mapping { name => realpath } end |
#ready_name ⇒ Object
19 20 21 |
# File 'lib/ready/readyfile/executable.rb', line 19 def ready_name prefix + name end |
#realpath ⇒ Object
23 24 25 |
# File 'lib/ready/readyfile/executable.rb', line 23 def realpath build_dir / ready_name end |