iron_response 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -8,13 +8,17 @@ Provides a response object to remote worker scripts. This allows you to write ma
8
8
  require "iron_response"
9
9
 
10
10
  config = {token: "123", project_id: "456"}
11
- batch = IronResponse::Batch.new(config)
11
+ batch = IronResponse::Batch.new(config)
12
+
13
+ code = IronWorkerNG::Code::Ruby.new
14
+ code.runtime = "ruby"
15
+ code.exec "test/workers/is_prime.rb"
16
+ batch.code = code
12
17
 
13
- batch.worker = "test/workers/is_prime.rb"
14
- batch.params_array = Array(1..10).map {|i| {number: i}}
15
- batch.create_code!(max_concurrency: 4)
18
+ batch.params_array = Array(1..10).map {|i| {number: i}}
19
+ batch.create_code!
16
20
 
17
- results = batch.run!
21
+ results = batch.run!
18
22
 
19
23
  p results
20
24
  #=> [{"result"=>false}, {"result"=>true}, {"result"=>true}...]
@@ -127,28 +131,28 @@ require_relative "configuration"
127
131
  require "iron_response"
128
132
 
129
133
  config = Configuration.keys
130
- batch = IronResponse::Batch.new
134
+ batch = IronResponse::Batch.new(config)
131
135
 
132
- batch.auto_update_worker = true
133
- batch.config = config
134
- batch.worker = "workers/my_worker.rb"
136
+ code = IronWorkerNG::Code::Ruby.new
137
+ code.runtime = "ruby"
138
+ code.exec "workers/my_worker.rb"
139
+ batch.code = code
135
140
 
136
141
  # The `params_array` is an Array of Hashes
137
142
  # that get sent as the payload to IronWorker scripts.
138
- batch.params_array = Array ("a".."z").map {|i| {letter: i}}
143
+ batch.params_array = Array ("a".."z").map {|i| {letter: i}}
139
144
 
140
- results = batch.run!
145
+ results = batch.run!
141
146
  ```
142
147
 
143
148
  If your worker code requires any gems, you can use [`iron_worker_ng`](https://github.com/iron-io/iron_worker_ruby_ng)'s API:
144
149
 
145
150
  ```ruby
146
- batch.code.merge_gem("nokogiri", "< 1.6.0") # decreases remote build time
147
- batch.code.merge_gem("ecfs")
148
- batch.code.full_remote_build(true)
151
+ code.merge_gem("nokogiri", "< 1.6.0") # decreases remote build time
152
+ code.merge_gem("ecfs")
153
+ code.full_remote_build(true)
149
154
  ```
150
155
 
151
-
152
156
  ## Installation
153
157
 
154
158
  Add this line to your application's Gemfile:
@@ -18,7 +18,7 @@ Gem::Specification.new do |gem|
18
18
  gem.add_dependency "iron_worker_ng"
19
19
  gem.add_dependency "aws-s3"
20
20
  gem.add_dependency "iron_cache"
21
- gem.add_development_dependency "minitest", "~> 4.7.3"
21
+ #gem.add_development_dependency "minitest", "~> 4.7.3"
22
22
  gem.add_development_dependency "pry"
23
23
  gem.add_development_dependency "pry-rescue"
24
24
  end
@@ -10,7 +10,7 @@ module IronResponse
10
10
  end
11
11
 
12
12
  def Common.s3_bucket_name(config)
13
- config[:aws_s3][:bucket].nil? ? DEFAULT_S3_BUCKET : @config[:aws_s3][:bucket]
13
+ config[:aws_s3][:bucket].nil? ? DEFAULT_S3_BUCKET : config[:aws_s3][:bucket]
14
14
  end
15
15
 
16
16
  def Common.iron_cache_key(task_id)
@@ -18,7 +18,7 @@ module IronResponse
18
18
  end
19
19
 
20
20
  def Common.iron_cache_cache_name(config)
21
- config[:iron_io][:cache].nil? ? DEFAULT_IRON_CACHE_CACHE_NAME : @config[:iron_io][:cache]
21
+ config[:iron_io][:cache].nil? ? DEFAULT_IRON_CACHE_CACHE_NAME : config[:iron_io][:cache]
22
22
  end
23
23
 
24
24
  def Common.response_provider(config)
@@ -1,3 +1,3 @@
1
1
  module IronResponse
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
@@ -1,6 +1,6 @@
1
1
  require "test_helper"
2
2
 
3
- class GemDependencyTest < MiniTest::Unit::TestCase
3
+ class GemDependencyTest < Test::Unit::TestCase
4
4
  def test_synopsis_with_iron_cache
5
5
 
6
6
  config = Configuration.keys
@@ -1,6 +1,6 @@
1
1
  require "test_helper"
2
2
 
3
- class SynopsisTest < MiniTest::Unit::TestCase
3
+ class SynopsisTest < Test::Unit::TestCase
4
4
  def test_synopsis_with_s3
5
5
  config = Configuration.keys
6
6
  batch = IronResponse::Batch.new(config)
@@ -1,7 +1,9 @@
1
1
  require_relative "configuration"
2
- require "minitest/unit"
3
- require "minitest/autorun"
4
- require "pry-rescue/minitest"
5
- require "minitest/pride"
6
- require "pry"
7
- require "iron_response"
2
+
3
+ #require "minitest/unit"
4
+ #require "minitest/autorun"
5
+ #require "pry-rescue/minitest"
6
+ #require "minitest/pride"
7
+ #require "pry"
8
+ require "test/unit"
9
+ require "iron_response"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: iron_response
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-08-24 00:00:00.000000000 Z
12
+ date: 2013-12-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: iron_worker_ng
@@ -59,22 +59,6 @@ dependencies:
59
59
  - - ! '>='
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
- - !ruby/object:Gem::Dependency
63
- name: minitest
64
- requirement: !ruby/object:Gem::Requirement
65
- none: false
66
- requirements:
67
- - - ~>
68
- - !ruby/object:Gem::Version
69
- version: 4.7.3
70
- type: :development
71
- prerelease: false
72
- version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
- requirements:
75
- - - ~>
76
- - !ruby/object:Gem::Version
77
- version: 4.7.3
78
62
  - !ruby/object:Gem::Dependency
79
63
  name: pry
80
64
  requirement: !ruby/object:Gem::Requirement