Class: SourceMonitor::Engine

Inherits:
Rails::Engine
  • Object
show all
Defined in:
lib/source_monitor/engine.rb

Class Method Summary collapse

Class Method Details

.asset_precompile_entriesObject



91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# File 'lib/source_monitor/engine.rb', line 91

def asset_precompile_entries
  engine_root = SourceMonitor::Engine.root
  asset_roots = {
    images: engine_root.join("app/assets/images"),
    svgs: engine_root.join("app/assets/svgs")
  }

  asset_roots.flat_map do |_, base_path|
    Dir[base_path.join("source_monitor/**/*").to_s].filter_map do |absolute_path|
      next unless File.file?(absolute_path)
      next if File.basename(absolute_path).start_with?(".")

      Pathname.new(absolute_path).relative_path_from(base_path).to_s
    end
  end
end

.table_name_prefixObject



9
10
11
# File 'lib/source_monitor/engine.rb', line 9

def self.table_name_prefix
  SourceMonitor.config.models.table_name_prefix
end