Sha256: 1633c3d26cf66467eb831ba61b5d4adac389c598d3dc13b937a7e19266cc4f8a

Contents?: true

Size: 1.13 KB

Versions: 8

Compression:

Stored size: 1.13 KB

Contents

# -*- encoding : utf-8 -*-

require 'fileutils'
require 'rubygems'
require 'phrase'

class Phrase::Tool
  autoload :Config, 'phrase/tool/config'
  autoload :Options, 'phrase/tool/options'
  autoload :Formats, 'phrase/formats'
  autoload :Commands, 'phrase/tool/commands'
  autoload :TagValidator, 'phrase/tool/tag_validator'
  autoload :EncodingDetector, 'phrase/tool/encoding_detector'
  autoload :Locale, 'phrase/tool/locale'
  
  def initialize(argv)
    @args = argv
  end

  def run
    command_name = @args.first
    @options = Phrase::Tool::Options.new(@args, command_name)
    
    command = case command_name
      when /init/
        Phrase::Tool::Commands::Init.new(@options, @args)
      when /push/
        Phrase::Tool::Commands::Push.new(@options, @args)
      when /pull/
        Phrase::Tool::Commands::Pull.new(@options, @args)
      when /tags/
        Phrase::Tool::Commands::Tags.new(@options, @args)
      else
        if @options.get(:version)
          Phrase::Tool::Commands::ShowVersion.new(@options, @args)
        else
          Phrase::Tool::Commands::ShowHelp.new(@options, @args)
        end
    end
    command.execute!
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
phrase-0.4.14 lib/phrase/tool.rb
phrase-0.4.13 lib/phrase/tool.rb
phrase-0.4.12 lib/phrase/tool.rb
phrase-0.4.11 lib/phrase/tool.rb
phrase-0.4.10 lib/phrase/tool.rb
phrase-0.4.9 lib/phrase/tool.rb
phrase-0.4.8 lib/phrase/tool.rb
phrase-0.4.7 lib/phrase/tool.rb