Class: Anamo::Fstree::Thor

Inherits:
Thor
  • Object
show all
Defined in:
lib/anamo/fstree/thor.rb

Instance Method Summary collapse

Instance Method Details

#execObject



154
155
156
157
158
159
# File 'lib/anamo/fstree/thor.rb', line 154

def exec

  inspect
  send

end

#inspectObject



165
166
167
168
169
170
171
172
173
174
175
176
177
178
# File 'lib/anamo/fstree/thor.rb', line 165

def inspect

  FileUtils.rm_rf temp_folder
  FileUtils.mkdir_p temp_folder

  idx = 0

  paths.each do |path, depth|
    traverser = Traverser.new(path, Writer.new(temp_folder, idx, path), depth, exclusions)
    traverser.compute
    idx = idx + 1
  end

end

#sendObject



184
185
186
187
188
189
190
191
192
193
# File 'lib/anamo/fstree/thor.rb', line 184

def send

  files = {}
  Dir["#{temp_folder}/*"].each do |file|
    files[File.basename(file, '.*')] = UploadIO.new(File.new(file), "application/gzip", File.basename(file))
  end

  ::Anamo::Api.new.post_fstree files

end