Class: GistWorker::Worker
- Inherits:
-
IronWorker::Base
- Object
- IronWorker::Base
- GistWorker::Worker
- Defined in:
- lib/gist_worker/worker.rb
Instance Attribute Summary collapse
-
#gist_file ⇒ Object
Returns the value of attribute gist_file.
-
#gist_id ⇒ Object
Returns the value of attribute gist_id.
-
#gist_url ⇒ Object
Returns the value of attribute gist_url.
-
#params ⇒ Object
Returns the value of attribute params.
Instance Method Summary collapse
Instance Attribute Details
#gist_file ⇒ Object
Returns the value of attribute gist_file.
9 10 11 |
# File 'lib/gist_worker/worker.rb', line 9 def gist_file @gist_file end |
#gist_id ⇒ Object
Returns the value of attribute gist_id.
9 10 11 |
# File 'lib/gist_worker/worker.rb', line 9 def gist_id @gist_id end |
#gist_url ⇒ Object
Returns the value of attribute gist_url.
9 10 11 |
# File 'lib/gist_worker/worker.rb', line 9 def gist_url @gist_url end |
#params ⇒ Object
Returns the value of attribute params.
9 10 11 |
# File 'lib/gist_worker/worker.rb', line 9 def params @params end |
Instance Method Details
#run ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/gist_worker/worker.rb', line 11 def run unless gist_url @gist_url = "https://raw.github.com/gist/#{gist_id}/#{gist_file}" end # get gist gist_file = user_dir + "gist.rb" File.open(gist_file, 'wb') do |fo| fo.write open(gist_url).read end $params = @params # run gist load(gist_file) end |