ruby-clock 0.1.0 → 0.2.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ba2d9d1626f38c8027978a5528cfd6697e58d754f68c3d12988e2cb4a0bca5ba
4
- data.tar.gz: 07e9f670929519445fb9133af33bdd16e6a1f4188469c6f62a7c7bd8157ecce4
3
+ metadata.gz: 380a0d3214236bb95f84bcb5aa3a04fc74e6ef916e4e064a71c13bcfb76a6f15
4
+ data.tar.gz: ca43eca30e42447cdcfc563e0768ee0326f62679754996e0e6007774a62a9055
5
5
  SHA512:
6
- metadata.gz: b684d6ed9b2621e444db1fb9fc66249f31723d972573e7aadde4a38e568c3517dc411b6d07c6c10d4d6bda6580b6cd525870bd157980364d91502bc0601bce2f
7
- data.tar.gz: fea438780102ed99f7db1bae99af487435fc0b89e6926a131e65b874a7efdc424bc53024386866612e95faa76f51880dee1582adc5277e8d79fc1eb9f7932b79
6
+ metadata.gz: 6bbf359d4a3523904d1e81c816cb89a11267a0fac2f4f891deb4bc27cb89834d4f70f34cda3a7849bfaa0b1184a8a8541e3e895f93d107402170e6a7f09816f3
7
+ data.tar.gz: 2896961f63395b0eb4fa22d4fe47a4df5466dc7f3577afc5c1feac7fb3e7bb4315609ae6e4f14a56d223fe8ac3d70f20704d23f2fd01867501de874c75e01d0f
data/Gemfile CHANGED
@@ -1,6 +1,6 @@
1
1
  source "https://rubygems.org"
2
2
  git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
3
3
 
4
- # gemspec
4
+ gemspec
5
5
 
6
6
  gem "rake", "~> 12.0"
@@ -1,13 +1,31 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ ruby-clock (0.1.0)
5
+ rufus-scheduler (>= 3.7.0)
6
+
1
7
  GEM
2
8
  remote: https://rubygems.org/
3
9
  specs:
10
+ concurrent-ruby (1.1.7)
11
+ et-orbi (1.2.4)
12
+ tzinfo
13
+ fugit (1.4.1)
14
+ et-orbi (~> 1.1, >= 1.1.8)
15
+ raabro (~> 1.4)
16
+ raabro (1.4.0)
4
17
  rake (12.3.3)
18
+ rufus-scheduler (3.7.0)
19
+ fugit (~> 1.1, >= 1.1.6)
20
+ tzinfo (2.0.4)
21
+ concurrent-ruby (~> 1.0)
5
22
 
6
23
  PLATFORMS
7
24
  ruby
8
25
 
9
26
  DEPENDENCIES
10
27
  rake (~> 12.0)
28
+ ruby-clock!
11
29
 
12
30
  BUNDLED WITH
13
31
  2.1.4
data/README.md CHANGED
@@ -23,10 +23,6 @@ Add these lines to your application's Gemfile:
23
23
 
24
24
  ```ruby
25
25
  gem 'ruby-clock'
26
-
27
- # ruby-clock currently depends on rufus-scheduler master
28
- git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
29
- gem 'rufus-scheduler', github: 'jmettraux/rufus-scheduler'
30
26
  ```
31
27
 
32
28
  And then execute:
@@ -39,7 +35,8 @@ Or install it yourself as:
39
35
 
40
36
  ## Usage
41
37
 
42
- Write a file with your scheduled jobs in it, named Clockfile. The DSL and capabilities
38
+ Create a file named Clockfile. This will hold your job definitions.
39
+ The DSL and capabilities
43
40
  are the same as those of [rufus-scheduler](https://github.com/jmettraux/rufus-scheduler/).
44
41
  Read the rufus-scheduler documentation to see what you can do.
45
42
 
@@ -49,7 +46,7 @@ schedule.every('5 minutes') do
49
46
  end
50
47
 
51
48
  # do something every day, five minutes after midnight
52
- scheduler.cron '5 0 * * *' do
49
+ schedule.cron '5 0 * * *' do
53
50
  DailyActivitySummary.generate_and_send
54
51
  end
55
52
  ```
@@ -86,16 +83,25 @@ clock: bundle exec rails runer clock
86
83
 
87
84
  ### Error Handling
88
85
 
89
- todo
86
+ You can catch and report errors raised in your jobs by defining an error catcher at
87
+ the top of your Clockfile like this:
88
+
89
+ ```ruby
90
+ def schedule.on_error(job, error)
91
+ ErrorReporter.track_exception(error)
92
+ end
93
+ ```
90
94
 
91
95
  ### Callbacks
92
96
 
93
- todo
97
+ You can define before, after, and around callbacks which will run for all jobs.
98
+ Read [the rufus-scheduler documentation](https://github.com/jmettraux/rufus-scheduler/#callbacks)
99
+ to learn how to do this. Where the documentation references `s`, you should use `schedule`.
94
100
 
95
- ### rufus-scheduler Options
101
+ ### other rufus-scheduler Options
96
102
 
97
103
  All rufus-scheduler options are set to defaults. The `schedule` variable
98
- Available in your Clockfile is and instance of `Rufus::Scheduler`,
104
+ available in your Clockfile is an instance of `Rufus::Scheduler`,
99
105
  so anything you can do on this instance, you can do in your Clockfile.
100
106
 
101
107
  Perhaps in the future ruby-clock will add some easier specific configuration
@@ -1,3 +1,3 @@
1
1
  module RubyClock
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
@@ -29,5 +29,5 @@ Gem::Specification.new do |spec|
29
29
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
30
30
  spec.require_paths = ["lib"]
31
31
 
32
- # spec.add_dependency "rufus-scheduler", '~> 3.7.0'
32
+ spec.add_dependency "rufus-scheduler", '>= 3.7.0'
33
33
  end
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-clock
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Bachir
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-12-30 00:00:00.000000000 Z
12
- dependencies: []
11
+ date: 2020-12-31 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rufus-scheduler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 3.7.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 3.7.0
13
27
  description:
14
28
  email:
15
29
  - j@jjb.cc