Class: Wordmove::CLI
- Inherits:
-
Thor
- Object
- Thor
- Wordmove::CLI
- Defined in:
- lib/wordmove/cli.rb
Instance Method Summary collapse
- #__print_version ⇒ Object
- #doctor ⇒ Object
- #init ⇒ Object
- #list ⇒ Object
- #pull ⇒ Object
- #push ⇒ Object
Instance Method Details
#__print_version ⇒ Object
6 7 8 |
# File 'lib/wordmove/cli.rb', line 6 def __print_version puts Wordmove::VERSION end |
#doctor ⇒ Object
16 17 18 |
# File 'lib/wordmove/cli.rb', line 16 def doctor Wordmove::Doctor.start end |
#init ⇒ Object
11 12 13 |
# File 'lib/wordmove/cli.rb', line 11 def init Wordmove::Generators::Movefile.start end |
#list ⇒ Object
64 65 66 67 68 69 70 71 72 |
# File 'lib/wordmove/cli.rb', line 64 def list Wordmove::EnvironmentsList.print() rescue Wordmove::MovefileNotFound => e logger.error(e.) exit 1 rescue Psych::SyntaxError => e logger.error("Your movefile is not parsable due to a syntax error: #{e.}") exit 1 end |
#pull ⇒ Object
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 |
# File 'lib/wordmove/cli.rb', line 78 def pull () begin deployer = Wordmove::Deployer::Base.deployer_for(.deep_symbolize_keys) rescue MovefileNotFound => e logger.error(e.) exit 1 end Wordmove::Hook.run(:pull, :before, ) guardian = Wordmove::Guardian.new(options: , action: :pull) () do |task| deployer.send("pull_#{task}") if guardian.allows(task.to_sym) end Wordmove::Hook.run(:pull, :after, ) end |
#push ⇒ Object
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 |
# File 'lib/wordmove/cli.rb', line 102 def push () begin deployer = Wordmove::Deployer::Base.deployer_for(.deep_symbolize_keys) rescue MovefileNotFound => e logger.error(e.) exit 1 end Wordmove::Hook.run(:push, :before, ) guardian = Wordmove::Guardian.new(options: , action: :push) () do |task| deployer.send("push_#{task}") if guardian.allows(task.to_sym) end Wordmove::Hook.run(:push, :after, ) end |