Sha256: 2b7f8c63f12f0b033d43d818f86406841400c6d59d2c7b770df84f7335295dc9
Contents?: true
Size: 793 Bytes
Versions: 7
Compression:
Stored size: 793 Bytes
Contents
module Svgeez class Destination DEFAULT_DESTINATION_FILE_NAME = 'svgeez.svg'.freeze def initialize(options = {}) @destination = File.expand_path(options.fetch('destination', "./#{DEFAULT_DESTINATION_FILE_NAME}")) end def file_id @file_id ||= File.basename(file_name, '.svg').tr(' ', '-') end def file_name @file_name ||= if @destination.end_with?('.svg') File.split(@destination)[1] else DEFAULT_DESTINATION_FILE_NAME end end def file_path @file_path ||= File.join(folder_path, file_name) end def folder_path @folder_path ||= if @destination.end_with?('.svg') File.split(@destination)[0] else @destination end end end end
Version data entries
7 entries across 7 versions & 1 rubygems