Sha256: 9bb5b983b09bb2c015db82ff1de620eb5d0f63ed13eac0dc88de1a4eaad2255c
Contents?: true
Size: 1.86 KB
Versions: 1
Compression:
Stored size: 1.86 KB
Contents
module Wordmove class CLI < Thor map %w[--version -v] => :__print_version desc "--version, -v", "Print the version" def __print_version puts Wordmove::VERSION end desc "init", "Generates a brand new Movefile" def init Wordmove::Generators::Movefile.start end shared_options = { wordpress: { aliases: "-w", type: :boolean }, uploads: { aliases: "-u", type: :boolean }, themes: { aliases: "-t", type: :boolean }, plugins: { aliases: "-p", type: :boolean }, mu_plugins: { aliases: "-m", type: :boolean }, languages: { aliases: "-l", type: :boolean }, db: { aliases: "-d", type: :boolean }, verbose: { aliases: "-v", type: :boolean }, simulate: { aliases: "-s", type: :boolean }, environment: { aliases: "-e" }, config: { aliases: "-c" }, no_adapt: { type: :boolean }, all: { type: :boolean } } no_tasks do def handle_options(options) %w(wordpress uploads themes plugins mu_plugins languages db).map(&:to_sym).each do |task| if options[task] || options[:all] yield task end end end end desc "pull", "Pulls WP data from remote host to the local machine" shared_options.each do |option, args| method_option option, args end def pull deployer = Wordmove::Deployer::Base.deployer_for(options) handle_options(options) do |task| deployer.send("pull_#{task}") end end desc "push", "Pushes WP data from local machine to remote host" shared_options.each do |option, args| method_option option, args end def push deployer = Wordmove::Deployer::Base.deployer_for(options) handle_options(options) do |task| deployer.send("push_#{task}") end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
wordmove-1.4.0.pre | lib/wordmove/cli.rb |