Class: Ki::ExportVersion
Overview
Exports version from repository to target directory
Instance Method Summary collapse
Instance Method Details
#execute(ctx, args) ⇒ Object
243 244 245 246 247 248 249 |
# File 'lib/cmd/version_cmd.rb', line 243 def execute(ctx, args) @exporter = VersionExporter.new file_patterns = opts.parse(args) version = file_patterns.delete_at(0) @exporter.find_files.files(file_patterns) @exporter.ki_home(ctx.ki_home).export(version, out) end |
#help ⇒ Object
273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 |
# File 'lib/cmd/version_cmd.rb', line 273 def help <<EOF "#{shell_command}" exports version and its dependencies to target directory. ### Usage #{shell_command} <parameters> <file_export_pattern*.*> ### Examples #{shell_command} -o export-dir --tags -c bin my/product #{shell_command} -o scripts -c -t my/admin-tools '*.sh' ### Parameters #{opts} EOF end |
#opts ⇒ Object
251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 |
# File 'lib/cmd/version_cmd.rb', line 251 def opts OptionParser.new do |opts| opts. = "" opts.on("-o", "--output-directory INPUT-DIR", "Input directory") do |v| out(v) end opts.on("--tags TAGS", "Select files with matching tag") do |v| @exporter.find_files.(v.split(",")) end opts.on("-t", "--test", "Test version before export") do |v| @exporter.test_dependencies=true end opts.on("-c", "--copy", "Exported files are copied instead of linked") do |v| @exporter.copy=true end end end |
#summary ⇒ Object
269 270 271 |
# File 'lib/cmd/version_cmd.rb', line 269 def summary "Export version to a directory" end |