Class: Ecrire::Theme::Engine
- Inherits:
-
Rails::Engine
- Object
- Rails::Engine
- Ecrire::Theme::Engine
- Defined in:
- lib/ecrire/theme/engine.rb
Instance Method Summary collapse
Instance Method Details
#has_migrations? ⇒ Boolean
44 45 46 |
# File 'lib/ecrire/theme/engine.rb', line 44 def has_migrations? false end |
#paths ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/ecrire/theme/engine.rb', line 22 def paths @paths ||= begin paths = Rails::Paths::Root.new(root_path) paths.add 'app/views', with: 'views' paths.add 'app/controllers', with: 'controllers', eager_load: true paths.add 'app/assets', with: 'assets', glob: '*' paths.add 'app/helpers', with: 'helpers', eager_load: true paths.add 'config/routes.rb', with: 'routes.rb' paths.add 'config/locales', with: 'locales', glob: '**/*.{rb,yml}' paths.add 'config/environments', with: 'environments', glob: "#{Rails.env}.rb" paths.add 'public', with: 'tmp/public' paths.add "lib/assets", glob: "*" paths.add "vendor/assets", glob: "*" paths.add "lib/tasks" paths end end |
#root_path(file = 'config.ru') ⇒ Object
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/ecrire/theme/engine.rb', line 48 def root_path(file = 'config.ru') begin pathname = Pathname.pwd while !(pathname + file).exist? do pathname = pathname.parent if pathname.root? raise "Could not find #{file}. Type 'ecrire new blog_name' to create a new blog" break end end pathname end end |