Sha256: f5ef002d09033df1dee04c29318cfa23b66f9a8464e4cd553d9eb48664a7c144

Contents?: true

Size: 584 Bytes

Versions: 9

Compression:

Stored size: 584 Bytes

Contents

require "wurfl/command"
require "wurfl/uaproftowurfl"

class Wurfl::Command::Uaproftowurfl
  def execute
    if ARGV.size == 0
      usage
    end

    uaprof = Wurfl::UAProfToWURLF.new

    # Parse all the files and merge them into one UAProf.
    # Following profs take precedence of previous ones
    ARGV.each do |file|
      uaprof.parse_UAProf(file)
    end
    
    # Now output the mapped WURFL to standard out
    uaprof.output_WURFL
  end

  def usage    
    puts "Usage: wurfltools.rb uaproftowurfl uaprof_files"
    puts "No files passed to parse."
    exit 1
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
wurfl-1.3.7 lib/wurfl/command/uaproftowurfl.rb
wurfl-1.3.6 lib/wurfl/command/uaproftowurfl.rb
wurfl-1.3.5 lib/wurfl/command/uaproftowurfl.rb
wurfl-1.1.1 lib/wurfl/command/uaproftowurfl.rb
wurfl-1.1.2 lib/wurfl/command/uaproftowurfl.rb
wurfl-1.2.0 lib/wurfl/command/uaproftowurfl.rb
wurfl-1.3.0 lib/wurfl/command/uaproftowurfl.rb
wurfl-1.3.1 lib/wurfl/command/uaproftowurfl.rb
wurfl-1.1.0 lib/wurfl/command/uaproftowurfl.rb