Sha256: 3d59f5773705222b758a8478f9f82b61b43afc90868bab4feb3364802f8d5453

Contents?: true

Size: 655 Bytes

Versions: 12

Compression:

Stored size: 655 Bytes

Contents

module Docman
  module Builders
    class SymlinkBuilder < Builder

      register_builder :symlink_builder

      def execute
        if File.directory? @context['full_build_path']
          log("Removed dir: #{@context['full_build_path']} because directory is a directory")
          FileUtils.rm_r(@context['full_build_path'])
        end
        Dir.chdir Pathname(@context['full_build_path']).dirname
        `ln -f -s #{@context['target_path']} #{@context['name']}`
        log("Created symlink: #{@context['full_build_path']}")
        @context['build_path']
      end

      def version
        @context['build_path']
      end

    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
docman-0.0.80 lib/docman/builders/symlink_builder.rb
docman-0.0.79 lib/docman/builders/symlink_builder.rb
docman-0.0.78 lib/docman/builders/symlink_builder.rb
docman-0.0.77 lib/docman/builders/symlink_builder.rb
docman-0.0.76 lib/docman/builders/symlink_builder.rb
docman-0.0.75 lib/docman/builders/symlink_builder.rb
docman-0.0.74 lib/docman/builders/symlink_builder.rb
docman-0.0.73 lib/docman/builders/symlink_builder.rb
docman-0.0.72 lib/docman/builders/symlink_builder.rb
docman-0.0.71 lib/docman/builders/symlink_builder.rb
docman-0.0.70 lib/docman/builders/symlink_builder.rb
docman-0.0.69 lib/docman/builders/symlink_builder.rb