Module: Cupper

Defined in:
lib/cupper/platform_collector.rb,
lib/cupper.rb,
lib/cupper/cli.rb,
lib/cupper/entity.rb,
lib/cupper/errors.rb,
lib/cupper/recipe.rb,
lib/cupper/collect.rb,
lib/cupper/project.rb,
lib/cupper/version.rb,
lib/cupper/cookbook.rb,
lib/cupper/cupperfile.rb,
lib/cupper/environment.rb,
lib/cupper/ohai_plugins.rb,
lib/cupper/config/config.rb,
lib/cupper/cookbook_file.rb,
lib/cupper/plugins/cupper/arch.rb,
lib/cupper/plugins/cupper/debian.rb

Overview

REVIEW: This should be review in some point in the future The PlatformCollector is a module that defines all the methods used to extract

the information about the platform. It is a little pointless in terms of implementation
but is good to know what method should be implemented.

Defined Under Namespace

Modules: Config, Entity, Errors, PlatformCollector Classes: Arch, Attribute, Cli, Collect, Cookbook, CookbookFile, Cupperfile, Debian, Environment, OhaiPlugin, Project, Recipe, Structure

Constant Summary collapse

CUPPER_ROOT =
File.expand_path(File.dirname(__FILE__))
OHAI_PLUGINS_PATH =
CUPPER_ROOT + '/cupper/plugins/ohai'
CUPPER_PLUGINS_PATH =
CUPPER_ROOT + '/cupper/plugins/cupper'
TEMPLATE_PATH =
CUPPER_ROOT + '/cupper/templates'
ENVIRONMENT =
Environment.new
VERSION =
'0.2.1'.freeze

Class Method Summary collapse

Class Method Details

.suppress_outputObject

When necessary, use this method to supress outputs

don't suppress Exeptions


52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/cupper/cli.rb', line 52

def self.suppress_output
  begin
    origin_stderr = $stderr.clone
    origin_stdout = $stdout.clone
    $stderr.reopen(File.new('/dev/null', 'w'))
    $stdout.reopen(File.new('/dev/null', 'w'))
    retval = yield
  rescue Exception => e
    $stderr.reopen(origin_stderr)
    $stdout.reopen(origin_stdout)
    raise e
  ensure
    $stderr.reopen(origin_stderr)
    $stdout.reopen(origin_stdout)
  end
  retval
end