Class: Dato::Dump::Runner
- Inherits:
-
Object
- Object
- Dato::Dump::Runner
- Defined in:
- lib/dato/dump/runner.rb
Instance Attribute Summary collapse
-
#api_token ⇒ Object
readonly
Returns the value of attribute api_token.
-
#config_path ⇒ Object
readonly
Returns the value of attribute config_path.
Instance Method Summary collapse
- #client ⇒ Object
- #generator ⇒ Object
-
#initialize(config_path, api_token) ⇒ Runner
constructor
A new instance of Runner.
- #operation ⇒ Object
- #run ⇒ Object
- #site ⇒ Object
Constructor Details
#initialize(config_path, api_token) ⇒ Runner
Returns a new instance of Runner.
11 12 13 14 |
# File 'lib/dato/dump/runner.rb', line 11 def initialize(config_path, api_token) @config_path = config_path @api_token = api_token end |
Instance Attribute Details
#api_token ⇒ Object (readonly)
Returns the value of attribute api_token.
9 10 11 |
# File 'lib/dato/dump/runner.rb', line 9 def api_token @api_token end |
#config_path ⇒ Object (readonly)
Returns the value of attribute config_path.
9 10 11 |
# File 'lib/dato/dump/runner.rb', line 9 def config_path @config_path end |
Instance Method Details
#client ⇒ Object
36 37 38 39 40 41 42 43 44 |
# File 'lib/dato/dump/runner.rb', line 36 def client @client ||= Dato::Site::Client.new( api_token, extra_headers: { 'X-Reason' => 'dump', 'X-SSG' => generator } ) end |
#generator ⇒ Object
46 47 48 |
# File 'lib/dato/dump/runner.rb', line 46 def generator SsgDetector.new(Dir.pwd).detect end |
#operation ⇒ Object
28 29 30 |
# File 'lib/dato/dump/runner.rb', line 28 def operation @operation ||= Operation::Root.new(Dir.pwd) end |