Class: JobSpec::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/job_spec/cli.rb

Instance Method Summary collapse

Instance Method Details

#buildObject



9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/job_spec/cli.rb', line 9

def build
  puts "Looking in '#{options[:in]}' for roles... "
  role_files(options[:in]).each do |f|
    require f
  end

  FileUtils.mkdir_p(path_relative_to_pwd(options[:out]))
  JobSpec::Role.add_expectations(JobSpec::AdhocExpectations.roles)
  Role.definitions.each do |role|
    puts "Saving #{role.name} to #{safe_role_out_path(role)}..."
    File.write(safe_role_out_path(role), RenderAsMarkdown.new(role).render)
  end
  puts 'Finished.'
end

#versionObject



27
28
29
# File 'lib/job_spec/cli.rb', line 27

def version
  puts "jobspec v#{JobSpec::VERSION}"
end