Class: Pakman::Fetch
- Inherits:
-
Object
- Object
- Pakman::Fetch
- Includes:
- LogUtils::Logging
- Defined in:
- lib/pakman/cli/commands/fetch.rb
Instance Attribute Summary collapse
-
#opts ⇒ Object
readonly
Returns the value of attribute opts.
Instance Method Summary collapse
-
#initialize(opts) ⇒ Fetch
constructor
A new instance of Fetch.
- #run ⇒ Object
Constructor Details
#initialize(opts) ⇒ Fetch
Returns a new instance of Fetch.
9 10 11 |
# File 'lib/pakman/cli/commands/fetch.rb', line 9 def initialize( opts ) @opts = opts end |
Instance Attribute Details
#opts ⇒ Object (readonly)
Returns the value of attribute opts.
13 14 15 |
# File 'lib/pakman/cli/commands/fetch.rb', line 13 def opts @opts end |
Instance Method Details
#run ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/pakman/cli/commands/fetch.rb', line 15 def run logger.debug "fetch_uri: >#{opts.fetch_uri}<" src = opts.fetch_uri uri = URI.parse( src ) logger.debug "scheme: >#{uri.scheme}<, host: >#{uri.host}<, port: >#{uri.port}<, path: >#{uri.path}<" pakname = Pakman.pakname_from_file( uri.path ) logger.debug "pakname: >#{pakname}<" pakpath = File.( pakname, opts.config_path ) logger.debug "pakpath: >#{pakpath}<" Fetcher.new.fetch_pak( src, pakpath ) end |