Sha256: f38ec3c4bb0ce13d574ae98db968d55ff773d26fffa45356a65030b05fa2c0cc

Contents?: true

Size: 1.05 KB

Versions: 46

Compression:

Stored size: 1.05 KB

Contents

require 'thor'
require 'random_password'
require 'site_hook/config_sections'
require 'site_hook/sender'
module SiteHook
  module Commands

    class JekyllClass < Thor
      # def __version
      # puts SiteHook::VERSION
      # end
      # map ['-v', '--version'] => __version

      desc 'build [options]', 'build sites'

      def build(project_name)
        if SiteHook::Paths.default_config.exist?
          begin
            project = SiteHook::Config.projects.send(StrExt.mkvar(project_name))
            jekyll_status = SiteHook::Senders::Jekyll.build(project['src'], project['dst'], SiteHook::Log::Build, options: {config: project['config']})
          end
        end
      end

      desc 'mkpass [options]', 'create a hook password'
      method_option(:length, type: :numeric, banner: 'LENGTH', aliases: ['-l'], default: 20)

      def mkpass
        puts RandomPassword.new(length: options[:length]).generate
      end

      desc 'inspect [options]', 'output the configuration'
      def inspect
        puts SiteHook::Config.new.inspect
      end
    end
  end
end

Version data entries

46 entries across 46 versions & 1 rubygems

Version Path
site_hook-1.0.30 lib/site_hook/commands/jekyll_class.rb
site_hook-1.0.29 lib/site_hook/commands/jekyll_class.rb
site_hook-1.0.28 lib/site_hook/commands/jekyll_class.rb
site_hook-1.0.27 lib/site_hook/commands/jekyll_class.rb
site_hook-1.0.26 lib/site_hook/commands/jekyll_class.rb
site_hook-1.0.25 lib/site_hook/commands/jekyll_class.rb
site_hook-1.0.24 lib/site_hook/commands/jekyll_class.rb
site_hook-1.0.23 lib/site_hook/commands/jekyll_class.rb
site_hook-1.0.22 lib/site_hook/commands/jekyll_class.rb
site_hook-1.0.21 lib/site_hook/commands/jekyll_class.rb
site_hook-1.0.20 lib/site_hook/commands/jekyll_class.rb
site_hook-1.0.19 lib/site_hook/commands/jekyll_class.rb
site_hook-1.0.18 lib/site_hook/commands/jekyll_class.rb
site_hook-1.0.17 lib/site_hook/commands/jekyll_class.rb
site_hook-1.0.16 lib/site_hook/commands/jekyll_class.rb
site_hook-1.0.15 lib/site_hook/commands/jekyll_class.rb
site_hook-1.0.14 lib/site_hook/commands/jekyll_class.rb
site_hook-1.0.13 lib/site_hook/commands/jekyll_class.rb
site_hook-1.0.12 lib/site_hook/commands/jekyll_class.rb
site_hook-1.0.11 lib/site_hook/commands/jekyll_class.rb