Sha256: e6486ca1908de493926a017c2e74eb9bb1ff4e917bfde65118b59a3754d7690d

Contents?: true

Size: 551 Bytes

Versions: 26

Compression:

Stored size: 551 Bytes

Contents

# -*- encoding : utf-8 -*-
# This tool prepends the names of the trackers passing through it with a prefix
# and an underscore
class Tracksperanto::Tool::Prefix < Tracksperanto::Tool::Base
  
  parameter :prefix,  :cast => :string, :desc => "The prefix to apply", :default => "trk_"
  
  def self.action_description
    "Prefix tracker names with text"
  end
  
  def start_tracker_segment(tracker_name)
    prefixed_name = [prefix.gsub(/_$/, ''), tracker_name]
    prefixed_name.reject!{|e| e.empty? }
    super(prefixed_name.join('_'))
  end
  
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
tracksperanto-3.2.2 lib/tools/prefix.rb
tracksperanto-3.2.1 lib/tools/prefix.rb
tracksperanto-3.2.0 lib/tools/prefix.rb
tracksperanto-3.1.0 lib/tools/prefix.rb
tracksperanto-3.0.1 lib/tools/prefix.rb
tracksperanto-3.0.0 lib/tools/prefix.rb