This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class BlockStoreSubscriber<T: StateType>: StoreSubscriber { | |
| private var updateBlock: (T) -> Void | |
| init(_ updateBlock: @escaping (T) -> Void) { | |
| self.updateBlock = updateBlock | |
| } | |
| func newState(state: T) { | |
| self.updateBlock(state) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'recursive_crawler' | |
| # Just crawl a directory and echo all found filenames | |
| c = RecursiveCrawler.new(->(filename)}{ puts filename }) | |
| c.run('.') | |
| # Crawl a directory and look for video files | |
| c = RecursiveCrawler.new(->(filename)}{ puts filename }, /\A.+\.(avi|mkv|mpg|mpeg|wmv|mp4|m4v|divx)\z/i) | |
| c.run('/path/to/my/movie/collection') |