Class: Puppet::ModuleTool::Applications::Unpacker
- Inherits:
-
Application
- Object
- Application
- Puppet::ModuleTool::Applications::Unpacker
- Defined in:
- lib/puppet/module_tool/applications/unpacker.rb
Constant Summary
Constants inherited from Application
Application::DOCPATTERN, Application::SHOULD_PARSE_CONFIG_DEPRECATION_MSG
Constants included from Util
Util::AbsolutePathPosix, Util::AbsolutePathWindows, Util::DEFAULT_POSIX_MODE, Util::DEFAULT_WINDOWS_MODE
Constants included from Util::POSIX
Util::POSIX::LOCALE_ENV_VARS, Util::POSIX::USER_ENV_VARS
Constants included from Util::SymbolicFileMode
Util::SymbolicFileMode::SetGIDBit, Util::SymbolicFileMode::SetUIDBit, Util::SymbolicFileMode::StickyBit, Util::SymbolicFileMode::SymbolicMode, Util::SymbolicFileMode::SymbolicSpecialToBit
Instance Attribute Summary
Attributes inherited from Application
Instance Method Summary collapse
-
#build_dir ⇒ Pathname
Obtain a suitable temporary path for building and unpacking tarballs.
-
#initialize(filename, options = {}) ⇒ Unpacker
constructor
A new instance of Unpacker.
- #run ⇒ Object
Methods inherited from Application
[], #app_defaults, available_application_names, banner, clear!, clear?, clear_everything_for_tests, #configure_indirector_routes, controlled_run, exit, find, #handle_logdest_arg, #handlearg, #help, #initialize_app_defaults, interrupted?, #main, #name, option, option_parser_commands, #parse_options, #preinit, restart!, restart_requested?, #run_command, run_mode, #set_log_level, #setup, #setup_logs, should_not_parse_config, should_parse_config, should_parse_config?, stop!, stop_requested?, try_load_class
Methods included from Util
absolute_path?, activerecord_version, benchmark, binread, chuser, classproxy, deterministic_rand, execfail, execpipe, execute, exit_on_fail, logmethods, memory, path_to_uri, pretty_backtrace, proxy, replace_file, safe_posix_fork, symbolizehash, thinmark, uri_to_path, which, withenv, withumask
Methods included from Util::POSIX
#get_posix_field, #gid, #idfield, #methodbyid, #methodbyname, #search_posix_field, #uid
Methods included from Util::SymbolicFileMode
#normalize_symbolic_mode, #symbolic_mode_to_int, #valid_symbolic_mode?
Constructor Details
#initialize(filename, options = {}) ⇒ Unpacker
Returns a new instance of Unpacker.
8 9 10 11 12 13 14 15 |
# File 'lib/puppet/module_tool/applications/unpacker.rb', line 8 def initialize(filename, = {}) @filename = Pathname.new(filename) parsed = parse_filename(filename) @module_name = parsed[:module_name] super() @module_path = Pathname([:target_dir]) @module_dir = @module_path + parsed[:dir_name] end |
Instance Method Details
#build_dir ⇒ Pathname
Obtain a suitable temporary path for building and unpacking tarballs
29 30 31 |
# File 'lib/puppet/module_tool/applications/unpacker.rb', line 29 def build_dir Puppet::Forge::Cache.base_path + "tmp-unpacker-#{Digest::SHA1.hexdigest(@filename.basename.to_s)}" end |
#run ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'lib/puppet/module_tool/applications/unpacker.rb', line 17 def run extract_module_to_install_dir # Return the Pathname object representing the directory where the # module release archive was unpacked the to, and the module release # name. @module_dir end |