Class: Dragonfly::Job::FetchUrl
Instance Attribute Summary
Attributes inherited from Step
#args, #job
Instance Method Summary
collapse
Methods inherited from Step
abbreviation, basename, #initialize, #inspect, step_name
Instance Method Details
129
130
131
132
133
|
# File 'lib/dragonfly/job.rb', line 129
def apply
open(url) do |f|
job.temp_object = TempObject.new(f.read)
end
end
|
120
121
122
|
# File 'lib/dragonfly/job.rb', line 120
def init
job.name = File.basename(path) if path[/[^\/]$/]
end
|
126
127
128
|
# File 'lib/dragonfly/job.rb', line 126
def path
@path ||= URI.parse(url).path
end
|
123
124
125
|
# File 'lib/dragonfly/job.rb', line 123
def url
@url ||= (args.first[%r<^\w+://>] ? args.first : "http://#{args.first}")
end
|