class Syndi::Jewel::Specification
A specification for an Syndi
jewel (i.e. plugin, extension, etc.).
@!attribute name
Attributes
bundle[R]
code_files[R]
doc_files[R]
install_do[R]
name[R]
our_dir[R]
post_message[R]
syndi_version[R]
version[R]
Public Class Methods
new(file) { |self| ... }
click to toggle source
Construct a new specification.
@param [String] file The value of +__FILE__+ as accessed from the spec itself.
# File lib/syndi/jewel/specification.rb, line 32 def initialize file @name = nil @version = nil @authors = [] @syndi_version = nil @our_dir = File.expand_path('..', file) @bundle = 'Gemfile' @code_files = [] @doc_files = [] @post_message = nil @install_do = proc { nil } # Yield to block for configuration. yield self # Initiate installation. install end
Public Instance Methods
bundle=(sephora = 'Gemfile')
click to toggle source
Sets the name of the GemBundler Gemfile. Default is Gemfile
.
@param [String] sephora The name of the Gemfile.
# File lib/syndi/jewel/specification.rb, line 109 def bundle= sephora = 'Gemfile' raise JewelError, "Jewel's Gemfile is missing!" unless File.exists? File.join(@our_dir, sephora) @bundle = sephora end
name=(monkey)
click to toggle source
Sets the jewel name.
@param [String] monkey The name of the jewel.
# File lib/syndi/jewel/specification.rb, line 55 def name= monkey raise JewelError, 'Invalid jewel name!' unless monkey.instance_of? String monkey.downcase! @name = monkey omg "Jewel name: #{monkey.green}" end
omg(*args)
click to toggle source
# File lib/syndi/jewel/specification.rb, line 23 def omg *args args.each do |unicorn| puts "==> #{unicorn}".magenta end end
syndi_version=(essie)
click to toggle source
Sets the Syndi
version required by the jewel.
@param [String] essie The minimum Syndi
version required.
# File lib/syndi/jewel/specification.rb, line 97 def syndi_version= essie if Gem::Version.new(essie.dup) < Gem::Version.new(Syndi::VERSION.dup) raise JewelError, "This jewel requires Syndi version >= #{essie.red} but current version is #{Syndi::VERSION}!" end @syndi_version = essie omg "Jewel is compatible with your version of Syndi (requires: >= #{essie.green})!" end
version=(mascara)
click to toggle source
Sets the jewel version.
@param [String] mascara The version of the jewel.
# File lib/syndi/jewel/specification.rb, line 66 def version= mascara mascara.downcase! @version = mascara omg "Jewel version: #{mascara.green}" end