Class: Dragonfly::Job::FetchFile
- Inherits:
-
Step
show all
- Defined in:
- lib/dragonfly/job.rb
Instance Attribute Summary
Attributes inherited from Step
#args, #job
Instance Method Summary
(collapse)
Methods inherited from Step
abbreviation, basename, #inspect, step_name, #to_a
Constructor Details
- (FetchFile) initialize(job, path)
Returns a new instance of FetchFile
119
120
121
|
# File 'lib/dragonfly/job.rb', line 119
def initialize(job, path)
super(job, path.to_s)
end
|
Instance Method Details
131
132
133
|
# File 'lib/dragonfly/job.rb', line 131
def apply
job.update(Pathname.new(path), :name => filename)
end
|
- (Object) filename
128
129
130
|
# File 'lib/dragonfly/job.rb', line 128
def filename
@filename ||= File.basename(path)
end
|
122
123
124
|
# File 'lib/dragonfly/job.rb', line 122
def init
job.url_attrs[:name] = filename
end
|
125
126
127
|
# File 'lib/dragonfly/job.rb', line 125
def path
@path ||= File.expand_path(args.first)
end
|