Class: Bookery::CLI

Inherits:
Thor
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/bookery/cli.rb

Instance Method Summary collapse

Instance Method Details

#new(path) ⇒ Object



20
21
22
23
24
# File 'lib/bookery/cli.rb', line 20

def new(path)
  template = 'basic'
  template = options[:template] if options[:template]
  directory(template, path)
end

#publishObject



28
29
30
31
32
33
34
35
36
# File 'lib/bookery/cli.rb', line 28

def publish
  project_dir = Dir.pwd
  project_dir = options[:project_dir] if options[:project_dir]
  config = YAML.load_file(File.join(project_dir, 'config.yml'))

  project = Project.new(project_dir, config.symbolize_keys)
  publishers = Factories::PublisherFactory.create_publishers(project.generator_config)
  project.publish(publishers)
end

#versionObject



14
15
16
# File 'lib/bookery/cli.rb', line 14

def version
  puts Bookery::VERSION
end