lib/berkshelf.rb in berkshelf-0.4.0.rc1 vs lib/berkshelf.rb in berkshelf-0.4.0.rc2
- old
+ new
@@ -22,11 +22,13 @@
autoload :Cli, 'berkshelf/cli'
autoload :DSL, 'berkshelf/dsl'
autoload :Git, 'berkshelf/git'
autoload :Berksfile, 'berkshelf/berksfile'
autoload :Lockfile, 'berkshelf/lockfile'
+ autoload :BaseGenerator, 'berkshelf/base_generator'
autoload :InitGenerator, 'berkshelf/init_generator'
+ autoload :CookbookGenerator, 'berkshelf/cookbook_generator'
autoload :CookbookSource, 'berkshelf/cookbook_source'
autoload :CookbookStore, 'berkshelf/cookbook_store'
autoload :CachedCookbook, 'berkshelf/cached_cookbook'
autoload :TXResult, 'berkshelf/tx_result'
autoload :TXResultSet, 'berkshelf/tx_result_set'
@@ -47,20 +49,30 @@
def ui
@ui ||= Chef::Knife::UI.new(null_stream, null_stream, STDIN, {})
end
- # Returns the filepath to the location Cookbooks will be downloaded to
- # or uploaded from. By default this is '~/.berkshelf' but can be overridden
- # by specifying a value for the ENV variable 'BERKSHELF_PATH'.
+ # 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'.
#
# @return [String]
def berkshelf_path
ENV["BERKSHELF_PATH"] || DEFAULT_STORE_PATH
end
+ def tmp_dir
+ File.join(berkshelf_path, "tmp")
+ end
+
+ def cookbooks_dir
+ File.join(berkshelf_path, "cookbooks")
+ end
+
def cookbook_store
- @cookbook_store ||= CookbookStore.new(berkshelf_path)
+ @cookbook_store ||= CookbookStore.new(cookbooks_dir)
end
def downloader
@downloader ||= Downloader.new(cookbook_store)
end