Sha256: 84a40a36cc8b98d4a056a164d658176d250028def9855d1b83a34e72f741241a

Contents?: true

Size: 397 Bytes

Versions: 12

Compression:

Stored size: 397 Bytes

Contents

class Spina::ThemeReloader
  delegate :execute_if_updated, :execute, :updated?, to: :updater
  
  def reload!
    theme_paths.each { |path| load path }
  end
  
  private
  
    def updater
      @updater ||= Rails.application.config.file_watcher.new(theme_paths) do 
        reload!
      end
    end
  
    def theme_paths
      Rails.root.glob("config/initializers/themes/*.rb") 
    end
  
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
spina-2.12.0 lib/spina/theme_reloader.rb
spina-2.11.0 lib/spina/theme_reloader.rb
spina-2.10.0 lib/spina/theme_reloader.rb
spina-2.9.1 lib/spina/theme_reloader.rb
spina-2.9.0 lib/spina/theme_reloader.rb
spina-2.8.1 lib/spina/theme_reloader.rb
spina-2.8.0 lib/spina/theme_reloader.rb
spina-2.7.0 lib/spina/theme_reloader.rb
spina-2.6.2 lib/spina/theme_reloader.rb
spina-2.6.1 lib/spina/theme_reloader.rb
spina-2.6.0 lib/spina/theme_reloader.rb
spina-2.5.0 lib/spina/theme_reloader.rb