Class: RServiceBus2::AppResourceDir
- Inherits:
-
AppResource
- Object
- AppResource
- RServiceBus2::AppResourceDir
- Defined in:
- lib/rservicebus2/appresource/dir.rb
Overview
AppResourceDir
Instance Attribute Summary
Attributes inherited from AppResource
Instance Method Summary collapse
-
#connect(uri) ⇒ Object
rubocop:disable Metrics/AbcSize,Metrics/MethodLength.
Methods inherited from AppResource
#_connect, #begin, #commit, #finished, #initialize, #reconnect, #resource, #rollback
Constructor Details
This class inherits a constructor from RServiceBus2::AppResource
Instance Method Details
#connect(uri) ⇒ Object
rubocop:disable Metrics/AbcSize,Metrics/MethodLength
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/rservicebus2/appresource/dir.rb', line 7 def connect(uri) begin input_dir = Dir.new(uri.path) unless File.writable?(uri.path) puts "*** Warning. Directory is not writable, #{uri.path}." puts "*** Warning. Make the directory, #{uri.path}, writable and try again." end rescue Errno::ENOENT puts "***** Directory does not exist, #{uri.path}." puts "***** Create the directory, #{uri.path}, and try again." puts "***** eg, mkdir #{uri.path}" abort rescue Errno::ENOTDIR puts "***** The specified path does not point to a directory, #{uri.path}." puts "***** Either repoint path to a directory, or remove, #{uri.path}, and create it as a directory." puts "***** eg, rm #{uri.path} && mkdir #{uri.path}" abort end input_dir end |