Class: JekyllRecker::Commands::Share
- Inherits:
-
Jekyll::Command
- Object
- Jekyll::Command
- JekyllRecker::Commands::Share
- Includes:
- Mixins::Logging
- Defined in:
- lib/jekyll_recker/commands.rb
Overview
Share Command
Class Method Summary collapse
Methods included from Mixins::Logging
Class Method Details
.action(args, options) ⇒ Object
19 20 21 22 23 24 25 26 27 |
# File 'lib/jekyll_recker/commands.rb', line 19 def self.action(args, ) site = Jekyll::Site.new(()) site.reset site.read Social.action(site, args, ) rescue StandardError => e logger.error e. exit 1 end |
.init_with_program(prog) ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/jekyll_recker/commands.rb', line 10 def self.init_with_program(prog) prog.command(:share) do |c| c.syntax 'share' c.description 'Share latest post with each configured backend' c.option 'dry', '-d', '--dry', 'perform dry run' c.action { |args, opts| action(args, opts) } end end |