Class: Swiftly::Plugin

Inherits:
Package show all
Defined in:
lib/swiftly/plugin.rb

Instance Attribute Summary collapse

Attributes inherited from Package

#location, #name, #status

Class Method Summary collapse

Methods inherited from Package

all, file, gather, load, retrieve, set

Instance Attribute Details

#mupluginObject

Returns the value of attribute muplugin.



6
7
8
# File 'lib/swiftly/plugin.rb', line 6

def muplugin
  @muplugin
end

Class Method Details

.defaultsObject



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/swiftly/plugin.rb', line 10

def self.defaults

  global = Swiftly::Config.load :global

  if File.directory? File.join(global[:sites_path], "#{APP_NAME}folder".capitalize)

    app_folder = File.join(global[:sites_path], "#{APP_NAME}folder".capitalize)

    if File.directory? File.join app_folder, 'plugins'

      plugin_folder = File.join app_folder, 'plugins'

      plugins = Dir.glob(File.join(plugin_folder, '*')).select {|f| File.directory? f}

      plugins.each do |location|

        self.set :plugin, :type => :wordpress do

          name     File.basename location
          location File.join app_folder, 'plugins'
          status   :enabled

        end
      end
    end
  end
end