Class: LazyApiDoc::Generators::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/lazy_api_doc/install_generator.rb

Instance Method Summary collapse

Instance Method Details

#installObject



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/generators/lazy_api_doc/install_generator.rb', line 10

def install
  copy_file 'public/index.html', "#{LazyApiDoc.path}/index.html"
  copy_file 'public/layout.yml', "#{LazyApiDoc.path}/layout.yml"

  append_to_file '.gitignore' do
    "\n      # LazyApiDoc\n      \#{LazyApiDoc.path}/api.yml\n      \#{LazyApiDoc.path}/examples/*.json\n    TXT\n  end\n\n  install_rspec if Dir.exist?('spec')\n\n  install_minitest if Dir.exist?('test')\nend\n"