Class: Apadmi::Grout::FilenameUtils
- Inherits:
-
Object
- Object
- Apadmi::Grout::FilenameUtils
- Defined in:
- lib/apadmi/grout/utils/filename_utils.rb
Overview
Generic Filename Utils
Class Method Summary collapse
-
.binary_output_filename(options = {}) ⇒ String
Constructs a standard Apadmi filename for a build output binary.
Class Method Details
.binary_output_filename(options = {}) ⇒ String
Constructs a standard Apadmi filename for a build output binary
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/apadmi/grout/utils/filename_utils.rb', line 17 def self.binary_output_filename( = {}) client_name = [:client_name] raise ":client_name shouldn't be empty" if client_name.blank? product_name = [:product_name] raise ":product_name shouldn't be empty" if product_name.blank? platform = [:platform] raise ":platform shouldn't be empty" if platform.blank? version = [:version] raise ":version shouldn't be empty" if version.blank? build_number = [:build_number] raise ":build_number shouldn't be empty" if build_number.blank? date = [:date] || Time.now.strftime("%Y-%m-%d") suffix = ("-#{[:suffix]}" unless [:suffix].blank?) || "" "#{client_name}-#{product_name}-#{platform}-v#{version}(#{build_number})-#{date}#{suffix}" end |