Class: Objc2swiftAssistant::FileSet
- Inherits:
-
FailableProcessingElement
- Object
- FailableProcessingElement
- Objc2swiftAssistant::FileSet
- Defined in:
- lib/objc2swift_assistant/file_sets.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#configuration ⇒ Object
Returns the value of attribute configuration.
-
#directory_nodes_by_path ⇒ Object
Returns the value of attribute directory_nodes_by_path.
-
#root ⇒ Object
Returns the value of attribute root.
-
#root_dir_node ⇒ Object
Returns the value of attribute root_dir_node.
Attributes inherited from FailableProcessingElement
Instance Method Summary collapse
- #directory_node_for_path(path) ⇒ Object
- #dump(indent, tab, errors_only) ⇒ Object
-
#initialize(root, configuration) ⇒ FileSet
constructor
A new instance of FileSet.
- #make_directory_node(path) ⇒ Object
-
#scan ⇒ Object
Create nodes for all directories and files of interest Use find() to limit stack depth.
Methods inherited from FailableProcessingElement
#add_error, #add_warning, #has_errors, #initiailize
Constructor Details
Instance Attribute Details
#configuration ⇒ Object
Returns the value of attribute configuration.
20 21 22 |
# File 'lib/objc2swift_assistant/file_sets.rb', line 20 def configuration @configuration end |
#directory_nodes_by_path ⇒ Object
Returns the value of attribute directory_nodes_by_path.
19 20 21 |
# File 'lib/objc2swift_assistant/file_sets.rb', line 19 def directory_nodes_by_path @directory_nodes_by_path end |
#root ⇒ Object
Returns the value of attribute root.
17 18 19 |
# File 'lib/objc2swift_assistant/file_sets.rb', line 17 def root @root end |
#root_dir_node ⇒ Object
Returns the value of attribute root_dir_node.
18 19 20 |
# File 'lib/objc2swift_assistant/file_sets.rb', line 18 def root_dir_node @root_dir_node end |
Instance Method Details
#directory_node_for_path(path) ⇒ Object
29 30 31 32 33 34 35 36 37 38 |
# File 'lib/objc2swift_assistant/file_sets.rb', line 29 def directory_node_for_path( path ) node = @directory_nodes_by_path[ path.to_s ] if node.nil? node = make_directory_node( path ) @directory_nodes_by_path[ path.to_s ] = node end return node end |
#dump(indent, tab, errors_only) ⇒ Object
45 46 47 48 49 50 51 52 53 |
# File 'lib/objc2swift_assistant/file_sets.rb', line 45 def dump( indent, tab, errors_only ) if errors_only puts( "\nWARNING: You specified '--structure errors'") puts( " This option (Logging only only the file structure that caused errors) is not yet supported. The full source file structure will be logged.\n\n" ) end @configuration.log_verbose( indent + "File Set") @root_dir_node.dump( indent+tab, tab, errors_only ) end |
#make_directory_node(path) ⇒ Object
40 41 42 43 |
# File 'lib/objc2swift_assistant/file_sets.rb', line 40 def make_directory_node( path ) node = DirectoryNode.new( path, self ) node end |
#scan ⇒ Object
Create nodes for all directories and files of interest Use find() to limit stack depth
57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/objc2swift_assistant/file_sets.rb', line 57 def scan() @root.find() do |path| if path.directory? process_directory( path ) else process_file( path ) end end @configuration.log_verbose( "Processed #{@directory_nodes_by_path.size} directories.") collect_active_file_nodes() end |