Sha256: a8e7f3a6268c6cf46ee308fd053bf4375759d019d6c5e959b97b85270ec2054e

Contents?: true

Size: 502 Bytes

Versions: 23

Compression:

Stored size: 502 Bytes

Contents

require 'pathname'
require 'dragonfly/job/step'

module Dragonfly
  class Job
    class FetchFile < Step
      def initialize(job, path)
        super(job, path.to_s)
      end
      def init
        job.url_attributes.name = filename
      end

      def path
        @path ||= File.expand_path(args.first)
      end

      def filename
        @filename ||= File.basename(path)
      end

      def apply
        job.content.update(Pathname.new(path), 'name' => filename)
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
dragonfly-1.4.1 lib/dragonfly/job/fetch_file.rb
dragonfly-1.4.0 lib/dragonfly/job/fetch_file.rb
dragonfly-1.3.0 lib/dragonfly/job/fetch_file.rb
dragonfly-1.2.1 lib/dragonfly/job/fetch_file.rb
dragonfly-1.2.0 lib/dragonfly/job/fetch_file.rb
dragonfly-1.1.5 lib/dragonfly/job/fetch_file.rb
dragonfly-1.1.4 lib/dragonfly/job/fetch_file.rb
dragonfly-1.1.3 lib/dragonfly/job/fetch_file.rb
dragonfly-1.1.2 lib/dragonfly/job/fetch_file.rb
dragonfly-1.1.1 lib/dragonfly/job/fetch_file.rb
dragonfly-1.1.0 lib/dragonfly/job/fetch_file.rb
dragonfly-1.0.12 lib/dragonfly/job/fetch_file.rb
dragonfly-1.0.11 lib/dragonfly/job/fetch_file.rb
dragonfly-1.0.10 lib/dragonfly/job/fetch_file.rb
dragonfly-1.0.9 lib/dragonfly/job/fetch_file.rb
dragonfly-1.0.8 lib/dragonfly/job/fetch_file.rb
dragonfly-1.0.7 lib/dragonfly/job/fetch_file.rb
dragonfly-1.0.6 lib/dragonfly/job/fetch_file.rb
dragonfly-1.0.5 lib/dragonfly/job/fetch_file.rb
dragonfly-1.0.4 lib/dragonfly/job/fetch_file.rb