Sha256: b9eaffcf5ea767745e469973f200e511b6345107f35b2b55d1f897ea80de598f

Contents?: true

Size: 933 Bytes

Versions: 1

Compression:

Stored size: 933 Bytes

Contents

# frozen_string_literal: true

# 3rd party
require 'jekyll'
require 'rainbow'

# relative
require_relative 'jekyll_push/branch'
require_relative 'jekyll_push/command'
require_relative 'jekyll_push/error'
require_relative 'jekyll_push/local'
require_relative 'jekyll_push/site'
require_relative 'jekyll_push/travis'
require_relative 'jekyll_push/utils'

#
#
module JekyllPush
  #
  # @return [Nil]
  def self.run_command(arg, opts)
    site   = JekyllPush::Site.new
    branch = JekyllPush::Branch.new arg, opts

    site.rebuild branch.target
    branch.push site.dir

    puts Rainbow("\nDone ✓").green
  end

  #
  # @return [String]
  def self.config_path
    "#{`pwd`.strip}/_config.yml"
  end

  #
  # @return [Hash]
  def self.config_from_file(path = config_path)
    YAML.load_file path
  rescue StandardError => e
    raise JekyllPush::Error::InvalidConfig, "Could not load config file from path '#{path}'\n#{e}"
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
jekyll_push-0.1.2 lib/jekyll_push.rb