Sha256: b6a1c741af38fa304bf23a52c73d9d050ab67d9d7a7cbbdb2a955ec538535c25

Contents?: true

Size: 235 Bytes

Versions: 2

Compression:

Stored size: 235 Bytes

Contents

require 'pathname'

module Awestruct
  module Extensions
    module Relative

      def relative(href, p = page)
        Pathname.new(href).relative_path_from(Pathname.new(File.dirname(p.output_path))).to_s
      end

    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
awestruct-0.4.8 lib/awestruct/extensions/relative.rb
awestruct-0.4.7 lib/awestruct/extensions/relative.rb