Class: Jekyll::Commands::DeployNarou
- Inherits:
-
Command
- Object
- Command
- Jekyll::Commands::DeployNarou
- Defined in:
- lib/jekyll/commands/deploy_narou.rb
Constant Summary collapse
- COMMAND_OPTIONS =
{ 'id' => ['--id ID', 'ID of Narou account'], 'password' => ['--password PASSWORD', 'Password of Narou account'], 'ncode' => ['--ncode NCODE', 'The posts will be deployed into NCODE syosetsu'], }
Class Method Summary collapse
- .init_with_program(prog) ⇒ Object
- .process(options, deployer: JekyllDeployShosetsu::Deployers::Narou.new) ⇒ Object
Class Method Details
.init_with_program(prog) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/jekyll/commands/deploy_narou.rb', line 11 def init_with_program(prog) prog.command(:'deploy-narou') do |c| c.syntax 'deploy-narou [options]' c.description 'Deploy posts to Narou' c.alias :dn c.option 'config', '--config CONFIG_FILE[,CONFIG_FILE2,...]', Array, 'Custom configuration file' c.option "future", "--future", "Publishes posts with a future date" c.option 'verbose', '-V', '--verbose', 'Print verbose output.' COMMAND_OPTIONS.each do |key, val| c.option key, *val end c.action do |_args, | ['narou'] = {} COMMAND_OPTIONS.keys.each do |key| ['narou'][key] = [key] unless [key].nil? end process() end end end |
.process(options, deployer: JekyllDeployShosetsu::Deployers::Narou.new) ⇒ Object
36 37 38 39 40 41 42 43 44 |
# File 'lib/jekyll/commands/deploy_narou.rb', line 36 def process(, deployer: JekyllDeployShosetsu::Deployers::Narou.new) Jekyll.logger.adjust_verbosity() site = Jekyll::Site.new(configure()) site.reset site.read deployer.deploy(site) end |