Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 36 lines (26 sloc) 0.86 kb
d3a1134 @brianjlandau Initial commit
brianjlandau authored
1 class Monk < Thor
2 include Thor::Actions
3
4 desc "start ENV", "Start Monk in the supplied environment"
5 def start(env = ENV["RACK_ENV"] || "development")
6 verify_config(env)
7
8 exec "env RACK_ENV=#{env} ruby init.rb"
9 end
10
11 desc "copy_example EXAMPLE, TARGET", "Copies an example file to its destination"
12 def copy_example(example, target = target_file_for(example))
13 File.exists?(target) ? return : say_status(:missing, target)
14 File.exists?(example) ? copy_file(example, target) : say_status(:missing, example)
15 end
16
17 private
18
19 def self.source_root
20 File.dirname(__FILE__)
21 end
22
23 def target_file_for(example_file)
24 example_file.sub(".example", "")
25 end
26
27 def verify_config(env)
28 verify "config/settings.example.yml"
29 end
30
31 def verify(example)
32 copy_example(example) unless File.exists?(target_file_for(example))
33 end
34
35 end
Something went wrong with that request. Please try again.