Class: ExtJS::MVC::PluginBuilder

Inherits:
Builder
  • Object
show all
Defined in:
lib/xmvc/builders/plugin_builder.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ PluginBuilder

Returns a new instance of PluginBuilder.



18
19
20
# File 'lib/xmvc/builders/plugin_builder.rb', line 18

def initialize(name)
  @name = name
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



16
17
18
# File 'lib/xmvc/builders/plugin_builder.rb', line 16

def name
  @name
end

Class Method Details

.instances(args = []) ⇒ Object

returns an array of PluginBuilder instances based on input from the command line. The sole argument should be an array, where the first element will usually be a plugin name, or ‘all’



6
7
8
9
10
11
12
13
14
# File 'lib/xmvc/builders/plugin_builder.rb', line 6

def self.instances(args = [])
  name = args[0] || 'all'

  if name == 'all'
    self.all_plugin_names.collect {|name| ExtMVC::PluginBuilder.new(name)}
  else
    [ExtMVC::PluginBuilder.new(name)]
  end
end

.plugins_directoryObject

The plugins directory, relative to the directory the build command is run from



39
40
41
# File 'lib/xmvc/builders/plugin_builder.rb', line 39

def self.plugins_directory
  "vendor/plugins"
end

Instance Method Details

#descriptionObject



30
31
32
# File 'lib/xmvc/builders/plugin_builder.rb', line 30

def description
  "The #{name} plugin (#{directory_name})"
end

#directory_nameObject



34
35
36
# File 'lib/xmvc/builders/plugin_builder.rb', line 34

def directory_name
  "#{ExtMVC::PluginBuilder.plugins_directory}/#{@name}"
end

#messageObject



26
27
28
# File 'lib/xmvc/builders/plugin_builder.rb', line 26

def message
  "Built the #{name} plugin"
end

#output_filenameObject



22
23
24
# File 'lib/xmvc/builders/plugin_builder.rb', line 22

def output_filename
  "#{directory_name}/#{name}-all.js"
end