lib/hx/backend/rawfiles.rb in hx-0.7.4 vs lib/hx/backend/rawfiles.rb in hx-0.8.2
- old
+ new
@@ -19,11 +19,10 @@
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-require 'rubygems'
require 'pathname'
require 'hx'
module Hx
module Backend
@@ -54,12 +53,14 @@
text = yield text
Hx.write_file(pathname, text)
self
end
- def each_entry_path
+ def each_entry_path(selector)
Pathname.glob(@entry_dir + '**/*') do |pathname|
- yield pathname_to_path(pathname) if pathname.file?
+ next unless pathname.file?
+ path = pathname_to_path(pathname)
+ yield path if selector.accept? path
end
self
end
def get_entry(path)