Class: JekyllRecker::Commands::Share

Inherits:
Jekyll::Command
  • Object
show all
Includes:
Mixins::Logging
Defined in:
lib/jekyll_recker/commands.rb

Overview

Share Command

Class Method Summary collapse

Methods included from Mixins::Logging

#logger

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, options)
  site = Jekyll::Site.new(configuration_from_options(options))
  site.reset
  site.read
  Social.action(site, args, options)
rescue StandardError => e
  logger.error e.message
  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