Module: Berkshelf
- Extended by:
- Mixin::Logging
- Defined in:
- lib/berkshelf.rb,
lib/berkshelf/ui.rb,
lib/berkshelf/cli.rb,
lib/berkshelf/git.rb,
lib/berkshelf/chef.rb,
lib/berkshelf/test.rb,
lib/berkshelf/mixin.rb,
lib/berkshelf/config.rb,
lib/berkshelf/errors.rb,
lib/berkshelf/logger.rb,
lib/berkshelf/version.rb,
lib/berkshelf/location.rb,
lib/berkshelf/lockfile.rb,
lib/berkshelf/resolver.rb,
lib/berkshelf/berksfile.rb,
lib/berkshelf/downloader.rb,
lib/berkshelf/formatters.rb,
lib/berkshelf/chef/config.rb,
lib/berkshelf/mixin/config.rb,
lib/berkshelf/mixin/logging.rb,
lib/berkshelf/base_generator.rb,
lib/berkshelf/commands/shelf.rb,
lib/berkshelf/community_rest.rb,
lib/berkshelf/cookbook_store.rb,
lib/berkshelf/init_generator.rb,
lib/berkshelf/mixin/dsl_eval.rb,
lib/berkshelf/cached_cookbook.rb,
lib/berkshelf/cookbook_source.rb,
lib/berkshelf/formatters/json.rb,
lib/berkshelf/formatters/null.rb,
lib/berkshelf/cookbook_generator.rb,
lib/berkshelf/commands/test_command.rb,
lib/berkshelf/locations/git_location.rb,
lib/berkshelf/locations/path_location.rb,
lib/berkshelf/locations/site_location.rb,
lib/berkshelf/formatters/human_readable.rb,
lib/berkshelf/locations/github_location.rb,
lib/berkshelf/locations/chef_api_location.rb
Defined Under Namespace
Modules: Chef, Formatters, Location, Mixin, UI Classes: AbstractFunction, AmbiguousGitRef, ArgumentError, BaseGenerator, Berksfile, BerksfileNotFound, BerksfileReadError, BerkshelfError, CachedCookbook, ChefAPILocation, ChefConnectionError, Cli, ClientKeyFileNotFound, CommunityREST, CommunitySiteError, Config, ConfigExists, ConfigNotFound, ConfigurationError, ConstraintNotSatisfied, CookbookGenerator, CookbookNotFound, CookbookSource, CookbookStore, CookbookSyntaxError, CookbookValidationFailure, Downloader, DuplicateLocationDefined, DuplicateSourceDefined, EnvironmentNotFound, ExplicitCookbookNotFound, FrozenCookbook, Git, GitError, GitLocation, GitNotFound, GithubLocation, InitGenerator, InsufficientPrivledges, InternalError, InvalidChefAPILocation, InvalidConfiguration, InvalidCookbookFiles, InvalidGitRef, InvalidGitURI, InvalidSiteShortnameError, InvalidVersionConstraint, LicenseNotAllowed, LicenseNotFound, Lockfile, LockfileParserError, MismatchedCookbookName, Mocks, NoSolution, NoVersionForConstraints, OutdatedCookbookSource, PathLocation, Resolver, Shelf, SiteLocation, TestCommand, UnknownCompressionType, UnknownGitHubProtocol, UploadFailure, ValidationFailed
Constant Summary collapse
- DEFAULT_FILENAME =
'Berksfile'.freeze
- Logger =
Ridley.logger
- VERSION =
"2.0.10"
Class Attribute Summary collapse
-
.chef_config ⇒ Berkshelf::Chef::Config
The Chef configuration file.
- .cookbook_store ⇒ Berkshelf::CookbookStore
-
.logger ⇒ Object
Returns the value of attribute logger.
-
.ui ⇒ Thor::Shell::Color, Thor::Shell::Basic
A basic shell on Windows, colored everywhere else.
Class Method Summary collapse
-
.berkshelf_path ⇒ String
Returns the filepath to the location Berskhelf will use for storage; temp files will go here, Cookbooks will be downloaded to or uploaded from here.
- .cookbooks_dir ⇒ Object
-
.formatter ⇒ ~Formatter
Get the appropriate Formatter object based on the formatter classes that have been registered.
-
.mktmpdir ⇒ String
Creates a temporary directory within the Berkshelf path.
- .root ⇒ Pathname
-
.set_format(format_id) ⇒ ~Formatter
Specify the format for output.
- .tmp_dir ⇒ String
Methods included from Mixin::Logging
Class Attribute Details
.chef_config ⇒ Berkshelf::Chef::Config
The Chef configuration file.
59 60 61 |
# File 'lib/berkshelf.rb', line 59 def chef_config @chef_config ||= Berkshelf::Chef::Config.load end |
.cookbook_store ⇒ Berkshelf::CookbookStore
88 89 90 |
# File 'lib/berkshelf.rb', line 88 def cookbook_store @cookbook_store ||= CookbookStore.new(cookbooks_dir) end |
.logger ⇒ Object
Returns the value of attribute logger.
31 32 33 |
# File 'lib/berkshelf.rb', line 31 def logger @logger end |
.ui ⇒ Thor::Shell::Color, Thor::Shell::Basic
Returns A basic shell on Windows, colored everywhere else.
41 42 43 |
# File 'lib/berkshelf.rb', line 41 def ui @ui end |
Class Method Details
.berkshelf_path ⇒ String
Returns the filepath to the location Berskhelf will use for storage; temp files will go here, Cookbooks will be downloaded to or uploaded from here. By default this is ‘~/.berkshelf’ but can be overridden by specifying a value for the ENV variable ‘BERKSHELF_PATH’.
52 53 54 |
# File 'lib/berkshelf.rb', line 52 def berkshelf_path ENV['BERKSHELF_PATH'] || File.('~/.berkshelf') end |
.cookbooks_dir ⇒ Object
83 84 85 |
# File 'lib/berkshelf.rb', line 83 def cookbooks_dir File.join(berkshelf_path, 'cookbooks') end |
.formatter ⇒ ~Formatter
Get the appropriate Formatter object based on the formatter classes that have been registered.
96 97 98 |
# File 'lib/berkshelf.rb', line 96 def formatter @formatter ||= Formatters::HumanReadable.new end |
.mktmpdir ⇒ String
Creates a temporary directory within the Berkshelf path
78 79 80 81 |
# File 'lib/berkshelf.rb', line 78 def mktmpdir FileUtils.mkdir_p(tmp_dir) Dir.mktmpdir(nil, tmp_dir) end |
.root ⇒ Pathname
35 36 37 |
# File 'lib/berkshelf.rb', line 35 def root @root ||= Pathname.new(File.('../', File.dirname(__FILE__))) end |
.set_format(format_id) ⇒ ~Formatter
Specify the format for output
108 109 110 |
# File 'lib/berkshelf.rb', line 108 def set_format(format_id) @formatter = Formatters[format_id].new end |