lib/active_admin/asset_registration.rb in activeadmin-0.6.0 vs lib/active_admin/asset_registration.rb in activeadmin-0.6.1

- old
+ new

@@ -1,47 +1,29 @@ module ActiveAdmin module AssetRegistration - # Stylesheets - - def register_stylesheet(*args) - stylesheets << ActiveAdmin::Stylesheet.new(*args) + def register_stylesheet(path, options = {}) + stylesheets[path] = options end def stylesheets - @stylesheets ||= [] + @stylesheets ||= {} end def clear_stylesheets! - @stylesheets = [] + @stylesheets = {} end - - # Javascripts - def register_javascript(name) - javascripts << name + javascripts.add name end def javascripts - @javascripts ||= [] + @javascripts ||= Set.new end def clear_javascripts! - @javascripts = [] + @javascripts = Set.new end end - - # Wrapper class for stylesheet registration - class Stylesheet - - attr_reader :options, :path - - def initialize(*args) - @options = args.extract_options! - @path = args.first if args.first - end - - end - end