iyyov 1.2.0-java → 1.3.0-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/History.rdoc +7 -0
- data/README.rdoc +1 -1
- data/bin/iyyov-fg +1 -1
- data/config/init.d/iyyov +1 -1
- data/init/iyyov +2 -2
- data/lib/iyyov.rb +1 -1
- data/lib/iyyov/base.rb +2 -2
- data/lib/iyyov/context.rb +31 -5
- data/lib/iyyov/daemon.rb +1 -1
- data/lib/iyyov/errors.rb +1 -1
- data/lib/iyyov/log_rotator.rb +1 -1
- data/lib/iyyov/scheduler.rb +1 -1
- data/lib/iyyov/shutdown_handler.rb +1 -1
- data/lib/iyyov/task.rb +1 -1
- data/test/setup.rb +1 -1
- data/test/test_context.rb +1 -1
- data/test/test_daemon.rb +1 -1
- data/test/test_scheduler.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fb9a4d2984880e18916ce5a0e68cca50950a4932
|
4
|
+
data.tar.gz: 97b47e8ed075a1df2d439fa0579656fdbe3f55cd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5a6cfbc1ce3601d6fa0a3e811e965802071e550772bf8bedcb2be6818a42da6ecd3dc3c442885d012d90ded4ea1082e677d451a2850d2dda59304cc0b3eba59e
|
7
|
+
data.tar.gz: e752e1fe1473db6330c188b37a259006f629b521ee91ac3cd848591f9c18a8fc25d7895398cbd5aac93e02f3e3ce9fe410b3aa6f724eb68200dec4f06a0e8664
|
data/History.rdoc
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
=== 1.3.0 (2014-2-24)
|
2
|
+
* Add Context.load_directory to load the contents of a jobs.d
|
3
|
+
directory. Each contained executable *.rb file is loaded. This
|
4
|
+
allows deploying a file for each independent job and
|
5
|
+
enabling/disabling jobs with chmod +x/-x. The directory itself and
|
6
|
+
all *.rb files are watched for mtime or ctime change.
|
7
|
+
|
1
8
|
=== 1.2.0 (2013-12-6)
|
2
9
|
* Improve deamon log output
|
3
10
|
* Add Travis CI test setup (build)
|
data/README.rdoc
CHANGED
@@ -83,7 +83,7 @@ the above provided examples.
|
|
83
83
|
|
84
84
|
== License
|
85
85
|
|
86
|
-
Copyright (c) 2010-
|
86
|
+
Copyright (c) 2010-2014 David Kellum
|
87
87
|
|
88
88
|
Licensed under the Apache License, Version 2.0 (the "License"); you
|
89
89
|
may not use this file except in compliance with the License. You
|
data/bin/iyyov-fg
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
#. hashdot.vm.options += -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled
|
5
5
|
|
6
6
|
#--
|
7
|
-
# Copyright (c) 2010-
|
7
|
+
# Copyright (c) 2010-2014 David Kellum
|
8
8
|
#
|
9
9
|
# Licensed under the Apache License, Version 2.0 (the "License"); you
|
10
10
|
# may not use this file except in compliance with the License. You
|
data/config/init.d/iyyov
CHANGED
data/init/iyyov
CHANGED
@@ -7,7 +7,7 @@
|
|
7
7
|
#. hashdot.vm.options += -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled
|
8
8
|
|
9
9
|
#--
|
10
|
-
# Copyright (c) 2010-
|
10
|
+
# Copyright (c) 2010-2014 David Kellum
|
11
11
|
#
|
12
12
|
# Licensed under the Apache License, Version 2.0 (the "License"); you
|
13
13
|
# may not use this file except in compliance with the License. You
|
@@ -24,7 +24,7 @@
|
|
24
24
|
|
25
25
|
require 'rubygems'
|
26
26
|
|
27
|
-
gem( "iyyov", "= 1.
|
27
|
+
gem( "iyyov", "= 1.3.0" )
|
28
28
|
|
29
29
|
require 'rjack-logback'
|
30
30
|
RJack::Logback.config_console( :full => true, :thread => true )
|
data/lib/iyyov.rb
CHANGED
data/lib/iyyov/base.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
#--
|
2
|
-
# Copyright (c) 2010-
|
2
|
+
# Copyright (c) 2010-2014 David Kellum
|
3
3
|
#
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "License"); you
|
5
5
|
# may not use this file except in compliance with the License. You
|
@@ -16,5 +16,5 @@
|
|
16
16
|
|
17
17
|
module Iyyov
|
18
18
|
# Iyyov version
|
19
|
-
VERSION = '1.
|
19
|
+
VERSION = '1.3.0'
|
20
20
|
end
|
data/lib/iyyov/context.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
#--
|
2
|
-
# Copyright (c) 2010-
|
2
|
+
# Copyright (c) 2010-2014 David Kellum
|
3
3
|
#
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "License"); you
|
5
5
|
# may not use this file except in compliance with the License. You
|
@@ -125,11 +125,32 @@ module Iyyov
|
|
125
125
|
nil
|
126
126
|
end
|
127
127
|
|
128
|
+
# Load all executable *.rb files in the specified
|
129
|
+
# directory. Non-executable *.rb files are assumed temporarily
|
130
|
+
# disabled and are still watched for a ctime change. The
|
131
|
+
# directory itself is also watched for an mtime change (as in
|
132
|
+
# adding a new file).
|
133
|
+
def load_directory( dir )
|
134
|
+
@files[ dir ] = [ File.stat( dir ).mtime, nil ]
|
135
|
+
|
136
|
+
Dir.glob( File.join( dir, '*.rb' ) ) do |file|
|
137
|
+
fstat = File.stat( file )
|
138
|
+
if fstat.executable?
|
139
|
+
load_file( file )
|
140
|
+
else
|
141
|
+
# Still watch ctime on this file, so if it changes to executable
|
142
|
+
# we reload.
|
143
|
+
@files[ file ] = [ nil, fstat.ctime ]
|
144
|
+
end
|
145
|
+
end
|
146
|
+
end
|
147
|
+
|
128
148
|
def load_file( file, is_root = false )
|
129
149
|
@log.info { "Loading #{file}" }
|
130
150
|
begin
|
151
|
+
fstat = File.stat( file )
|
152
|
+
@files[ file ] = [ fstat.mtime, fstat.ctime ]
|
131
153
|
load file
|
132
|
-
@files[ file ] = File.stat( file ).mtime
|
133
154
|
@root_files << file if is_root
|
134
155
|
true
|
135
156
|
rescue SetupError, ScriptError, StandardError => e
|
@@ -155,14 +176,19 @@ module Iyyov
|
|
155
176
|
return unless @watch_files && ! @files.empty?
|
156
177
|
t = Task.new( :name => "watch-files", :period => 11.0 ) do
|
157
178
|
reload = false
|
158
|
-
@files.each do |fname,
|
179
|
+
@files.each do |fname, (last_mtime, last_ctime)|
|
159
180
|
begin
|
160
|
-
|
161
|
-
if
|
181
|
+
fstat = File.stat( fname )
|
182
|
+
if last_mtime && ( last_mtime != fstat.mtime )
|
162
183
|
@log.info { "#{fname} has new modification time, reloading." }
|
163
184
|
reload = true
|
164
185
|
break
|
165
186
|
end
|
187
|
+
if last_ctime && ( last_ctime != fstat.ctime )
|
188
|
+
@log.info { "#{fname} has new change time, reloading." }
|
189
|
+
reload = true
|
190
|
+
break
|
191
|
+
end
|
166
192
|
rescue Errno::ENOENT, Errno::EACCES => e
|
167
193
|
@log.error( e.to_s )
|
168
194
|
end
|
data/lib/iyyov/daemon.rb
CHANGED
data/lib/iyyov/errors.rb
CHANGED
data/lib/iyyov/log_rotator.rb
CHANGED
data/lib/iyyov/scheduler.rb
CHANGED
data/lib/iyyov/task.rb
CHANGED
data/test/setup.rb
CHANGED
data/test/test_context.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#!/usr/bin/env jruby
|
2
2
|
#.hashdot.profile += jruby-shortlived
|
3
3
|
#--
|
4
|
-
# Copyright (c) 2010-
|
4
|
+
# Copyright (c) 2010-2014 David Kellum
|
5
5
|
#
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License"); you
|
7
7
|
# may not use this file except in compliance with the License. You
|
data/test/test_daemon.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#!/usr/bin/env jruby
|
2
2
|
#.hashdot.profile += jruby-shortlived
|
3
3
|
#--
|
4
|
-
# Copyright (c) 2010-
|
4
|
+
# Copyright (c) 2010-2014 David Kellum
|
5
5
|
#
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License"); you
|
7
7
|
# may not use this file except in compliance with the License. You
|
data/test/test_scheduler.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#!/usr/bin/env jruby
|
2
2
|
#.hashdot.profile += jruby-shortlived
|
3
3
|
#--
|
4
|
-
# Copyright (c) 2010-
|
4
|
+
# Copyright (c) 2010-2014 David Kellum
|
5
5
|
#
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License"); you
|
7
7
|
# may not use this file except in compliance with the License. You
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: iyyov
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- David Kellum
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-02-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rjack-slf4j
|