gist_worker 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,23 @@
1
+ # Execute a Gist on IronWorker
2
+
3
+ An IronWorker that runs any gist.
4
+
5
+ ## Getting Started
6
+
7
+ ### Install Gem
8
+
9
+ sudo gem install gist_worker
10
+
11
+ ### Create a gist
12
+
13
+ Here's an example one: https://gist.github.com/1989106
14
+
15
+ ### Queue it up!
16
+
17
+ require 'gist_worker'
18
+ worker = GistWorker::Worker.new
19
+ worker.gist_id = "1989106"
20
+ worker.gist_file = "tester.rb"
21
+ worker.params = {'key1'=>'value', 'key2'=>3}
22
+ worker.queue
23
+
@@ -0,0 +1,5 @@
1
+ ---
2
+ :major: 0
3
+ :minor: 0
4
+ :patch: 1
5
+ :build: !!null
@@ -0,0 +1 @@
1
+ require_relative 'gist_worker/worker'
@@ -0,0 +1,31 @@
1
+ require 'iron_worker'
2
+ require 'json'
3
+ require 'open-uri'
4
+
5
+ module GistWorker
6
+
7
+ class Worker < IronWorker::Base
8
+
9
+ attr_accessor :gist_url, :gist_id, :gist_file, :params
10
+
11
+ def run
12
+
13
+ unless gist_url
14
+ @gist_url = "https://raw.github.com/gist/#{gist_id}/#{gist_file}"
15
+ end
16
+
17
+ # get gist
18
+ gist_file = user_dir + "gist.rb"
19
+ File.open(gist_file, 'wb') do |fo|
20
+ fo.write open(gist_url).read
21
+ end
22
+
23
+ $params = @params
24
+ # run gist
25
+ load(gist_file)
26
+
27
+ end
28
+
29
+ end
30
+
31
+ end
metadata ADDED
@@ -0,0 +1,71 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: gist_worker
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Travis Reeder
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-03-06 00:00:00.000000000Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: iron_worker
16
+ requirement: &10654860 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: *10654860
25
+ - !ruby/object:Gem::Dependency
26
+ name: iron_worker
27
+ requirement: &10654120 !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ type: :runtime
34
+ prerelease: false
35
+ version_requirements: *10654120
36
+ description: A worker that will run a Github Gist on on IronWorker http://www.iron.io
37
+ email: travis@iron.io
38
+ executables: []
39
+ extensions: []
40
+ extra_rdoc_files:
41
+ - README.md
42
+ files:
43
+ - VERSION.yml
44
+ - lib/gist_worker.rb
45
+ - lib/gist_worker/worker.rb
46
+ - README.md
47
+ homepage: https://github.com/treeder/gist_worker
48
+ licenses: []
49
+ post_install_message:
50
+ rdoc_options: []
51
+ require_paths:
52
+ - lib
53
+ required_ruby_version: !ruby/object:Gem::Requirement
54
+ none: false
55
+ requirements:
56
+ - - ! '>='
57
+ - !ruby/object:Gem::Version
58
+ version: '1.9'
59
+ required_rubygems_version: !ruby/object:Gem::Requirement
60
+ none: false
61
+ requirements:
62
+ - - ! '>='
63
+ - !ruby/object:Gem::Version
64
+ version: '0'
65
+ requirements: []
66
+ rubyforge_project:
67
+ rubygems_version: 1.8.15
68
+ signing_key:
69
+ specification_version: 3
70
+ summary: A worker that will run a Github Gist on on IronWorker http://www.iron.io
71
+ test_files: []