iyyov 1.1.2-java → 1.1.3-java

Sign up to get free protection for your applications and to get access to all the features.
data/History.rdoc CHANGED
@@ -1,3 +1,10 @@
1
+ === 1.1.3 (2012-1-15)
2
+ * Add task on call to block for log access, etc.
3
+ * Fix handling of Gem::LoadError on reload of jobs.rb extended with a
4
+ daemon who's gem is not currently installed. Previously this was
5
+ fatal error.
6
+ * Upgrade to tarpit ~> 2.0, bundler Gemfile, gemspec (build)
7
+
1
8
  === 1.1.2 (2011-9-11)
2
9
  * Add Task.log accessor.
3
10
  * Fixes for ruby 1.9 compatibility; to_a -> Array()
data/README.rdoc CHANGED
@@ -82,7 +82,7 @@ the above provided examples.
82
82
 
83
83
  == License
84
84
 
85
- Copyright (c) 2010-2011 David Kellum
85
+ Copyright (c) 2010-2012 David Kellum
86
86
 
87
87
  Licensed under the Apache License, Version 2.0 (the "License"); you
88
88
  may not use this file except in compliance with the License. You
data/Rakefile CHANGED
@@ -1,50 +1,7 @@
1
1
  # -*- ruby -*-
2
2
 
3
- $LOAD_PATH << './lib'
4
-
5
3
  require 'rubygems'
6
- gem 'rjack-tarpit', '~> 1.3.3'
4
+ require 'bundler/setup'
7
5
  require 'rjack-tarpit'
8
6
 
9
- require 'iyyov/base'
10
-
11
- t = RJack::TarPit.new( 'iyyov', Iyyov::VERSION, :java_platform )
12
-
13
- t.specify do |h|
14
- h.developer( 'David Kellum', 'dek-oss@gravitext.com' )
15
- h.testlib = :minitest
16
- h.extra_deps += [ [ 'rjack-slf4j', '~> 1.6.1' ],
17
- [ 'rjack-logback', '~> 1.1' ],
18
- [ 'logrotate', '= 1.2.1' ] ]
19
- h.extra_dev_deps += [ [ 'minitest', '~> 2.2' ],
20
- [ 'hashdot-test-daemon', '~> 1.2' ] ]
21
- end
22
-
23
- # Version/date consistency checks:
24
-
25
- task :chk_init_v do
26
- t.test_line_match( 'init/iyyov',
27
- /^gem.+#{t.name}/, /= #{t.version}/ )
28
- end
29
- task :chk_rcd_v do
30
- t.test_line_match( 'config/init.d/iyyov', /^version=".+"/, /"#{t.version}"/ )
31
- end
32
- task :chk_cron_v do
33
- t.test_line_match( 'config/crontab', /gems\/iyyov/,
34
- /iyyov-#{t.version}-java/ )
35
- end
36
- task :chk_hist_v do
37
- t.test_line_match( 'History.rdoc', /^==/, / #{t.version} / )
38
- end
39
-
40
- gem_tests = [ :chk_init_v, :chk_rcd_v, :chk_cron_v, :chk_hist_v ]
41
-
42
- task :chk_hist_date do
43
- t.test_line_match( 'History.rdoc', /^==/, /\([0-9\-]+\)$/ )
44
- end
45
-
46
- task :gem => gem_tests
47
- task :tag => gem_tests + [ :chk_hist_date ]
48
- task :push => [ :chk_hist_date ]
49
-
50
- t.define_tasks
7
+ RJack::TarPit.new( 'iyyov' ).define_tasks
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-2011 David Kellum
7
+ # Copyright (c) 2010-2012 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/crontab CHANGED
@@ -1,2 +1,2 @@
1
1
  # PATH=/opt/bin
2
- */1 * * * * cd /opt/var/iyyov && /opt/jruby/gems/gems/iyyov-1.1.2-java/init/iyyov jobs.rb
2
+ */1 * * * * cd /opt/var/iyyov && /opt/jruby/gems/gems/iyyov-1.1.3-java/init/iyyov jobs.rb
data/config/init.d/iyyov CHANGED
@@ -14,7 +14,7 @@
14
14
  gem_home="/opt/jruby/gems"
15
15
 
16
16
  # (Exact) Gem version of iyyov to run
17
- version="1.1.2"
17
+ version="1.1.3"
18
18
 
19
19
  # User to run the daemon as (should own rundir)
20
20
  user="iyyov"
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-2011 David Kellum
10
+ # Copyright (c) 2010-2012 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.1.2" )
27
+ gem( "iyyov", "= 1.1.3" )
28
28
 
29
29
  require 'rjack-logback'
30
30
  RJack::Logback.config_console( :full => true, :thread => true )
data/lib/iyyov.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  #--
2
- # Copyright (c) 2010-2011 David Kellum
2
+ # Copyright (c) 2010-2012 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
data/lib/iyyov/base.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  #--
2
- # Copyright (c) 2010-2011 David Kellum
2
+ # Copyright (c) 2010-2012 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.1.2'
19
+ VERSION = '1.1.3'
20
20
  end
data/lib/iyyov/context.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  #--
2
- # Copyright (c) 2010-2011 David Kellum
2
+ # Copyright (c) 2010-2012 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
data/lib/iyyov/daemon.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  #--
2
- # Copyright (c) 2010-2011 David Kellum
2
+ # Copyright (c) 2010-2012 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
@@ -264,8 +264,16 @@ module Iyyov
264
264
  # Return array suitable for comparing this daemon with prior
265
265
  # running instance.
266
266
  def exec_key
267
- keys = [ run_dir, exe_path ].map { |p| File.expand_path( p ) }
268
- keys += args.map { |a| a.to_s.strip }.compact
267
+ epath = begin
268
+ exe_path
269
+ rescue Gem::LoadError, Gem::GemNotFoundException => e
270
+ @log.warn( e.to_s )
271
+ # Use a bogus, unique path instead
272
+ "/tmp/gem-not-found/#{ Time.now.usec }/#{ rand( 2**31 ) }"
273
+ end
274
+
275
+ keys = [ run_dir, epath ].map { |p| File.expand_path( p ) }
276
+ keys += args.map { |a| a.to_s.strip }
269
277
  keys.compact
270
278
  end
271
279
 
data/lib/iyyov/errors.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  #--
2
- # Copyright (c) 2010-2011 David Kellum
2
+ # Copyright (c) 2010-2012 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
@@ -1,5 +1,5 @@
1
1
  #--
2
- # Copyright (c) 2010-2011 David Kellum
2
+ # Copyright (c) 2010-2012 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
@@ -1,5 +1,5 @@
1
1
  #--
2
- # Copyright (c) 2010-2011 David Kellum
2
+ # Copyright (c) 2010-2012 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
@@ -1,5 +1,5 @@
1
1
  #--
2
- # Copyright (c) 2010-2011 David Kellum
2
+ # Copyright (c) 2010-2012 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
data/lib/iyyov/task.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  #--
2
- # Copyright (c) 2010-2011 David Kellum
2
+ # Copyright (c) 2010-2012 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
@@ -133,7 +133,7 @@ module Iyyov
133
133
  def run_direct
134
134
  @log.debug "Running."
135
135
  begin
136
- rc = ( @block.call if @block )
136
+ rc = ( @block.call( self ) if @block )
137
137
  filter( rc )
138
138
  rescue StandardError => e
139
139
  @log.error( "Handled and stopped with: ", e )
data/test/setup.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  #--
2
- # Copyright (c) 2010-2011 David Kellum
2
+ # Copyright (c) 2010-2012 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
@@ -14,37 +14,20 @@
14
14
  # permissions and limitations under the License.
15
15
  #++
16
16
 
17
- #### General test setup: LOAD_PATH, logging, console output ####
17
+ #### General test setup, logging, console output ####
18
18
 
19
- ldir = File.join( File.dirname( __FILE__ ), "..", "lib" )
20
- $LOAD_PATH.unshift( ldir ) unless $LOAD_PATH.include?( ldir )
19
+ require 'rubygems'
20
+ require 'bundler/setup'
21
21
 
22
- def time_it( name )
23
- start = Time.now
24
- output = ARGV.include?( '-v' )
25
- $stdout.write( "Loading %10s..." % name ) if output
26
- yield
27
- puts "%6.3fs" % (Time.now - start) if output
28
- end
29
-
30
- time_it( "rubygems" ) do
31
- require 'rubygems'
32
- end
33
-
34
- time_it( "logback" ) do
35
- require 'rjack-logback'
36
- RJack::Logback.config_console( :level => RJack::Logback::INFO, :stderr => true )
37
- end
38
-
39
- time_it( "test/unit" ) do
40
- require 'minitest/unit'
41
- require 'minitest/autorun'
22
+ require 'rjack-logback'
23
+ RJack::Logback.config_console( :level => RJack::Logback::INFO, :stderr => true )
42
24
 
43
- # Make test output logging compatible: no partial lines.
44
- class TestOut
45
- def print( *a ); $stdout.puts( *a ); end
46
- def puts( *a ); $stdout.puts( *a ); end
47
- end
48
- MiniTest::Unit.output = TestOut.new
25
+ require 'minitest/unit'
26
+ require 'minitest/autorun'
49
27
 
28
+ # Make test output logging compatible: no partial lines.
29
+ class TestOut
30
+ def print( *a ); $stdout.puts( *a ); end
31
+ def puts( *a ); $stdout.puts( *a ); end
50
32
  end
33
+ MiniTest::Unit.output = TestOut.new
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-2011 David Kellum
4
+ # Copyright (c) 2010-2012 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-2011 David Kellum
4
+ # Copyright (c) 2010-2012 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
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env jruby
2
2
  #.hashdot.profile += jruby-shortlived
3
3
  #--
4
- # Copyright (c) 2010-2011 David Kellum
4
+ # Copyright (c) 2010-2012 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
@@ -58,10 +58,13 @@ class TestScheduler < MiniTest::Unit::TestCase
58
58
  s = Scheduler.new
59
59
  s.on_exit { flunk "Shouldn't make it here" }
60
60
  counter = 0
61
- tk = Task.new( :name => "test_shutdown", :period => 0.001 ) do
61
+ tk = Task.new( :name => "test_shutdown", :period => 0.001 ) do |t|
62
62
  counter += 1
63
63
  assert( counter <= 2 )
64
- :shutdown unless counter < 2
64
+ unless counter < 2
65
+ t.log.info "Shutting it down now"
66
+ :shutdown
67
+ end
65
68
  end
66
69
  s.add( tk )
67
70
  s.add( Task.new( :period => 5.0 ) { flunk "nor here" } )
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: iyyov
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.1.2
5
+ version: 1.1.3
6
6
  platform: java
7
7
  authors:
8
8
  - David Kellum
@@ -10,75 +10,75 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-09-11 00:00:00 Z
13
+ date: 2012-01-15 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rjack-slf4j
17
- prerelease: false
18
- requirement: &id001 !ruby/object:Gem::Requirement
17
+ version_requirements: &id001 !ruby/object:Gem::Requirement
19
18
  none: false
20
19
  requirements:
21
20
  - - ~>
22
21
  - !ruby/object:Gem::Version
23
22
  version: 1.6.1
23
+ requirement: *id001
24
+ prerelease: false
24
25
  type: :runtime
25
- version_requirements: *id001
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: rjack-logback
28
- prerelease: false
29
- requirement: &id002 !ruby/object:Gem::Requirement
28
+ version_requirements: &id002 !ruby/object:Gem::Requirement
30
29
  none: false
31
30
  requirements:
32
31
  - - ~>
33
32
  - !ruby/object:Gem::Version
34
33
  version: "1.1"
34
+ requirement: *id002
35
+ prerelease: false
35
36
  type: :runtime
36
- version_requirements: *id002
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: logrotate
39
- prerelease: false
40
- requirement: &id003 !ruby/object:Gem::Requirement
39
+ version_requirements: &id003 !ruby/object:Gem::Requirement
41
40
  none: false
42
41
  requirements:
43
42
  - - "="
44
43
  - !ruby/object:Gem::Version
45
44
  version: 1.2.1
45
+ requirement: *id003
46
+ prerelease: false
46
47
  type: :runtime
47
- version_requirements: *id003
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: minitest
50
- prerelease: false
51
- requirement: &id004 !ruby/object:Gem::Requirement
50
+ version_requirements: &id004 !ruby/object:Gem::Requirement
52
51
  none: false
53
52
  requirements:
54
53
  - - ~>
55
54
  - !ruby/object:Gem::Version
56
55
  version: "2.2"
56
+ requirement: *id004
57
+ prerelease: false
57
58
  type: :development
58
- version_requirements: *id004
59
59
  - !ruby/object:Gem::Dependency
60
60
  name: hashdot-test-daemon
61
- prerelease: false
62
- requirement: &id005 !ruby/object:Gem::Requirement
61
+ version_requirements: &id005 !ruby/object:Gem::Requirement
63
62
  none: false
64
63
  requirements:
65
64
  - - ~>
66
65
  - !ruby/object:Gem::Version
67
66
  version: "1.2"
67
+ requirement: *id005
68
+ prerelease: false
68
69
  type: :development
69
- version_requirements: *id005
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: rjack-tarpit
72
- prerelease: false
73
- requirement: &id006 !ruby/object:Gem::Requirement
72
+ version_requirements: &id006 !ruby/object:Gem::Requirement
74
73
  none: false
75
74
  requirements:
76
75
  - - ~>
77
76
  - !ruby/object:Gem::Version
78
- version: 1.3.3
77
+ version: "2.0"
78
+ requirement: *id006
79
+ prerelease: false
79
80
  type: :development
80
- version_requirements: *id006
81
- description: Down-to-earth job control and monitoring.
81
+ description:
82
82
  email:
83
83
  - dek-oss@gravitext.com
84
84
  executables:
@@ -86,7 +86,6 @@ executables:
86
86
  extensions: []
87
87
 
88
88
  extra_rdoc_files:
89
- - Manifest.txt
90
89
  - History.rdoc
91
90
  - README.rdoc
92
91
  files:
@@ -131,21 +130,25 @@ required_ruby_version: !ruby/object:Gem::Requirement
131
130
  requirements:
132
131
  - - ">="
133
132
  - !ruby/object:Gem::Version
133
+ hash: 2
134
+ segments:
135
+ - 0
134
136
  version: "0"
135
137
  required_rubygems_version: !ruby/object:Gem::Requirement
136
138
  none: false
137
139
  requirements:
138
140
  - - ">="
139
141
  - !ruby/object:Gem::Version
142
+ hash: 2
143
+ segments:
144
+ - 0
140
145
  version: "0"
141
146
  requirements: []
142
147
 
143
- rubyforge_project: iyyov
144
- rubygems_version: 1.8.10
148
+ rubyforge_project:
149
+ rubygems_version: 1.8.11
145
150
  signing_key:
146
151
  specification_version: 3
147
152
  summary: Down-to-earth job control and monitoring.
148
- test_files:
149
- - test/test_daemon.rb
150
- - test/test_context.rb
151
- - test/test_scheduler.rb
153
+ test_files: []
154
+