Method: EasyType::SourceDir#process

Defined in:
lib/easy_type/source_dir.rb

#process(user = nil, group = nil) ⇒ Object

Process the parameter. If the source is not yet fetched, if will first fetch, uncompress and unpack the file.

The worflow is:

1) Decide on location of ‘tmp_dir`. If not specfied it is `/tmp/$title` 2) If the file is a remote file, copy it to the `tmp_dir` 3) If the file is compressed, uncompress it. In the same `tmp_dir` 4) If the file is a container (zip or tar) unpack it to the `tmp_dir$file_name`



198
199
200
201
202
203
204
205
206
207
208
209
210
# File 'lib/easy_type/source_dir.rb', line 198

def process(user = nil, group = nil)
    ensure_tmp_dir( user, group)
    @original_source = normalize_file_name(@value)
    if fetched?
      @value = @@fetched_files[@original_source]
    else
      fetch
      uncompress(user, group)
      unpack(user, group)
    end
    custom_action if defined?(custom_action)
    normalize_file_name(@value)
end