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
    <<~TXT

      # LazyApiDoc
      #{LazyApiDoc.path}/api.yml
      #{LazyApiDoc.path}/examples/*.json
    TXT
  end

  install_rspec if Dir.exist?('spec')

  install_minitest if Dir.exist?('test')
end