Module: Rabal

Includes:
Util
Defined in:
lib/rabal.rb,
lib/rabal/tree.rb,
lib/rabal/util.rb,
lib/rabal/error.rb,
lib/rabal/usage.rb,
lib/rabal/logger.rb,
lib/rabal/gemspec.rb,
lib/rabal/version.rb,
lib/rabal/file_tree.rb,
lib/rabal/plugin/bin.rb,
lib/rabal/plugin/ext.rb,
lib/rabal/action_tree.rb,
lib/rabal/application.rb,
lib/rabal/plugin/core.rb,
lib/rabal/plugin/spec.rb,
lib/rabal/plugin/test.rb,
lib/rabal/plugin_tree.rb,
lib/rabal/project_tree.rb,
lib/rabal/directory_tree.rb,
lib/rabal/plugin/license.rb,
lib/rabal/plugin/website.rb,
lib/rabal/plugin/rubyforge.rb,
lib/rabal/plugin/foundation.rb

Defined Under Namespace

Modules: Log, Plugin, Util, Version Classes: ActionTree, Application, DirectoryTree, FileTree, PathNotFoundError, PluginParameterMissingError, PluginTree, ProjectTree, StandardError, TemplateNotFoundError, Tree, Usage

Constant Summary collapse

KNOWN_WORDS =
{
      "rabal.project" => lambda { |tree| tree.root.project_name }
}
SPEC =
Rabal::Specification.new do |spec|
     spec.name               = "rabal"
     spec.version            = Rabal::VERSION
     spec.rubyforge_project  = "copiousfreetime"
     spec.author             = "Jeremy Hinegardner"
     spec.email              = "[email protected]"
     spec.homepage           = "http://copiousfreetime.rubyforge.org/rabal/"

     spec.summary            = "A tool for bootstrapping project development"
     spec.description        = <<-DESC
     Ruby Architecture for Building Applications and
     Libraries.

     Rabal is a commandline application for bootstrapping,
     packaging and distributing ruby projects.
     DESC

     spec.extra_rdoc_files   = FileList["[A-Z]*"] - FileList["TODO"]
     spec.has_rdoc           = true
     spec.rdoc_main          = "README"
     spec.rdoc_options       = [ "--line-numbers" , "--inline-source" ]

     spec.test_files         = FileList["spec/**/*.rb"]
     spec.executable         = spec.name
     spec.files              = spec.test_files + spec.extra_rdoc_files + 
                               FileList["lib/**/*.rb", "resources/**/*"]

     spec.add_dependency("main", ">= 2.8.0")
     spec.add_dependency("gem_plugin", ">= 0.2.1")
     spec.add_dependency("highline", ">= 1.2.9")
     spec.required_ruby_version  = ">= 1.8.5"

     spec.platform           = Gem::Platform::RUBY

     spec.remote_user        = "jjh"
     spec.local_rdoc_dir     = "doc/rdoc"
     spec.remote_rdoc_dir    = ""
     spec.local_coverage_dir = "doc/coverage"

     spec.remote_site_dir    = ""

end
VERSION =
Version.to_s

Class Method Summary collapse

Methods included from Util

#replace_known_words

Class Method Details

.applicationObject



68
69
70
# File 'lib/rabal.rb', line 68

def application
  @application ||= Rabal::Application.new
end

.application=(app) ⇒ Object



72
73
74
# File 'lib/rabal.rb', line 72

def application=(app)
  @application = app
end

.config_path(*args) ⇒ Object

returns
String

The full expanded path of the config directory

below root_dir. All parameters passed in are joined onto the result. Trailing File::SEPARATOR is guaranteed if args are not present.



32
33
34
# File 'lib/rabal.rb', line 32

def self.config_path(*args)
  self.sub_path("config", *args)
end

.lib_path(*args) ⇒ Object

returns
String

The full expanded path of the lib directory below

root_dir. All parameters passed in are joined onto the result. Trailing File::SEPARATOR is guaranteed if _*args_ are not present.



50
51
52
# File 'lib/rabal.rb', line 50

def self.lib_path(*args)
  self.sub_path("lib", *args)
end

.resource_path(*args) ⇒ Object

returns
String

The full expanded path of the resource directory below

root_dir. All parameters passed in are joined onto the result. Trailing File::SEPARATOR is guaranteed if _*args_ are not present.



41
42
43
# File 'lib/rabal.rb', line 41

def self.resource_path(*args)
  self.sub_path("resources", *args)
end

.root_dirObject

The root directory of the project is considered to be the parent directory of the ‘lib’ directory.

returns
String

The full expanded path of the parent directory of ‘lib’

going up the path from the current file. Trailing File::SEPARATOR is guaranteed.



18
19
20
21
22
23
24
25
# File 'lib/rabal.rb', line 18

def self.root_dir
  unless @root_dir
    path_parts = ::File.expand_path(__FILE__).split(::File::SEPARATOR)
    lib_index  = path_parts.rindex("lib")
    @root_dir = path_parts[0...lib_index].join(::File::SEPARATOR) + ::File::SEPARATOR
  end 
  return @root_dir
end

.sub_path(sub, *args) ⇒ Object



54
55
56
57
# File 'lib/rabal.rb', line 54

def self.sub_path(sub,*args)
  sp = ::File.join(root_dir, sub) + File::SEPARATOR
  sp = ::File.join(sp, *args) if args
end