crono 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 964fb0cc36c3f1eca39cc830632fc616053f58b1
4
- data.tar.gz: ed62ea98ff0e7bc47d940d6f726dda8b86800a8c
3
+ metadata.gz: 4d32527698439922fddbb76003b8fdb843785128
4
+ data.tar.gz: 5a6dcd608d7d9de9dc6f8d0666f4b6127504e024
5
5
  SHA512:
6
- metadata.gz: 19667aeff2df5d13b4a3b2a459ab0b8489c7fef7204f4cf40330b6753841ac37fdb3396260222a8482f49be3d66023b50baaaf6034ee11a5f53e0bee7c1988f1
7
- data.tar.gz: 3b8404ce391887460325511340020b3ded8acbeb3c01280e12ceead75ea8897126e0e9573e5914ba67a796f5ed18c0e2084e08d0cdc057c229656daefe954169
6
+ metadata.gz: 302c30c45e4ad65f454a4cac15092213369456619c3888c76ece39de07421f78edce095a453d4031319e7994ffc405e7011a66662fa158d1c016be0aaff28eaa
7
+ data.tar.gz: 68e18a0b827396b27b8c56ba0b9573d8a4e477f1a4325e8147fe050ef8b5d9e4ae4fadec24dc0568f4dd4e5f94029c4350de04bab1292e4d260b870d6bab5f31
@@ -6,10 +6,15 @@ rvm:
6
6
  - 2.0.0
7
7
  - 2.1.7
8
8
  - 2.2.3
9
+ - 2.3.1
10
+ matrix:
11
+ exclude:
12
+ - rvm: 2.3.1
13
+ os: osx
9
14
  notifications:
10
15
  webhooks:
11
16
  urls:
12
17
  - https://webhooks.gitter.im/e/907e95dada362be2a13c
13
18
  on_success: change # options: [always|never|change] default: always
14
19
  on_failure: always # options: [always|never|change] default: always
15
- on_start: false # default: false
20
+ on_start: never # options: [always|never|change] default: always
@@ -1,9 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- crono (1.0.0)
5
- activerecord (~> 4.0)
6
- activesupport (~> 4.0)
4
+ crono (1.0.1)
5
+ activerecord (>= 4.0)
6
+ activesupport (>= 4.0)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
@@ -23,14 +23,14 @@ GEM
23
23
  tzinfo (~> 1.1)
24
24
  arel (6.0.3)
25
25
  builder (3.2.2)
26
- byebug (8.2.2)
26
+ byebug (9.0.5)
27
27
  daemons (1.2.3)
28
28
  diff-lcs (1.2.5)
29
29
  haml (4.0.7)
30
30
  tilt
31
31
  i18n (0.7.0)
32
32
  json (1.8.3)
33
- minitest (5.8.4)
33
+ minitest (5.9.0)
34
34
  rack (1.6.4)
35
35
  rack-protection (1.5.3)
36
36
  rack
@@ -57,7 +57,7 @@ GEM
57
57
  sqlite3 (1.3.11)
58
58
  thread_safe (0.3.5)
59
59
  tilt (2.0.2)
60
- timecop (0.8.0)
60
+ timecop (0.8.1)
61
61
  tzinfo (1.2.2)
62
62
  thread_safe (~> 0.1)
63
63
 
data/README.md CHANGED
@@ -11,14 +11,14 @@ Crono is a time-based background job scheduler daemon (just like Cron) for Ruby
11
11
 
12
12
  ## The Purpose
13
13
 
14
- Currently there is no such thing as Ruby Cron for Rails. Well, there's [Whenever](https://github.com/javan/whenever) but it works on top of Unix Cron, so you haven't control of it from Ruby. Crono is pure Ruby. It doesn't use Unix Cron and other platform-dependent things. So you can use it on all platforms supported by Ruby. It persists job states to your database using Active Record. You have full control of jobs performing process. It's Ruby, so you can understand and modify it to fit your needs.
14
+ Currently, there is no such thing as Ruby Cron for Rails. Well, there's [Whenever](https://github.com/javan/whenever) but it works on top of Unix Cron, so you can't manage it from Ruby. Crono is pure Ruby. It doesn't use Unix Cron and other platform-dependent things. So you can use it on all platforms supported by Ruby. It persists job states to your database using Active Record. You have full control of jobs performing process. It's Ruby, so you can understand and modify it to fit your needs.
15
15
 
16
16
  ![Web UI](https://github.com/plashchynski/crono/raw/master/examples/crono_web_ui.png)
17
17
 
18
18
 
19
19
  ## Requirements
20
20
 
21
- Tested with latest MRI Ruby (2.2, 2.1 and 2.0) and Rails 3.2+
21
+ Tested with latest MRI Ruby (2.3, 2.2, 2.1 and 2.0) and Rails 3.2+
22
22
  Other versions are untested but might work fine.
23
23
 
24
24
 
@@ -47,7 +47,7 @@ Now you are ready to move forward to create a job and schedule it.
47
47
 
48
48
  #### Create Job
49
49
 
50
- Crono can use Active Job jobs from `app/jobs/`. The only requirements is that the `perform` method should take no arguments.
50
+ Crono can use Active Job jobs from `app/jobs/`. The only requirement is that the `perform` method should take no arguments.
51
51
 
52
52
  Here's an example of a job:
53
53
 
@@ -61,7 +61,7 @@ class TestJob < ActiveJob::Base
61
61
  end
62
62
  ```
63
63
 
64
- The ActiveJob jobs is convenient because you can use one job in both periodic and enqueued ways. But Active Job is not required. Any class can be used as a crono job if it implements a method `perform`:
64
+ The ActiveJob jobs are convenient because you can use one job in both periodic and enqueued ways. But Active Job is not required. Any class can be used as a crono job if it implements a method `perform`:
65
65
 
66
66
  ```ruby
67
67
  class TestJob # This is not an Active Job job, but pretty legal Crono job.
@@ -111,7 +111,7 @@ Crono.perform(TestJob).every 2.days, at: {hour: 15, min: 30}
111
111
  Crono.perform(TestJob).every 1.week, on: :monday, at: "15:30"
112
112
  ```
113
113
 
114
- You can schedule one job a few times, if you want the job to be performed a few times a day or a week:
114
+ You can schedule one job a few times if you want the job to be performed a few times a day or a week:
115
115
 
116
116
  ```ruby
117
117
  Crono.perform(TestJob).every 1.week, on: :monday
@@ -150,9 +150,9 @@ Usage: crono [options] [start|stop|restart|run]
150
150
  -e, --environment ENV Application environment (Default: development)
151
151
  ```
152
152
 
153
- #### Run as daemon
153
+ #### Run as a daemon
154
154
 
155
- To run Crono as daemon, please add to your Gemfile:
155
+ To run Crono as a daemon, please add to your Gemfile:
156
156
 
157
157
  ```ruby
158
158
  gem 'daemons'
@@ -19,8 +19,8 @@ Gem::Specification.new do |spec|
19
19
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
20
  spec.require_paths = ['lib']
21
21
 
22
- spec.add_runtime_dependency 'activesupport', '~> 4.0'
23
- spec.add_runtime_dependency 'activerecord', '~> 4.0'
22
+ spec.add_runtime_dependency 'activesupport', '>= 4.0'
23
+ spec.add_runtime_dependency 'activerecord', '>= 4.0'
24
24
  spec.add_development_dependency 'rake', '~> 10.0'
25
25
  spec.add_development_dependency 'bundler', '>= 1.0.0'
26
26
  spec.add_development_dependency 'rspec', '~> 3.0'
@@ -1,3 +1,5 @@
1
+ Thread.abort_on_exception = true
2
+
1
3
  require 'crono'
2
4
  require 'optparse'
3
5
 
@@ -65,7 +65,7 @@ module Crono
65
65
  saved_log = model.reload.log || ''
66
66
  log_to_save = saved_log + job_log.string
67
67
  model.update(last_performed_at: last_performed_at, log: log_to_save,
68
- healthy: healthy, args: job_args)
68
+ healthy: healthy)
69
69
  end
70
70
 
71
71
  def perform_job
@@ -1,3 +1,3 @@
1
1
  module Crono
2
- VERSION = '1.0.0'
2
+ VERSION = '1.0.1'
3
3
  end
@@ -5,7 +5,6 @@ class CreateCronoJobs < ActiveRecord::Migration
5
5
  t.text :log
6
6
  t.datetime :last_performed_at
7
7
  t.boolean :healthy
8
- t.text :args
9
8
  t.timestamps null: false
10
9
  end
11
10
  add_index :crono_jobs, [:job_id], unique: true
metadata CHANGED
@@ -1,41 +1,41 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: crono
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dzmitry Plashchynski
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-03-30 00:00:00.000000000 Z
11
+ date: 2016-06-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '4.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '4.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: activerecord
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '4.0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '4.0'
41
41
  - !ruby/object:Gem::Dependency