Sha256: aa427a9abe6341cb40b97f8e397234829e801f0311c6d6636dbafb541e6d9886

Contents?: true

Size: 630 Bytes

Versions: 13

Compression:

Stored size: 630 Bytes

Contents

module SmallCage
  module BaseHelper
    include ERB::Util

    def _glob(relpath, rex)
      base_dir = Pathname.new(@obj["path"]).parent
      base_dir = base_dir.join(relpath)

      entries = Dir.glob("#{base_dir}/**/*")
      result = []
      entries.each do |path|
        result << path if path.to_s =~ rex
      end
      return result.sort
    end

    def _with(o)
      tmpobj = @obj
      @obj = o
      yield
      @obj = tmpobj
    end
    
    def _load(path)
      path = Pathname.new(path)
      @loader.load(path)
    end
    
    def _erb(body)
      @renderer.render_string(body, @obj)
    end
    
  end
end

Version data entries

13 entries across 13 versions & 2 rubygems

Version Path
bluemark-smallcage-0.1.3 project/standard/_smc/helpers/base_helper.rb
bluemark-smallcage-0.1.4 project/standard/_smc/helpers/base_helper.rb
bluemark-smallcage-0.1.5 project/standard/_smc/helpers/base_helper.rb
smallcage-0.1.7 project/standard/_smc/helpers/base_helper.rb
smallcage-0.1.6 project/standard/_smc/helpers/base_helper.rb
smallcage-0.1.5 project/standard/_smc/helpers/base_helper.rb
smallcage-0.1.4 project/standard/_smc/helpers/base_helper.rb
smallcage-0.1.1 project/standard/_smc/helpers/base_helper.rb
smallcage-0.1.0 project/standard/_smc/helpers/base_helper.rb
smallcage-0.0.8 project/default/_smc/helpers/base_helper.rb
smallcage-0.1.2 project/standard/_smc/helpers/base_helper.rb
smallcage-0.1.3 project/standard/_smc/helpers/base_helper.rb
smallcage-0.0.9 project/base/_smc/helpers/base_helper.rb