Sha256: a9685e07ae37c80b3fb4a97956a51dcfd6207b99c09719a0404a45af140f00ef

Contents?: true

Size: 1 KB

Versions: 1

Compression:

Stored size: 1 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/tool/formats'
  autoload :Commands, 'phrase/tool/commands'
  autoload :TagValidator, 'phrase/tool/tag_validator'
  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)
      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

1 entries across 1 versions & 1 rubygems

Version Path
phrase-0.3.0 lib/phrase/tool.rb