clockwork_web 0.0.5 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of clockwork_web might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: fe021b7533f639dfb559003b52b2dd13c3c1e4a9
4
- data.tar.gz: bb65eeab6fda7e2dcb07423ecd06a9e82df3c70e
2
+ SHA256:
3
+ metadata.gz: cb4507656be51be5803d15951b721188e59f5e6bc509d53746029c4b599f3482
4
+ data.tar.gz: a904897c40fc10a1cf053b00ac28fd2e9c7b8a546428df7e90e8ce8228b61df2
5
5
  SHA512:
6
- metadata.gz: f5181a10c696b4b72be54d526fc55246834f1698b322c7223156d3162992363c6cf5439ea9f48b19c9b16e04ea3fdba794038300681da7309b4ddd956af12c3a
7
- data.tar.gz: 89c743c4d6131fbdfff0d8a3f2216956b1dfe75e7ded768faec05e57baebf2840207216aa98d027687ae7179fce74189cf55ae18be8fcd906946ea1b3f8f2e5f
6
+ metadata.gz: 5e2a303c738ef6ede0a87b0a2c56baa6f0e0d5239d8131a21778ac223682d48502157f07e4df88e17e7070df4782250e477b83112aac88b132e52f59e750ab2a
7
+ data.tar.gz: 7bbfb873995d0c30698573a719a33b40ddc5e4b3b706528d669fe29146836be8650c469702ef7624682fc5f1f63dd1fc73a3780c36c7fdb5794757a25e347889
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
- ## 0.0.4 [unreleased]
1
+ ## 0.1.0
2
+
3
+ - Added `on_job_update` hook
4
+
5
+ ## 0.0.5
6
+
7
+ - Added `running_threshold` option
8
+
9
+ ## 0.0.4
2
10
 
3
11
  - Better monitoring for multiple processes
data/LICENSE.txt CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2015 Andrew Kane
1
+ Copyright (c) 2015-2019 Andrew Kane
2
2
 
3
3
  MIT License
4
4
 
data/README.md CHANGED
@@ -8,7 +8,7 @@ A web interface for Clockwork
8
8
  - monitor jobs
9
9
  - disable jobs
10
10
 
11
- :tangerine: Battle-tested at [Instacart](https://www.instacart.com)
11
+ :tangerine: Battle-tested at [Instacart](https://www.instacart.com/opensource)
12
12
 
13
13
  ## Installation
14
14
 
@@ -70,10 +70,6 @@ Turn off monitoring
70
70
  ClockworkWeb.monitor = false
71
71
  ```
72
72
 
73
- ## TODO
74
-
75
- - better design
76
-
77
73
  ## History
78
74
 
79
75
  View the [changelog](CHANGELOG.md)
@@ -24,13 +24,14 @@ module ClockworkWeb
24
24
 
25
25
  def job
26
26
  job = params[:job]
27
- if params[:enable] == "true"
27
+ enable = params[:enable] == "true"
28
+ if enable
28
29
  ClockworkWeb.enable(job)
29
30
  else
30
31
  ClockworkWeb.disable(job)
31
32
  end
33
+ ClockworkWeb.on_job_update.call(job: job, enable: enable, user: try(:current_user)) if ClockworkWeb.on_job_update
32
34
  redirect_to root_path
33
35
  end
34
-
35
36
  end
36
37
  end
data/lib/clockwork_web.rb CHANGED
@@ -2,7 +2,7 @@ require "clockwork_web/version"
2
2
 
3
3
  # dependencies
4
4
  require "clockwork"
5
- require "safely_block"
5
+ require "safely_block/core"
6
6
 
7
7
  # engine
8
8
  require "clockwork_web/engine"
@@ -18,6 +18,7 @@ module ClockworkWeb
18
18
  attr_accessor :redis
19
19
  attr_accessor :monitor
20
20
  attr_accessor :running_threshold
21
+ attr_accessor :on_job_update
21
22
  end
22
23
  self.monitor = true
23
24
  self.running_threshold = 60 # seconds
@@ -108,7 +109,7 @@ module Clockwork
108
109
 
109
110
  on(:before_run) do |event, t|
110
111
  run = true
111
- safely do
112
+ Safely.safely do
112
113
  run = ClockworkWeb.enabled?(event.job)
113
114
  if run
114
115
  ClockworkWeb.set_last_run(event.job)
@@ -2,7 +2,7 @@ module ClockworkWeb
2
2
  class Engine < ::Rails::Engine
3
3
  isolate_namespace ClockworkWeb
4
4
 
5
- initializer "clockwork_web" do |app|
5
+ initializer "clockwork_web" do
6
6
  ClockworkWeb.clock_path ||= Rails.root.join("clock")
7
7
  require ClockworkWeb.clock_path.to_s
8
8
  end
@@ -1,3 +1,3 @@
1
1
  module ClockworkWeb
2
- VERSION = "0.0.5"
2
+ VERSION = "0.1.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: clockwork_web
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-14 00:00:00.000000000 Z
11
+ date: 2019-10-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: clockwork
@@ -26,6 +26,20 @@ dependencies:
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: safely_block
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 0.1.1
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: 0.1.1
41
+ - !ruby/object:Gem::Dependency
42
+ name: railties
29
43
  requirement: !ruby/object:Gem::Requirement
30
44
  requirements:
31
45
  - - ">="
@@ -42,47 +56,42 @@ dependencies:
42
56
  name: bundler
43
57
  requirement: !ruby/object:Gem::Requirement
44
58
  requirements:
45
- - - "~>"
59
+ - - ">="
46
60
  - !ruby/object:Gem::Version
47
- version: '1.7'
61
+ version: '0'
48
62
  type: :development
49
63
  prerelease: false
50
64
  version_requirements: !ruby/object:Gem::Requirement
51
65
  requirements:
52
- - - "~>"
66
+ - - ">="
53
67
  - !ruby/object:Gem::Version
54
- version: '1.7'
68
+ version: '0'
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: rake
57
71
  requirement: !ruby/object:Gem::Requirement
58
72
  requirements:
59
- - - "~>"
73
+ - - ">="
60
74
  - !ruby/object:Gem::Version
61
- version: '10.0'
75
+ version: '0'
62
76
  type: :development
63
77
  prerelease: false
64
78
  version_requirements: !ruby/object:Gem::Requirement
65
79
  requirements:
66
- - - "~>"
80
+ - - ">="
67
81
  - !ruby/object:Gem::Version
68
- version: '10.0'
69
- description: A web interface for Clockwork
70
- email:
71
- - andrew@chartkick.com
82
+ version: '0'
83
+ description:
84
+ email: andrew@chartkick.com
72
85
  executables: []
73
86
  extensions: []
74
87
  extra_rdoc_files: []
75
88
  files:
76
- - ".gitignore"
77
89
  - CHANGELOG.md
78
- - Gemfile
79
90
  - LICENSE.txt
80
91
  - README.md
81
- - Rakefile
82
92
  - app/controllers/clockwork_web/home_controller.rb
83
93
  - app/helpers/clockwork_web/home_helper.rb
84
94
  - app/views/clockwork_web/home/index.html.erb
85
- - clockwork_web.gemspec
86
95
  - config/routes.rb
87
96
  - lib/clockwork_web.rb
88
97
  - lib/clockwork_web/engine.rb
@@ -99,17 +108,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
99
108
  requirements:
100
109
  - - ">="
101
110
  - !ruby/object:Gem::Version
102
- version: '0'
111
+ version: '2.4'
103
112
  required_rubygems_version: !ruby/object:Gem::Requirement
104
113
  requirements:
105
114
  - - ">="
106
115
  - !ruby/object:Gem::Version
107
116
  version: '0'
108
117
  requirements: []
109
- rubyforge_project:
110
- rubygems_version: 2.4.5
118
+ rubygems_version: 3.0.3
111
119
  signing_key:
112
120
  specification_version: 4
113
121
  summary: A web interface for Clockwork
114
122
  test_files: []
115
- has_rdoc:
data/.gitignore DELETED
@@ -1,14 +0,0 @@
1
- /.bundle/
2
- /.yardoc
3
- /Gemfile.lock
4
- /_yardoc/
5
- /coverage/
6
- /doc/
7
- /pkg/
8
- /spec/reports/
9
- /tmp/
10
- *.bundle
11
- *.so
12
- *.o
13
- *.a
14
- mkmf.log
data/Gemfile DELETED
@@ -1,4 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- # Specify your gem's dependencies in clockwork_web.gemspec
4
- gemspec
data/Rakefile DELETED
@@ -1,2 +0,0 @@
1
- require "bundler/gem_tasks"
2
-
@@ -1,26 +0,0 @@
1
- # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
3
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'clockwork_web/version'
5
-
6
- Gem::Specification.new do |spec|
7
- spec.name = "clockwork_web"
8
- spec.version = ClockworkWeb::VERSION
9
- spec.authors = ["Andrew Kane"]
10
- spec.email = ["andrew@chartkick.com"]
11
- spec.summary = %q{A web interface for Clockwork}
12
- spec.description = %q{A web interface for Clockwork}
13
- spec.homepage = "https://github.com/ankane/clockwork_web"
14
- spec.license = "MIT"
15
-
16
- spec.files = `git ls-files -z`.split("\x0")
17
- spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
- spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
- spec.require_paths = ["lib"]
20
-
21
- spec.add_dependency "clockwork"
22
- spec.add_dependency "safely_block"
23
-
24
- spec.add_development_dependency "bundler", "~> 1.7"
25
- spec.add_development_dependency "rake", "~> 10.0"
26
- end