Module: Albacore

Defined in:
lib/albacore/albacore_module.rb,
lib/albacore.rb,
lib/albacore/dsl.rb,
lib/albacore/facts.rb,
lib/albacore/semver.rb,
lib/albacore/logging.rb,
lib/albacore/package.rb,
lib/albacore/project.rb,
lib/albacore/version.rb,
lib/albacore/app_spec.rb,
lib/albacore/cmd_config.rb,
lib/albacore/config_dsl.rb,
lib/albacore/application.rb,
lib/albacore/nuget_model.rb,
lib/albacore/ext/teamcity.rb,
lib/albacore/fpm_app_spec.rb,
lib/albacore/package_repo.rb,
lib/albacore/cpack_app_spec.rb,
lib/albacore/task_types/build.rb,
lib/albacore/tasks/albasemver.rb,
lib/albacore/app_spec/defaults.rb,
lib/albacore/app_spec/iis_site.rb,
lib/albacore/task_types/asmver.rb,
lib/albacore/tasks/projectlint.rb,
lib/albacore/tasks/versionizer.rb,
lib/albacore/cross_platform_cmd.rb,
lib/albacore/task_types/nugets_pack.rb,
lib/albacore/task_types/test_runner.rb,
lib/albacore/task_types/nugets_restore.rb,
lib/albacore/errors/command_failed_error.rb,
lib/albacore/errors/invalid_app_spec_error.rb,
lib/albacore/errors/command_not_found_error.rb,
lib/albacore/errors/unfilled_property_error.rb,
lib/albacore/task_types/nugets_authentication.rb

Overview

note: this is a Windows provider

Defined Under Namespace

Modules: AlbaSemVer, Asmver, Build, CmdConfig, ConfigDSL, CrossPlatformCmd, DSL, Ext, Facts, Logging, NugetModel, NugetsAuthentication, NugetsPack, NugetsRestore, Paths, Tasks, TestRunner, Tools Classes: AppSpec, Application, CommandFailedError, CommandNotFoundError, ConfigurationNotFoundError, CpackAppSpec, FpmAppSpec, InvalidAppSpecError, Package, PackageRepo, Project, SemVer, UnfilledPropertyError

Constant Summary collapse

VERSION =
"2.0.0"

Class Method Summary collapse

Class Method Details

.application ⇒ Object

Accessor for the Albacore application. Configuration and similar singleton values will be stored in this instance. Multiple calls will yield the same instance.



12
13
14
# File 'lib/albacore/albacore_module.rb', line 12

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

.define_task(*args, &block) ⇒ Object

Defines a new task with all of what that entails: will call application.define_task.



25
26
27
28
29
# File 'lib/albacore/albacore_module.rb', line 25

def define_task *args, &block
  args = [caller[0][/`.*'/][1..-2]] if args.nil? or args.empty?
  # delegate to the application singleton

  application.define_task *args, &block
end

.events ⇒ Object



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

def events
  @events ||= {}
end

.log_level=(level) ⇒ Object

Set the global albacore logging level.



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

def log_level= level
  application.logger.level = level
end

.publish(event, obj) ⇒ Object



51
52
53
54
55
# File 'lib/albacore/albacore_module.rb', line 51

def publish event, obj
  if events.member? event
    events[event].each { |m| m.call(obj) }
  end
end

.puts(*args) ⇒ Object

Use to write to STDOUT (by default)



37
38
39
# File 'lib/albacore/albacore_module.rb', line 37

def puts *args
  application.puts *args
end

.set_application(app) ⇒ Object

set the application -- good for testing the infrastructure of albacore by resetting the state after each test



19
20
21
# File 'lib/albacore/albacore_module.rb', line 19

def set_application app
  @application = app
end

.subscribe(event, &block) ⇒ Object



45
46
47
48
49
# File 'lib/albacore/albacore_module.rb', line 45

def subscribe event, &block
  event = event.to_sym unless event.is_a? Symbol
  events[event] ||= Set.new
  events[event].add block
end

.windows? ⇒ Boolean

Gets whether we're running under Windows.

Returns:

  • (Boolean)


59
60
61
# File 'lib/albacore/albacore_module.rb', line 59

def windows?
  !!::Rake::Win32.windows?
end