Sha256: 39821e047529fcc169dcf8b43fa48a0a8eebd7da0d1502ae141f6566d7dc0048

Contents?: true

Size: 1.7 KB

Versions: 8

Compression:

Stored size: 1.7 KB

Contents

require 'thor'
require 'wordmove/generators/movefile'
require 'wordmove/deployer/base'

module Wordmove
  class CLI < Thor

    desc "init", "Generates a brand new Movefile"
    def init
      Wordmove::Generators::Movefile.start
    end

    desc "pull", "Pulls WP data from remote host to the local machine"
    method_option :db,       :aliases => "-d", :type => :boolean
    method_option :uploads,  :aliases => "-u", :type => :boolean
    method_option :themes,   :aliases => "-t", :type => :boolean
    method_option :plugins,  :aliases => "-p", :type => :boolean
    method_option :verbose,  :aliases => "-v", :type => :boolean
    method_option :simulate, :aliases => "-s", :type => :boolean
    method_option :config,   :aliases => "-c"
    def pull
      deployer = Wordmove::Deployer::Base.deployer_for(options)
      %w(db uploads themes plugins).map(&:to_sym).each do |task|
        if options[task]
          deployer.send("pull_#{task}")
        end
      end
    end

    desc "push", "Pushes WP data from local machine to remote host"
    method_option :db,       :aliases => "-d", :type => :boolean
    method_option :uploads,  :aliases => "-u", :type => :boolean
    method_option :themes,   :aliases => "-t", :type => :boolean
    method_option :plugins,  :aliases => "-p", :type => :boolean
    method_option :verbose,  :aliases => "-v", :type => :boolean
    method_option :simulate, :aliases => "-s", :type => :boolean
    method_option :config,   :aliases => "-c"
    def push
      deployer = Wordmove::Deployer::Base.deployer_for(options)
      %w(db uploads themes plugins).map(&:to_sym).each do |task|
        if options[task]
          deployer.send("push_#{task}")
        end
      end
    end

  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
wordmove-1.0.4 lib/wordmove/cli.rb
wordmove-1.0.3 lib/wordmove/cli.rb
wordmove-1.0.2 lib/wordmove/cli.rb
wordmove-1.0.1 lib/wordmove/cli.rb
wordmove-1.0.0 lib/wordmove/cli.rb
wordmove-0.1.0.rc lib/wordmove/cli.rb
wordmove-0.1.0.beta lib/wordmove/cli.rb
wordmove-0.1.0.alpha lib/wordmove/cli.rb