Class: DataMetaBuild
- Inherits:
-
Object
- Object
- DataMetaBuild
- Defined in:
- lib/dataMetaBuild.rb
Overview
Utilities for building and deploying applications.
Constant Summary collapse
- VERSION =
Current version
'1.0.0'- TARGET_DIR =
Default build target directory, to mimic Maven it’s literally “
target”. 'target'
Instance Attribute Summary collapse
-
#target ⇒ String
Build target directory name.
Instance Method Summary collapse
-
#clean ⇒ Object
Removes target if it exists.
-
#init ⇒ Object
Creates target if it does not exist.
-
#initialize(target = TARGET_DIR) ⇒ DataMetaBuild
constructor
Initializes the instance with the given target directory, defaulted to TARGET_DIR.
Constructor Details
#initialize(target = TARGET_DIR) ⇒ DataMetaBuild
Initializes the instance with the given target directory, defaulted to TARGET_DIR
24 |
# File 'lib/dataMetaBuild.rb', line 24 def initialize(target = TARGET_DIR); @target = target end |
Instance Attribute Details
#target ⇒ String
Returns build target directory name.
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/dataMetaBuild.rb', line 14 class DataMetaBuild # Current version VERSION = '1.0.0' # Default build target directory, to mimic Maven it's literally "<tt>target</tt>". TARGET_DIR = 'target' attr_accessor :target # Initializes the instance with the given target directory, defaulted to TARGET_DIR def initialize(target = TARGET_DIR); @target = target end # Creates target if it does not exist. def init; FileUtils.mkpath target end # Removes target if it exists. def clean FileUtils.remove_dir(target, true) if File.exists? target_dir end end |
Instance Method Details
#clean ⇒ Object
Removes target if it exists.
30 31 32 |
# File 'lib/dataMetaBuild.rb', line 30 def clean FileUtils.remove_dir(target, true) if File.exists? target_dir end |
#init ⇒ Object
Creates target if it does not exist.
27 |
# File 'lib/dataMetaBuild.rb', line 27 def init; FileUtils.mkpath target end |