Class: Integrity::Installer
- Includes:
- FileUtils
- Defined in:
- lib/integrity/installer.rb
Instance Method Summary collapse
Instance Method Details
#install(path) ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/integrity/installer.rb', line 19 def install(path) @root = Pathname(path). if [:heroku] cp_r Pathname(__FILE__).join("../../../config/heroku"), root puts else create_dir_structure copy_template_files edit_template_files puts end end |
#launch ⇒ Object
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/integrity/installer.rb', line 46 def launch require "thin" require "do_sqlite3" port = [:port] || 4567 config = { :database_uri => "sqlite3://#{ENV["HOME"]}/.integrity.db", :base_uri => "http://0.0.0.0:#{[:port]}", :export_directory => "/tmp/integrity-exports" } config.merge!(YAML.load_file([:config])) if [:config] migrate_db(config) Thin::Server.start("0.0.0.0", port, Integrity::App) rescue LoadError => boom $stderr << "Make sure thin and do_sqlite3 are insatalled\n\n" raise end |
#migrate_db(config) ⇒ Object
36 37 38 39 40 41 |
# File 'lib/integrity/installer.rb', line 36 def migrate_db(config) Integrity.new(config) require "integrity/migrations" Integrity.migrate_db end |