class Object

Public Instance Methods

path_glob(dir) click to toggle source
# File lib/job_spec/cli.rb, line 37
def path_glob(dir)
  path_relative_to_pwd(File.join(dir, '**/*.rb'))
end
path_relative_to_pwd(path) click to toggle source
# File lib/job_spec/cli.rb, line 33
def path_relative_to_pwd(path)
  File.expand_path(path, Dir.pwd)
end
role_files(dir) click to toggle source
# File lib/job_spec/cli.rb, line 41
def role_files(dir)
  Dir[path_glob(dir)]
end
safe_role_name(role) click to toggle source
# File lib/job_spec/cli.rb, line 45
def safe_role_name(role)
  "#{role.name.downcase.gsub(' ', '_').gsub(/[^a-z_]+/, '')}.md"
end
safe_role_out_path(role) click to toggle source
# File lib/job_spec/cli.rb, line 49
def safe_role_out_path(role)
  File.join(path_relative_to_pwd(options[:out]), safe_role_name(role))
end