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.5.9 lib/tools/prefix.rb
tracksperanto-3.5.8 lib/tools/prefix.rb
tracksperanto-3.5.7 lib/tools/prefix.rb
tracksperanto-3.5.6 lib/tools/prefix.rb
tracksperanto-3.5.5 lib/tools/prefix.rb
tracksperanto-3.5.4 lib/tools/prefix.rb
tracksperanto-3.5.2 lib/tools/prefix.rb
tracksperanto-3.5.1 lib/tools/prefix.rb
tracksperanto-3.5.0 lib/tools/prefix.rb
tracksperanto-3.4.1 lib/tools/prefix.rb
tracksperanto-3.4.0 lib/tools/prefix.rb
tracksperanto-3.3.13 lib/tools/prefix.rb
tracksperanto-3.3.12 lib/tools/prefix.rb
tracksperanto-3.3.11 lib/tools/prefix.rb
tracksperanto-3.3.10 lib/tools/prefix.rb
tracksperanto-3.3.9 lib/tools/prefix.rb
tracksperanto-3.3.8 lib/tools/prefix.rb
tracksperanto-3.3.7 lib/tools/prefix.rb
tracksperanto-3.3.6 lib/tools/prefix.rb
tracksperanto-3.3.0.pre lib/tools/prefix.rb