Module: MrHyde

Defined in:
lib/mr_hyde/blog.rb,
lib/mr_hyde.rb,
lib/mr_hyde/command.rb,
lib/mr_hyde/version.rb,
lib/mr_hyde/commands/new.rb,
lib/mr_hyde/configuration.rb,
lib/mr_hyde/commands/build.rb,
lib/mr_hyde/extensions/new.rb,
lib/mr_hyde/commands/remove.rb

Overview

TODO: The site place must be taken from the default config or the one provided by user

Defined Under Namespace

Modules: Commands, Extensions Classes: Blog, Command, Configuration

Constant Summary collapse

VERSION =
"0.1.0"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.configuration(override = Hash.new) ⇒ Object

Returns the value of attribute configuration.



16
17
18
# File 'lib/mr_hyde.rb', line 16

def configuration
  @configuration
end

Class Method Details

.build(opts = {}) ⇒ Object



67
68
69
# File 'lib/mr_hyde.rb', line 67

def build(opts = {})
  Commands::Build.process opts
end

.configure {|configuration| ... } ⇒ Object

Yields:



18
19
20
21
# File 'lib/mr_hyde.rb', line 18

def configure
  self.configuration ||= Configuration.new
  yield(configuration) if block_given?
end

.create(args, opts = {}) ⇒ Object

Creates the folders for the sources and destination, by default will be created under root folder. Copies the default _config.yml for all blogs, in root folder.

Throws a SystemExit exception



51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/mr_hyde.rb', line 51

def create(args, opts = {})
  args = [args] if args.kind_of? String
  new_site_path = File.expand_path(args.join(" "), Dir.pwd)
  FileUtils.mkdir_p new_site_path
  if preserve_source_location?(new_site_path, opts)
    raise SystemExit.new "#{new_site_path} exists and is not empty."
  end

  if opts['blank']
    create_black_site new_site_path
  else
    create_sample_files new_site_path
  end
  new_site_path
end

.loggerObject

Public: Fetch the logger instance for this Jekyll process.

Returns the LogAdapter instance.



41
42
43
# File 'lib/mr_hyde.rb', line 41

def logger
  Jekyll.logger
end