jobly 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +65 -1
- data/lib/jobly/commands/send.rb +1 -1
- data/lib/jobly/module_functions.rb +1 -1
- data/lib/jobly/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c291317ad0589ae8edc781249eed56684185e31e7b376a71c426ca31cade67f9
|
4
|
+
data.tar.gz: 5bf18f622297cc8446e7e5c3ec3fcc28584cc41a5d80f611fde5e339f44f09ed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: db20fe73b659b6a90234537a5058d908ed857e1c1b11092afae45d60bb9bfc4565c8d865a104f54c931518197c6fb834d65fe0c1f36734b3e77ffb6daee81ac0
|
7
|
+
data.tar.gz: 96757bbd1e809d05d6a752cce7bfc4a9c0967d83a78ef913f1ed9c807575dc6c415c31d2a7c6ce4adc629c7aade641bbcb088ff5e5c00b130b5df26c964aba19
|
data/README.md
CHANGED
@@ -15,6 +15,20 @@ Compact job server with API, CLI, Web UI and a Sidekiq heart.
|
|
15
15
|
|
16
16
|
---
|
17
17
|
|
18
|
+
* [Installation](#installation)
|
19
|
+
* [What's in the Box](#whats-in-the-box)
|
20
|
+
* [Quick Start](#quick-start)
|
21
|
+
* [Usage](#usage)
|
22
|
+
* [Server](#server)
|
23
|
+
* [Worker](#worker)
|
24
|
+
* [Running jobs from the command line](#running-jobs-from-the-command-line)
|
25
|
+
* [Running jobs through the API](#running-jobs-through-the-api)
|
26
|
+
* [Building Jobs](#building-jobs)
|
27
|
+
* [Loading Additional Code](#loading-additional-code)
|
28
|
+
* [Configuration](#configuration)
|
29
|
+
|
30
|
+
---
|
31
|
+
|
18
32
|
Installation
|
19
33
|
--------------------------------------------------
|
20
34
|
|
@@ -107,5 +121,55 @@ $ curl -XPOST localhost:3000/do/Build -d deploy=yes
|
|
107
121
|
Building Jobs
|
108
122
|
--------------------------------------------------
|
109
123
|
|
110
|
-
|
124
|
+
To build a jobs "workspace", start in an empty folder and create a `./jobs`
|
125
|
+
subfolder inside it. All your job classes go in this folder (configurable).
|
126
|
+
|
127
|
+
All job classes will be loaded by any of Jobly's commands.
|
128
|
+
|
129
|
+
A job class is a simple Ruby class inheriting from
|
130
|
+
`[Jobly::Job](/lib/jobly/job.rb)`.
|
131
|
+
|
132
|
+
The only requirement is that your class implements an `execute` method that
|
133
|
+
optionally accepts keyword arguments (recommended), or a hash.
|
134
|
+
|
135
|
+
Example:
|
136
|
+
|
137
|
+
```ruby
|
138
|
+
class Hello < Jobly::Job
|
139
|
+
def execute(name: 'bob')
|
140
|
+
puts "Hello #{name}"
|
141
|
+
logger.info "said hello to #{name}"
|
142
|
+
end
|
143
|
+
end
|
144
|
+
```
|
145
|
+
|
146
|
+
Note that these classes are simply Jobly-flavored sidekiq jobs, with these
|
147
|
+
differences:
|
148
|
+
|
149
|
+
- You need to implement `execute` instead of `perform`
|
150
|
+
- Job arguments are defined as keyword arguments, instead of positional
|
151
|
+
arguments.
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
Loading Additional Code
|
156
|
+
--------------------------------------------------
|
157
|
+
|
158
|
+
In case your jobs require additional functionality, you may create the
|
159
|
+
`./app` folder as a sibling to the `./jobs` folder (configurable).
|
160
|
+
|
161
|
+
Any ruby files in this folder (and subfolders) will be autmatically loaded
|
162
|
+
and available to your jobs.
|
163
|
+
|
164
|
+
|
165
|
+
Configuration
|
166
|
+
--------------------------------------------------
|
167
|
+
|
168
|
+
Configuring Jobly can be done by one of two methods:
|
169
|
+
|
170
|
+
1. Setting environment variables.
|
171
|
+
2. Adding a `./config/jobly.rb` file.
|
111
172
|
|
173
|
+
See this [example config file](/examples/02-full/config/jobly.rb) for a full
|
174
|
+
annotated configuration example and a list of options with their respective
|
175
|
+
environment variables.
|
data/lib/jobly/commands/send.rb
CHANGED
@@ -10,7 +10,7 @@ module Jobly
|
|
10
10
|
def self.default_options
|
11
11
|
{
|
12
12
|
environment: ENV['JOBLY_ENVIRONMENT'] || 'development',
|
13
|
-
|
13
|
+
api_url: ENV['JOBLY_API_URL'] || 'http://localhost:3000/do',
|
14
14
|
app_path: ENV['JOBLY_APP_PATH'] || 'app',
|
15
15
|
jobs_path: ENV['JOBLY_JOBS_PATH'] || "jobs",
|
16
16
|
config_path: ENV['JOBLY_CONFIG_PATH'] || "config",
|
data/lib/jobly/version.rb
CHANGED