Module: Snapit

Defined in:
lib/snapit.rb,
lib/snapit/engine.rb,
lib/snapit/script.rb,
lib/snapit/storage.rb,
lib/snapit/version.rb

Defined Under Namespace

Classes: Engine, Script, Storage

Constant Summary collapse

VERSION =
"0.1.0"

Class Method Summary collapse

Class Method Details

.run!(path, storage) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/snapit.rb', line 7

def self.run!(path, storage)
  res = []
  script = Snapit::Script.new(path, storage)
  Snapit::Engine.run(script.storage) do |driver|
    script.urls.each do |obj|
      obj.keys.each do |key|
        name = key
        url  = obj[key]
        res << {path: driver.capture!(url, name)}
      end
    end
  end
  res
end