Class: DataMetaBuild

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#targetString

Returns build target directory name.

Returns:

  • (String)

    build target directory name.

See Also:



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

#cleanObject

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

#initObject

Creates target if it does not exist.



27
# File 'lib/dataMetaBuild.rb', line 27

def init; FileUtils.mkpath target end