fist_of_fury 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
  SHA1:
3
- metadata.gz: 30fd5d339ee339c1294b986583f7a0abed1cb08a
4
- data.tar.gz: 593d60d97908fa37af0f13192fc68487950d8a71
3
+ metadata.gz: a87495360273789b52e5c9c5f1b0157e8944fb93
4
+ data.tar.gz: 50d8d0dc0029683dc4c85080e6075520c5c02795
5
5
  SHA512:
6
- metadata.gz: 01928d25ec21fece7ac05657327f503ac07f287067b0bf979823241bce3e2a324e9124401343e9cff4668cd18187c620e33f96587284e67318d9094a5aec67a0
7
- data.tar.gz: f2697fdaf69a3f99e0b14a70f365f10a3cb8588d80b8c4b327d4bb4d1a0775d7ecaaafc98290331737e02611f6ef66005e85356e3067f01115bb5e26ad173534
6
+ metadata.gz: fc8a70ba4038aa43a0c97966a9728d4b7ea876a6450d51476c06f59ca1580e77a81906c465175bd9b0df398cc176f0040b16452acfbcbff106f10e0dbef05b1c
7
+ data.tar.gz: 1f533955bb5b36148f0dd51bc025d0f0a3c4b8d14197b6bf0fce161d99bd2d8b057f5feae8273d81429b8799d01bc83c71b390ef73bc12f2b8120f0df133af3d
data/README.md CHANGED
@@ -20,7 +20,7 @@ Fist of Fury is heavily inspired by [Sidetiq](https://github.com/tobiassvn/sidet
20
20
 
21
21
  Add this line to your application's Gemfile:
22
22
 
23
- gem 'fist_of_fury', '~> 0.1.0'
23
+ gem 'fist_of_fury', '~> 0.2.0'
24
24
 
25
25
  And then execute:
26
26
 
@@ -54,8 +54,8 @@ Then in the initializer:
54
54
  ```Ruby
55
55
  # config/initializers/fist_of_fury.rb
56
56
 
57
- # Ensures the jobs don't run while in the Rails console.
58
- unless defined?(Rails::Console)
57
+ # Ensures the jobs run only in a web server.
58
+ if defined?(Rails::Server)
59
59
  FistOfFury.attack!
60
60
  end
61
61
  ```
@@ -65,8 +65,8 @@ Or you can even specify the recurrence rules all within the initializer:
65
65
  ```Ruby
66
66
  # config/initializers/fist_of_fury.rb
67
67
 
68
- # Ensures the jobs don't run while in the Rails console.
69
- unless defined?(Rails::Console)
68
+ # Ensures the jobs run only in a web server.
69
+ if defined?(Rails::Server)
70
70
  FistOfFury.attack! do
71
71
  LogJob.recurs { secondly(3) }
72
72
  end
@@ -90,3 +90,7 @@ end
90
90
  3. Commit your changes (`git commit -am 'Add some feature'`)
91
91
  4. Push to the branch (`git push origin my-new-feature`)
92
92
  5. Create new Pull Request
93
+
94
+
95
+ [![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/facto/fist_of_fury/trend.png)](https://bitdeli.com/free "Bitdeli Badge")
96
+
@@ -4,7 +4,7 @@ module FistOfFury
4
4
 
5
5
  def dispatch(worker, time)
6
6
  worker.schedule_next(time) do
7
- enqueue(worker, worker.next_occurrence(time))
7
+ enqueue(worker, worker.next_scheduled_occurrence)
8
8
  end
9
9
  rescue StandardError => e
10
10
  # TODO: exception handling support
@@ -1,6 +1,4 @@
1
1
  module FistOfFury
2
2
  class Railtie < ::Rails::Railtie
3
- initializer 'fist_of_fury' do
4
- end
5
3
  end
6
4
  end
@@ -20,8 +20,8 @@ module FistOfFury
20
20
 
21
21
  def schedule_next(time)
22
22
  return unless schedule_next?(time)
23
- yield
24
23
  self.last_occurrence = next_occurrence(time)
24
+ yield
25
25
  end
26
26
 
27
27
  def to_s
@@ -1,3 +1,3 @@
1
1
  module FistOfFury
2
- VERSION = "0.1.0"
2
+ VERSION = '0.2.0'
3
3
  end
@@ -0,0 +1,15 @@
1
+ require 'rails/generators/base'
2
+
3
+ module FistOfFury
4
+ module Generators
5
+ class InstallGenerator < ::Rails::Generators::Base
6
+ desc "Description:\n Copy Fist of Fury files to your application."
7
+
8
+ source_root File.expand_path(File.join(File.dirname(__FILE__), 'templates'))
9
+
10
+ def copy_initializer
11
+ directory 'config'
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,7 @@
1
+ # Ensure the jobs run only in a web server.
2
+ if defined?(Rails::Server)
3
+ FistOfFury.attack! do
4
+ # Jobs can be scheduled here. Example:
5
+ # SayHiJob.recurs { secondly(3) }
6
+ end
7
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fist_of_fury
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
  - Joshua Rieken
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-21 00:00:00.000000000 Z
11
+ date: 2014-03-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry
@@ -181,6 +181,8 @@ files:
181
181
  - lib/fist_of_fury/subclass_tracking.rb
182
182
  - lib/fist_of_fury/supervisor.rb
183
183
  - lib/fist_of_fury/version.rb
184
+ - lib/generators/fist_of_fury/install/install_generator.rb
185
+ - lib/generators/fist_of_fury/install/templates/config/initializers/fist_of_fury.rb
184
186
  - spec/fist_of_fury/actor_sharedspec.rb
185
187
  - spec/fist_of_fury/actors/clock_spec.rb
186
188
  - spec/fist_of_fury/actors/dispatcher_spec.rb