class Refinery::Plugins
Attributes
plugins[R]
Public Class Methods
always_allowed()
click to toggle source
# File lib/refinery/plugins.rb, line 57 def always_allowed new registered.select(&:always_allow_access) end
new(*args)
click to toggle source
# File lib/refinery/plugins.rb, line 8 def initialize(*args) @plugins = Array.new(*args) end
registered()
click to toggle source
# File lib/refinery/plugins.rb, line 61 def registered @registered_plugins ||= new end
Public Instance Methods
find_by_name(name)
click to toggle source
# File lib/refinery/plugins.rb, line 14 def find_by_name(name) detect { |plugin| plugin.name == name } end
Also aliased as: []
find_by_title(title)
click to toggle source
# File lib/refinery/plugins.rb, line 19 def find_by_title(title) detect { |plugin| plugin.title == title } end
names()
click to toggle source
# File lib/refinery/plugins.rb, line 29 def names map(&:name) end
pathnames()
click to toggle source
# File lib/refinery/plugins.rb, line 33 def pathnames map(&:pathname).compact.uniq end
titles()
click to toggle source
# File lib/refinery/plugins.rb, line 37 def titles map(&:title) end
update_positions(plugin_list)
click to toggle source
# File lib/refinery/plugins.rb, line 49 def update_positions(plugin_list) plugins = plugin_list.map {|p| find_by_name(p) }.reject(&:blank?) plugins.each_with_index do |plugin, index| plugin.update_attributes(position: index) end end
Private Instance Methods
prioritised()
click to toggle source
# File lib/refinery/plugins.rb, line 70 def prioritised Refinery::Core.config.plugin_priority.map { |name| find_by_name(name) } end