trinidad_daemon_extension 0.2.6 → 0.2.7

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,3 +1,7 @@
1
+ == 0.2.7 (2011-03-19)
2
+
3
+ * Fix delegation issue to get the host
4
+
1
5
  == 0.2.6 (2011-02-22)
2
6
 
3
7
  * Fix issue overriding JVM arguments
data/README CHANGED
@@ -31,23 +31,6 @@ It uses a temporal directory to write the pid file but its route can be override
31
31
 
32
32
  $ jruby -S trinidad --load daemon --daemonize ./trinidad.pid
33
33
 
34
- The log file where the daemon writes its logs is also configurable from the trinidad's configuration file.
35
- By default it writes the logs into the file log/trinidad.log with the level INFO, to modify this behaviour you just need to add these lines under the daemon configuration:
36
-
37
- ---
38
- extensions:
39
- daemon:
40
- log:
41
- file: trinidad.log # where the daemon writes its output
42
- level: ALL # severity level, it cn be one of these: ALL, CONFIG, FINE, FINER, FINEST, INFO, OFF, SEVERE, WARNING
43
-
44
- This log is enabled by default but if we don't need it or we are using another logger system we can also disable it:
45
-
46
- ---
47
- extension:
48
- daemon:
49
- nolog:
50
-
51
34
  The extension also allows to add new JVM arguments to run the daemon with. They just need to be added into the configuration file:
52
35
 
53
36
  ---
@@ -57,6 +40,10 @@ The extension also allows to add new JVM arguments to run the daemon with. They
57
40
 
58
41
  You can find further information on how to write your own extension in the wiki: http://wiki.github.com/calavera/trinidad/extensions
59
42
 
43
+ # DEVELOPMENT
44
+
45
+ Copy the hooks into git-hooks directory to .git/hooks to make sure the jar file is updated when the java code is modified.
46
+
60
47
  # Copyright
61
48
 
62
49
  Copyright (c) 2010 David Calavera. See LICENSE for details.
data/Rakefile CHANGED
@@ -123,13 +123,11 @@ task :gemspec => :validate do
123
123
  split("\n").
124
124
  sort.
125
125
  reject { |file| file =~ /^\./ }.
126
- reject { |file| file =~ /^(rdoc|pkg|src)/ }.
126
+ reject { |file| file =~ /^(rdoc|pkg|src|git-hooks)/ }.
127
127
  reject { |file| file =~ /tomcat-core.jar/ }.
128
128
  map { |file| " #{file}" }.
129
129
  join("\n")
130
130
 
131
- files << "\n trinidad-libs/trinidad-daemon-extension.jar"
132
-
133
131
  # piece file back together and write
134
132
  manifest = " s.files = %w[\n#{files}\n ]\n"
135
133
  spec = [head, manifest, tail].join(" # = MANIFEST =\n")
@@ -9,32 +9,16 @@ require File.expand_path('../../trinidad-libs/trinidad-daemon-extension', __FILE
9
9
  module Trinidad
10
10
  module Extensions
11
11
  module Daemon
12
- VERSION = '0.2.6'
12
+ VERSION = '0.2.7'
13
13
  end
14
14
 
15
15
  class DaemonServerExtension < ServerExtension
16
16
  def configure(tomcat)
17
- org.jruby.trinidad.TrinidadDaemon.new(tomcat, @options[:pid_file], logger_options, jvm_args)
17
+ org.jruby.trinidad.TrinidadDaemon.new(tomcat, @options[:pid_file], jvm_args)
18
18
  end
19
19
 
20
20
  def override_tomcat?; true; end
21
21
 
22
- def logger_options
23
- return if @options.has_key?(:nolog)
24
- log = @options[:log] || {}
25
- log[:file] ||= 'log/trinidad.log'
26
-
27
- level = log[:level] || 'INFO'
28
- unless %w{ALL CONFIG FINE FINER FINEST INFO OFF SEVERE WARNING}.include?(level)
29
- puts "Invalid log level #{level}, using default: INFO"
30
- level = 'INFO'
31
- end
32
- log[:level] = level
33
- log = Hash[log.map{|k, v| [k.to_s, v]}]
34
-
35
- Java::java.util.HashMap.new(log)
36
- end
37
-
38
22
  def jvm_args
39
23
  (@options[:jvm_args] ? @options[:jvm_args].split : []).to_java(:string)
40
24
  end
@@ -25,37 +25,6 @@ describe Trinidad::Extensions::DaemonServerExtension do
25
25
  daemon.pid_file.should =~ /trinidad_pid.txt$/
26
26
  end
27
27
 
28
- it "creates a default log info when it's not present" do
29
- log = subject.logger_options
30
- log['file'].should == 'log/trinidad.log'
31
- log['level'].should == 'INFO'
32
- end
33
-
34
- it "uses the log configuration provided when it's present" do
35
- extension = Trinidad::Extensions::DaemonServerExtension.new({
36
- :log => {
37
- :file => 'custom.log',
38
- :level => 'ALL'
39
- }
40
- })
41
-
42
- log = extension.logger_options
43
- log['file'].should == 'custom.log'
44
- log['level'].should == 'ALL'
45
- end
46
-
47
- it "uses the default level when it's not recognized" do
48
- extension = Trinidad::Extensions::DaemonServerExtension.new({
49
- :log => {
50
- :level => 'LEVEL'
51
- }
52
- })
53
-
54
- log = extension.logger_options
55
- log['file'].should == 'log/trinidad.log'
56
- log['level'].should == 'INFO'
57
- end
58
-
59
28
  it "allows to pass jvm arguments to the daemon" do
60
29
  extension = Trinidad::Extensions::DaemonServerExtension.new({
61
30
  :jvm_args => '-Xmx=2048m -XX:MaxPermSize=2048m'
@@ -13,8 +13,8 @@ Gem::Specification.new do |s|
13
13
  ## If your rubyforge_project name is different, then edit it and comment out
14
14
  ## the sub! line in the Rakefile
15
15
  s.name = 'trinidad_daemon_extension'
16
- s.version = '0.2.6'
17
- s.date = '2011-02-22'
16
+ s.version = '0.2.7'
17
+ s.date = '2011-03-19'
18
18
  s.rubyforge_project = 'trinidad_daemon_extension'
19
19
 
20
20
  ## Make sure your summary is short. The description may be as long
@@ -62,8 +62,8 @@ Gem::Specification.new do |s|
62
62
  spec/spec_helper.rb
63
63
  spec/trinidad_daemon_extension_spec.rb
64
64
  trinidad-libs/akuma.jar
65
- trinidad_daemon_extension.gemspec
66
65
  trinidad-libs/trinidad-daemon-extension.jar
66
+ trinidad_daemon_extension.gemspec
67
67
  ]
68
68
  # = MANIFEST =
69
69
 
metadata CHANGED
@@ -1,12 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trinidad_daemon_extension
3
3
  version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 0
7
- - 2
8
- - 6
9
- version: 0.2.6
4
+ prerelease:
5
+ version: 0.2.7
10
6
  platform: ruby
11
7
  authors:
12
8
  - David Calavera
@@ -14,20 +10,17 @@ autorequire:
14
10
  bindir: bin
15
11
  cert_chain: []
16
12
 
17
- date: 2011-02-22 00:00:00 +01:00
13
+ date: 2011-03-19 00:00:00 -07:00
18
14
  default_executable:
19
15
  dependencies:
20
16
  - !ruby/object:Gem::Dependency
21
17
  name: trinidad_jars
22
18
  prerelease: false
23
19
  requirement: &id001 !ruby/object:Gem::Requirement
20
+ none: false
24
21
  requirements:
25
22
  - - ">="
26
23
  - !ruby/object:Gem::Version
27
- segments:
28
- - 0
29
- - 1
30
- - 1
31
24
  version: 0.1.1
32
25
  type: :runtime
33
26
  version_requirements: *id001
@@ -35,11 +28,10 @@ dependencies:
35
28
  name: rspec
36
29
  prerelease: false
37
30
  requirement: &id002 !ruby/object:Gem::Requirement
31
+ none: false
38
32
  requirements:
39
33
  - - ">="
40
34
  - !ruby/object:Gem::Version
41
- segments:
42
- - 0
43
35
  version: "0"
44
36
  type: :development
45
37
  version_requirements: *id002
@@ -47,11 +39,10 @@ dependencies:
47
39
  name: mocha
48
40
  prerelease: false
49
41
  requirement: &id003 !ruby/object:Gem::Requirement
42
+ none: false
50
43
  requirements:
51
44
  - - ">="
52
45
  - !ruby/object:Gem::Version
53
- segments:
54
- - 0
55
46
  version: "0"
56
47
  type: :development
57
48
  version_requirements: *id003
@@ -75,8 +66,8 @@ files:
75
66
  - spec/spec_helper.rb
76
67
  - spec/trinidad_daemon_extension_spec.rb
77
68
  - trinidad-libs/akuma.jar
78
- - trinidad_daemon_extension.gemspec
79
69
  - trinidad-libs/trinidad-daemon-extension.jar
70
+ - trinidad_daemon_extension.gemspec
80
71
  has_rdoc: true
81
72
  homepage: http://github.com/calavera/trinidad_daemon_extension
82
73
  licenses: []
@@ -87,23 +78,21 @@ rdoc_options:
87
78
  require_paths:
88
79
  - lib
89
80
  required_ruby_version: !ruby/object:Gem::Requirement
81
+ none: false
90
82
  requirements:
91
83
  - - ">="
92
84
  - !ruby/object:Gem::Version
93
- segments:
94
- - 0
95
85
  version: "0"
96
86
  required_rubygems_version: !ruby/object:Gem::Requirement
87
+ none: false
97
88
  requirements:
98
89
  - - ">="
99
90
  - !ruby/object:Gem::Version
100
- segments:
101
- - 0
102
91
  version: "0"
103
92
  requirements: []
104
93
 
105
94
  rubyforge_project: trinidad_daemon_extension
106
- rubygems_version: 1.3.6
95
+ rubygems_version: 1.5.1
107
96
  signing_key:
108
97
  specification_version: 2
109
98
  summary: Trinidad daemon extension