class FIR::Util::Publisher

Attributes

args[RW]
options[RW]

Public Class Methods

new(args, options) click to toggle source
# File lib/fir/util/publisher.rb, line 10
def initialize(args, options)
  @file_path     = File.absolute_path(args.first.to_s)
  @file_type     = File.extname(@file_path).delete('.')
  @token         = options[:token] || current_token
  @changelog     = read_changelog(options[:changelog]).to_s.to_utf8
  @short         = options[:short].to_s
  @passwd        = options[:password].to_s
  @is_opened     = @passwd.blank? ? options[:open] : false
  @export_qrcode = !!options[:qrcode]
end

Private Instance Methods

file_path() click to toggle source
# File lib/fir/util/publisher.rb, line 23
def file_path
  @file_path = File.absolute_path(args.first.to_s)
end
read_changelog(changelog) click to toggle source
# File lib/fir/util/publisher.rb, line 27
def read_changelog(changelog)
  return if changelog.blank?

  File.exist?(changelog) ? File.read(changelog) : changelog
end