File: railtie.rb

package info (click to toggle)
ruby-task-list 2.3.2-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 256 kB
  • sloc: ruby: 308; javascript: 58; sh: 14; makefile: 8
file content (20 lines) | stat: -rw-r--r-- 419 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
class TaskList

  def self.root_path
    @root_path ||= Pathname.new("/usr/share/ruby-task-list")
  end

  def self.asset_paths
    @paths ||= Dir[root_path.join("app/assets/*")]
  end

  if defined? ::Rails::Railtie
    class Railtie < ::Rails::Railtie
      initializer "task_list" do |app|
        TaskList.asset_paths.each do |path|
          app.config.assets.paths << path
        end
      end
    end
  end
end