Class: Docs::Generators::InstallGenerator

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

Instance Method Summary collapse

Instance Method Details

#installObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/generators/docs/install_generator.rb', line 7

def install
  if Dir.exists?('spec')
    @config_file = "spec/rails_helper.rb"
  elsif Dir.exists?('test')
    @config_file = "test/test_helper.rb"
  else
    puts "It does not appear that you have a test suite installed in your app"
    puts "Please...please use tests"
    return
  end
  configure_smashing_docs
  using_minitest? ? add_minitest_hooks : add_rspec_hooks
  generate_docs_template
end