Browse files

Removing trailing spaces.

  • Loading branch information...
1 parent cdd175b commit 59a050a22beb0d411dc8c396e728654595267e27 Andrew Kirilenko committed Jul 13, 2012
View
24 README.md
@@ -4,9 +4,9 @@ To run your code in cloud you need to do three things:
- **Create code package**
- **Upload code package**
-- **Queue or schedule tasks** for execution
+- **Queue or schedule tasks** for execution
-While you can use [REST APIs](http://dev.iron.io/worker/reference/api) for that, it's easier to use an
+While you can use [REST APIs](http://dev.iron.io/worker/reference/api) for that, it's easier to use an
IronWorker library created specifically for your language of choice, such as this gem, IronWorkerNG.
# Preparing Your Environment
@@ -21,7 +21,7 @@ gem install iron_worker_ng
# Creating A Worker
-Each IronWorkerNG Ruby worker is just Ruby code. It can be as simple or as complex as you want. For example,
+Each IronWorkerNG Ruby worker is just Ruby code. It can be as simple or as complex as you want. For example,
the following is an acceptable worker:
```ruby
@@ -35,14 +35,14 @@ All output to `STDOUT` will be logged and available for your review when your wo
# Creating The Code Package
Before you can run use IronWorker, be sure you've [created a free account with Iron.io](http://www.iron.io)
-and [setup your Iron.io credentials on your system](http://dev.iron.io/articles/configuration/) (either in a json
-file or using ENV variables). You only need to do that once for your machine. If you've done that, then you can continue.
+and [setup your Iron.io credentials on your system](http://dev.iron.io/articles/configuration/) (either in a json
+file or using ENV variables). You only need to do that once for your machine. If you've done that, then you can continue.
-Since our worker will be executed in the cloud, you'll need to bundle all the necessary gems,
+Since our worker will be executed in the cloud, you'll need to bundle all the necessary gems,
supplementary data, and other dependencies with it. `.worker` files make it easy to define your worker.
```ruby
-# define the runtime language, this can be ruby, java, node, php, go, etc.
+# define the runtime language, this can be ruby, java, node, php, go, etc.
runtime "ruby"
# exec is the file that will be executed:
exec "hello_worker.rb"
@@ -52,7 +52,7 @@ You can read more about `.worker` files here: http://dev.iron.io/worker/referenc
## Uploading the Code Package
-If your .worker file is called `hello.worker`, then run:
+If your .worker file is called `hello.worker`, then run:
iron_worker upload hello
@@ -73,7 +73,7 @@ Most commonly you'll be queuing up tasks from code though, so you can do this:
```ruby
require "iron_worker_ng"
client = IronWorkerNG::Client.new
-100.times do
+100.times do
client.tasks.create("hello", "foo"=>"bar")
end
```
@@ -167,7 +167,7 @@ code.merge_gemfile '../Gemfile', 'common', 'worker' # merges gems from common an
# Upload Your Worker
-When you have your code package, you are ready to upload and run it on the IronWorker cloud.
+When you have your code package, you are ready to upload and run it on the IronWorker cloud.
```ruby
# Initialize the client
@@ -180,8 +180,8 @@ client.codes.create(code)
# Queue Up Tasks for Your Worker
-Now that the code is uploaded, we can create/queue up tasks. You can call this over and over
-for as many tasks as you want.
+Now that the code is uploaded, we can create/queue up tasks. You can call this over and over
+for as many tasks as you want.
```ruby
client.tasks.create('MyWorker', {:client => 'Joe'})
View
8 bin/iron_worker
@@ -68,7 +68,7 @@ elsif command == 'tasks.create' || command == 'schedules.create'
if $*.size > 0 && $*[0][0] != '-'
$*.unshift('-n')
end
-
+
name = nil
payload = nil
payload_file = nil
@@ -88,7 +88,7 @@ elsif command == 'tasks.create' || command == 'schedules.create'
opts.banner = "usage: iron_worker #{command} [OPTIONS]"
opts.on('-n', '--name NAME', 'code name') do |v|
- name = v
+ name = v
end
opts.on('-p', '--payload PAYLOAD', String, 'payload to pass') do |v|
@@ -187,7 +187,7 @@ elsif command == 'tasks.log'
opts.banner = "usage: iron_worker #{command} [OPTIONS]"
opts.on('-t', '--task-id ID', 'task id') do |v|
- task_id = v
+ task_id = v
end
opts.on('-w', '--wait', 'wait for task') do |v|
@@ -220,7 +220,7 @@ elsif command == 'tasks.log'
if wait
client.tasks.wait_for(task_id)
end
-
+
log = client.tasks.log(task_id)
end
View
6 lib/3rdparty/hashie/indifferent_access.rb
@@ -72,7 +72,7 @@ def convert_value(value)
value
end
end
-
+
def indifferent_default(key = nil)
return self[convert_key(key)] if key?(key)
regular_default(key)
@@ -84,15 +84,15 @@ def indifferent_update(other_hash)
self[k] = v
end
end
-
+
def indifferent_writer(key, value); regular_writer convert_key(key), convert_value(value) end
def indifferent_fetch(key, *args); regular_fetch convert_key(key), *args end
def indifferent_delete(key); regular_delete convert_key(key) end
def indifferent_key?(key); regular_key? convert_key(key) end
def indifferent_values_at(*indices); indices.map{|i| self[i] } end
def indifferent_access?; true end
-
+
protected
def hash_lacking_indifference?(other)
View
2 lib/iron_worker_ng/client.rb
@@ -224,7 +224,7 @@ def params_for_legacy(code_name, params)
end
attrs = {}
-
+
params.keys.each do |k|
attrs['@' + k.to_s] = params[k]
end
View
4 lib/iron_worker_ng/code/runtime/java.rb
@@ -10,7 +10,7 @@ module Java
def runtime_run_code
classpath_array = []
-
+
@features.each do |f|
if f.respond_to?(:code_for_classpath)
classpath_array << f.send(:code_for_classpath)
@@ -20,7 +20,7 @@ def runtime_run_code
classpath = classpath_array.join(':')
IronCore::Logger.info 'IronWorkerNG', "Collected '#{classpath}' classpath"
-
+
<<RUN_CODE
java -cp #{classpath} #{@exec.klass.nil? ? "-jar #{File.basename(@exec.path)}" : @exec.klass} "$@"
RUN_CODE
View
4 lib/iron_worker_ng/code/runtime/php.rb
@@ -12,8 +12,8 @@ def runtime_bundle(zip)
<?php
/* #{IronWorkerNG.full_version} */
-function getArgs() {
- global $argv;
+function getArgs() {
+ global $argv;
$args = array('task_id' => null, 'dir' => null, 'payload' => array());
View
2 lib/iron_worker_ng/feature/binary/merge_exec.rb
@@ -24,7 +24,7 @@ def bundle(zip)
module InstanceMethods
def merge_exec(path=nil)
- @exec ||= nil
+ @exec ||= nil
return @exec unless path
View
2 lib/iron_worker_ng/feature/go/merge_exec.rb
@@ -24,7 +24,7 @@ def bundle(zip)
module InstanceMethods
def merge_exec(path=nil)
- @exec ||= nil
+ @exec ||= nil
return @exec unless path
View
2 lib/iron_worker_ng/feature/java/merge_exec.rb
@@ -30,7 +30,7 @@ def code_for_classpath
module InstanceMethods
def merge_exec(path = nil, klass = nil)
- @exec ||= nil
+ @exec ||= nil
return @exec unless path
View
2 lib/iron_worker_ng/feature/mono/merge_exec.rb
@@ -24,7 +24,7 @@ def bundle(zip)
module InstanceMethods
def merge_exec(path=nil)
- @exec ||= nil
+ @exec ||= nil
return @exec unless path
View
2 lib/iron_worker_ng/feature/node/merge_exec.rb
@@ -24,7 +24,7 @@ def bundle(zip)
module InstanceMethods
def merge_exec(path=nil)
- @exec ||= nil
+ @exec ||= nil
return @exec unless path
View
2 lib/iron_worker_ng/feature/perl/merge_exec.rb
@@ -24,7 +24,7 @@ def bundle(zip)
module InstanceMethods
def merge_exec(path=nil)
- @exec ||= nil
+ @exec ||= nil
return @exec unless path
View
2 lib/iron_worker_ng/feature/php/merge_exec.rb
@@ -24,7 +24,7 @@ def bundle(zip)
module InstanceMethods
def merge_exec(path=nil)
- @exec ||= nil
+ @exec ||= nil
return @exec unless path
View
2 lib/iron_worker_ng/feature/python/merge_exec.rb
@@ -24,7 +24,7 @@ def bundle(zip)
module InstanceMethods
def merge_exec(path=nil)
- @exec ||= nil
+ @exec ||= nil
return @exec unless path
View
2 lib/iron_worker_ng/feature/ruby/merge_exec.rb
@@ -26,7 +26,7 @@ def bundle(zip)
module InstanceMethods
def merge_exec(path = nil, klass = nil)
- @exec ||= nil
+ @exec ||= nil
return @exec unless path
View
2 lib/iron_worker_ng/feature/ruby/merge_gem.rb
@@ -24,7 +24,7 @@ def initialize(code, spec)
def gem_path
path = @spec.full_gem_path
- # bundler fix
+ # bundler fix
['/gems/' + @spec.full_name, '/gems'].each do |bad_part|
path.gsub!(bad_part + bad_part, bad_part)
View
2 lib/iron_worker_ng/fetcher.rb
@@ -25,7 +25,7 @@ def self.fetch(url, to_file = false)
tmp_dir_name = Dir.tmpdir + '/' + Dir::Tmpname.make_tmpname("iron-worker-ng-", "http")
Dir.mkdir(tmp_dir_name)
-
+
File.open(tmp_dir_name + '/' + File.basename(url), 'wb') do |f|
f.write(response.body)
end

0 comments on commit 59a050a

Please sign in to comment.