Sha256: 19dd26e10cab82cfcf0e31f4b330babe25a86362653bb9bf9acfe5ce404cef7a

Contents?: true

Size: 781 Bytes

Versions: 113

Compression:

Stored size: 781 Bytes

Contents

# frozen_string_literal: true

module Avm
  module EacLatexBase0
    module Sources
      class Build
        class File
          module TexSource
            class << self
              def match?(subpath)
                ::File.extname(subpath) == '.tex'
              end
            end

            private

            def copy(target_path)
              ::File.write(target_path, target_content)
            end

            def target_content
              s = ::File.read(source_path)
              replacements.each do |from, to|
                s = s.gsub(from, to)
              end
              s
            end

            def replacements
              { '%dir%' => ::File.dirname(subpath) }
            end
          end
        end
      end
    end
  end
end

Version data entries

113 entries across 113 versions & 2 rubygems

Version Path
avm-eac_latex_base0-0.3.2 lib/avm/eac_latex_base0/sources/build/file/tex_source.rb
eac_tools-0.85.1 sub/avm-eac_latex_base0/lib/avm/eac_latex_base0/sources/build/file/tex_source.rb
eac_tools-0.85.0 sub/avm-eac_latex_base0/lib/avm/eac_latex_base0/sources/build/file/tex_source.rb
eac_tools-0.84.2 sub/avm-eac_latex_base0/lib/avm/eac_latex_base0/sources/build/file/tex_source.rb
eac_tools-0.84.1 sub/avm-eac_latex_base0/lib/avm/eac_latex_base0/sources/build/file/tex_source.rb
eac_tools-0.84.0 sub/avm-eac_latex_base0/lib/avm/eac_latex_base0/sources/build/file/tex_source.rb
eac_tools-0.83.0 sub/avm-eac_latex_base0/lib/avm/eac_latex_base0/sources/build/file/tex_source.rb
eac_tools-0.82.0 sub/avm-eac_latex_base0/lib/avm/eac_latex_base0/sources/build/file/tex_source.rb
eac_tools-0.81.0 sub/avm-eac_latex_base0/lib/avm/eac_latex_base0/sources/build/file/tex_source.rb
eac_tools-0.80.0 sub/avm-eac_latex_base0/lib/avm/eac_latex_base0/sources/build/file/tex_source.rb
eac_tools-0.79.0 sub/avm-eac_latex_base0/lib/avm/eac_latex_base0/sources/build/file/tex_source.rb
eac_tools-0.78.0 sub/avm-eac_latex_base0/lib/avm/eac_latex_base0/sources/build/file/tex_source.rb
eac_tools-0.77.1 sub/avm-eac_latex_base0/lib/avm/eac_latex_base0/sources/build/file/tex_source.rb
eac_tools-0.77.0 sub/avm-eac_latex_base0/lib/avm/eac_latex_base0/sources/build/file/tex_source.rb
eac_tools-0.76.1 sub/avm-eac_latex_base0/lib/avm/eac_latex_base0/sources/build/file/tex_source.rb
eac_tools-0.76.0 sub/avm-eac_latex_base0/lib/avm/eac_latex_base0/sources/build/file/tex_source.rb
eac_tools-0.75.2 sub/avm-eac_latex_base0/lib/avm/eac_latex_base0/sources/build/file/tex_source.rb
eac_tools-0.75.1 sub/avm-eac_latex_base0/lib/avm/eac_latex_base0/sources/build/file/tex_source.rb
eac_tools-0.75.0 sub/avm-eac_latex_base0/lib/avm/eac_latex_base0/sources/build/file/tex_source.rb
eac_tools-0.74.1 sub/avm-eac_latex_base0/lib/avm/eac_latex_base0/sources/build/file/tex_source.rb