Class: Tebako::Cli

Inherits:
Thor
  • Object
show all
Defined in:
lib/tebako/cli.rb

Overview

Tebako packager front-end

Constant Summary collapse

CWD_DESCRIPTION =
<<~DESC
  Current working directory for packaged application. This directory shall be specified relative to root.
  #{" " * 65}# If this parameter is not set, the application will start in the current directory of the host file system.
DESC
REF_DESCRIPTION =
<<~DESC
  "Referenced tebako run-time package; 'tebako-runtime' by default".
  #{" " * 65}# This option specifies the tebako runtime to be used by the application on Windows and if mode is 'application' only .
DESC
RGP_DESCRIPTION =
<<~DESC
  Current working directory for packaged application. This directory shall be specified relative to root.
  #{" " * 65}# If this parameter is not set, the application will start in the current directory of the host file system.
DESC

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.exit_on_failure?Boolean

Returns:

  • (Boolean)


142
143
144
# File 'lib/tebako/cli.rb', line 142

def self.exit_on_failure?
  true
end

Instance Method Details

#cleanObject



58
59
60
61
62
# File 'lib/tebako/cli.rb', line 58

def clean
  (om, cm) = bootstrap(clean: true)
  cm.clean_cache
  extra_win_clean([om.deps])
end

#clean_rubyObject



68
69
70
71
72
73
74
75
76
77
78
# File 'lib/tebako/cli.rb', line 68

def clean_ruby
  puts "Cleaning Ruby sources from tebako packaging environment"
  (om,) = bootstrap(clean: true)

  suffix = options["Ruby"].nil? ? "" : "_#{options["Ruby"]}"
  nmr = Dir.glob(File.join(om.deps, "src", "_ruby#{suffix}*"))
  nms = Dir.glob(File.join(om.deps, "stash#{suffix}*"))

  FileUtils.rm_rf(nmr + nms, secure: true)
  extra_win_clean(nmr)
end

#hashObject



81
82
83
# File 'lib/tebako/cli.rb', line 81

def hash
  print Digest::SHA256.hexdigest [File.read(File.join(source, "CMakeLists.txt")), Tebako::VERSION].join
end

#pressObject



117
118
119
120
121
122
123
124
125
126
# File 'lib/tebako/cli.rb', line 117

def press
  validate_press_options
  (om, cm) = bootstrap

  do_press(om)
  cm.ensure_version_file
rescue Tebako::Error => e
  puts "Tebako script failed: #{e.message} [#{e.error_code}]"
  exit e.error_code
end

#setupObject



132
133
134
135
136
137
138
139
140
# File 'lib/tebako/cli.rb', line 132

def setup
  (om, cm) = bootstrap

  do_setup(om)
  cm.ensure_version_file
rescue Tebako::Error => e
  puts "Tebako script failed: #{e.message} [#{e.error_code}]"
  exit e.error_code
end