Module: Wright

Defined in:
lib/wright/logger.rb,
lib/wright/dsl.rb,
lib/wright/cli.rb,
lib/wright/util.rb,
lib/wright/config.rb,
lib/wright/dry_run.rb,
lib/wright/version.rb,
lib/wright/provider.rb,
lib/wright/resource.rb,
lib/wright/util/user.rb,
lib/wright/util/file.rb,
lib/wright/util/color.rb,
lib/wright/provider/user.rb,
lib/wright/resource/file.rb,
lib/wright/resource/user.rb,
lib/wright/provider/file.rb,
lib/wright/resource/group.rb,
lib/wright/provider/group.rb,
lib/wright/util/file_owner.rb,
lib/wright/resource/package.rb,
lib/wright/provider/symlink.rb,
lib/wright/resource/symlink.rb,
lib/wright/provider/package.rb,
lib/wright/provider/directory.rb,
lib/wright/resource/directory.rb,
lib/wright/provider/package/yum.rb,
lib/wright/provider/package/apt.rb,
lib/wright/util/file_permissions.rb,
lib/wright/provider/user/gnu_passwd.rb,
lib/wright/provider/group/gnu_passwd.rb,
lib/wright/util/recursive_autoloader.rb,
lib/wright/provider/package/homebrew.rb,
lib/wright/util/stolen_from_activesupport.rb,
lib/wright/provider/user/darwin_directory_service.rb,
lib/wright/provider/group/darwin_directory_service.rb,
lib/wright.rb

Overview

Top-level namespace for wright.

Defined Under Namespace

Modules: DSL, Util Classes: CLI, Config, Logger, Provider, Resource

Constant Summary collapse

VERSION =

Current wright version

'0.3.2'

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.logLogger


69
70
71
# File 'lib/wright/logger.rb', line 69

def log
  @log
end

Class Method Details

.activate_dry_runvoid

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method returns an undefined value.

Activates dry-run mode.


36
37
38
# File 'lib/wright/dry_run.rb', line 36

def self.activate_dry_run
  @dry_run = true
end

.dry_runObject

Runs a block in dry-run mode.

Examples:

Wright.dry_run do
  symlink '/tmp/fstab' do |s|
    s.to = '/etc/fstab'
  end
end

25
26
27
28
29
30
31
# File 'lib/wright/dry_run.rb', line 25

def self.dry_run
  saved_dry_run = @dry_run
  @dry_run = true
  yield
ensure
  @dry_run = saved_dry_run
end

.dry_run?Bool

Checks if dry-run mode is currently active.

Examples:

puts 'Just a dry-run...' if Wright.dry_run?

11
12
13
# File 'lib/wright/dry_run.rb', line 11

def self.dry_run?
  @dry_run
end