Class: Docwright::Extractors::AuthExtractor

Inherits:
Object
  • Object
show all
Defined in:
lib/docwright/extractors/auth_extractor.rb

Overview

rubocop:disable Style/Documentation

Constant Summary collapse

CALLBACK_KINDS =
%i[before around after].freeze

Instance Method Summary collapse

Instance Method Details

#generateObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/docwright/extractors/auth_extractor.rb', line 7

def generate
  begin
    Rails.application.eager_load!
  rescue NameError => e
    puts "DocWright: warning — could not eager load all files: #{e.message}"
  end

  controllers = find_controllers
  filter_map = build_filter_map(controllers)
  unprotected = find_unprotected(controllers)

  lines = build_lines(filter_map, unprotected, controllers)

  FileUtils.mkdir_p("docs")
  Docwright::Merger.write("docs/auth_and_permissions.md", lines.join("\n"))
  puts "DocWright: wrote docs/auth_and_permissions.md"
end