trinidad_daemon_extension 0.3.1 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -1,3 +1,9 @@
1
- source :rubygems
1
+ source 'https://rubygems.org'
2
2
 
3
- gemspec
3
+ gemspec
4
+
5
+ gem 'jruby-openssl', :platform => :jruby
6
+
7
+ group :test do
8
+ gem 'rake', :require => nil
9
+ end
@@ -1,3 +1,10 @@
1
+ == 0.4.0 (2013-01-14)
2
+
3
+ * Update akuma.jar to 1.8
4
+ * load jars instead of requiring them (polluting LOADED_FEATURES)
5
+ * Avoid akuma chdir-ing to root (#10)
6
+ * gem depends explicitly on the trinidad gem
7
+
1
8
  == 0.3.1 (2012-05-06)
2
9
 
3
10
  * Update jna.jar 3.4.0 from https://github.com/twall/jna/downloads (#9)
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2009 David Calavera
1
+ Copyright (c) 2013 Team Trinidad and contributors http://github.com/trinidad
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.md CHANGED
@@ -46,4 +46,5 @@ http://wiki.github.com/calavera/trinidad/extensions
46
46
 
47
47
  ## Copyright
48
48
 
49
- Copyright (c) 2010-2012 David Calavera. See LICENSE for details.
49
+ Copyright (c) 2013 [Team Trinidad](https://github.com/trinidad).
50
+ See LICENSE (http://en.wikipedia.org/wiki/MIT_License) for details.
data/Rakefile CHANGED
@@ -1,36 +1,10 @@
1
- require 'rubygems'
2
- require 'rake'
3
- require 'date'
4
-
5
- #############################################################################
6
- #
7
- # Helper functions
8
- #
9
- #############################################################################
10
-
11
- def name
12
- @name ||= Dir['*.gemspec'].first.split('.').first
13
- end
14
-
15
- def version
16
- line = File.read("lib/#{name}/version.rb")[/^\s*VERSION\s*=\s*.*/]
17
- line.match(/.*VERSION\s*=\s*['"](.*)['"]/)[1]
18
- end
19
-
20
- def gemspec_file
21
- "#{name}.gemspec"
1
+ begin
2
+ require 'bundler/setup'
3
+ rescue LoadError => e
4
+ require('rubygems') && retry
5
+ raise e
22
6
  end
23
7
 
24
- def gem_file
25
- "#{name}-#{version}.gem"
26
- end
27
-
28
- #############################################################################
29
- #
30
- # Standard tasks
31
- #
32
- #############################################################################
33
-
34
8
  task :default => :spec
35
9
 
36
10
  require 'rspec/core/rake_task'
@@ -38,70 +12,11 @@ RSpec::Core::RakeTask.new(:spec) do |spec|
38
12
  spec.rspec_opts = ['--color', "--format documentation"]
39
13
  end
40
14
 
41
- desc "Generate RCov test coverage and open in your browser"
42
- task :coverage do
43
- require 'rcov'
44
- sh "rm -fr coverage"
45
- sh "rcov test/test_*.rb"
46
- sh "open coverage/index.html"
47
- end
48
-
49
- require 'rake/rdoctask'
50
- Rake::RDocTask.new do |rdoc|
51
- rdoc.rdoc_dir = 'rdoc'
52
- rdoc.title = "#{name} #{version}"
53
- rdoc.rdoc_files.include('README*')
54
- rdoc.rdoc_files.include('lib/**/*.rb')
55
- end
56
-
57
- desc "Open an irb session preloaded with this library"
58
- task :console do
59
- sh "irb -rubygems -r ./lib/#{name}.rb"
60
- end
61
-
62
- #############################################################################
63
- #
64
- # Custom tasks (add your own tasks here)
65
- #
66
- #############################################################################
67
-
68
-
69
-
70
- #############################################################################
71
- #
72
- # Packaging tasks
73
- #
74
- #############################################################################
75
-
76
- task :release => :build do
77
- unless `git branch` =~ /^\* master$/
78
- puts "You must be on the master branch to release!"
79
- exit!
80
- end
81
- sh "git commit --allow-empty -a -m 'Release #{version}'"
82
- sh "git tag v#{version}"
83
- sh "git push origin master --tags"
84
- sh "gem push pkg/#{name}-#{version}.gem"
85
- end
86
-
87
- task :build => :validate do
88
- sh "mkdir -p pkg"
89
- sh "gem build #{gemspec_file}"
90
- sh "mv #{gem_file} pkg"
91
- end
92
-
93
- task :install => :build do
94
- sh "gem install pkg/#{name}-#{version}.gem"
95
- end
15
+ require 'bundler/gem_tasks'
96
16
 
97
- task :validate do
98
- libfiles = Dir['lib/*'] - ["lib/#{name}.rb", "lib/#{name}"]
99
- unless libfiles.empty?
100
- puts "Directory `lib` should only contain a `#{name}.rb` file and `#{name}` dir."
101
- exit!
102
- end
103
- unless Dir['VERSION*'].empty?
104
- puts "A `VERSION` file at root level violates Gem best practices."
105
- exit!
106
- end
17
+ desc "Clear out all built (pkg/* and *.gem) artifacts"
18
+ task :clear do
19
+ rm Dir["*.gem"]
20
+ rm_r Dir["pkg/*"] if File.exist?("pkg")
107
21
  end
22
+ task :clean => :clear
@@ -1,6 +1,4 @@
1
1
  require 'trinidad'
2
- require 'trinidad/jars'
3
- require 'trinidad/extensions'
4
2
 
5
3
  require 'trinidad_daemon_extension/jars'
6
4
  require 'trinidad_daemon_extension/tomcat_wrapper'
@@ -5,5 +5,5 @@ trinidad_libs =
5
5
  Trinidad::Extensions::Daemon::TRINIDAD_LIBS :
6
6
  File.expand_path('../../../trinidad-libs', __FILE__)
7
7
 
8
- require File.join(trinidad_libs, 'akuma.jar')
9
- require File.join(trinidad_libs, 'jna.jar')
8
+ load File.join(trinidad_libs, 'akuma.jar')
9
+ load File.join(trinidad_libs, 'jna.jar')
@@ -32,7 +32,7 @@ module Trinidad
32
32
  end
33
33
 
34
34
  def start
35
- daemon = com.sun.akuma.Daemon.new
35
+ daemon = com.sun.akuma.Daemon::WithoutChdir.new
36
36
  if daemon.isDaemonized
37
37
  pid = com.sun.akuma.CLibrary::LIBC.getpid
38
38
  puts "Starting Trinidad as a daemon"
@@ -74,7 +74,7 @@ module Trinidad
74
74
  if arg.to_java.startsWith("-Xbootclasspath")
75
75
  # add here the custom arguments, otherwhise are added after
76
76
  # trinidad script and break optionParser
77
- jvm_args.each { |custom| args.add(custom) }
77
+ jvm_args.each { |custom| args.add(custom) } if jvm_args
78
78
  end
79
79
  # I don't understand this hack but without it the daemon goes off,
80
80
  # could be others
@@ -86,4 +86,4 @@ module Trinidad
86
86
  end
87
87
  end
88
88
  end
89
- end
89
+ end
@@ -1,7 +1,7 @@
1
1
  module Trinidad
2
2
  module Extensions
3
3
  module Daemon
4
- VERSION = '0.3.1'
4
+ VERSION = '0.4.0'
5
5
  end
6
6
  end
7
7
  end
@@ -1,13 +1,15 @@
1
1
  begin
2
2
  require 'rspec'
3
+ rescue LoadError => e
4
+ require('rubygems') && retry
5
+ raise e
6
+ end
7
+ begin
8
+ require 'mocha/api'
3
9
  rescue LoadError
4
- require 'rubygems'
5
- gem 'rspec'
6
- require 'rspec'
10
+ require 'mocha'
7
11
  end
8
12
 
9
- require 'mocha'
10
-
11
13
  RSpec.configure do |config|
12
14
  config.mock_with :mocha
13
15
  end
@@ -57,6 +57,10 @@ end
57
57
 
58
58
  describe Trinidad::Extensions::Daemon::TomcatWrapper do
59
59
 
60
+ let(:tomcat_wrapper) do
61
+ Trinidad::Extensions::Daemon::TomcatWrapper.new Trinidad::Tomcat::Tomcat.new
62
+ end
63
+
60
64
  it "responds to tomcat methods" do
61
65
  tomcat_wrapper.respond_to?(:start).should be true
62
66
  tomcat_wrapper.respond_to?(:stop).should be true
@@ -86,10 +90,6 @@ describe Trinidad::Extensions::Daemon::TomcatWrapper do
86
90
  tomcat.host.app_base.should == '/app-base'
87
91
  end
88
92
 
89
- def tomcat_wrapper
90
- Trinidad::Extensions::Daemon::TomcatWrapper.new Trinidad::Tomcat::Tomcat.new
91
- end
92
-
93
93
  context "mocked" do
94
94
 
95
95
  @@tmpdir = nil
@@ -102,27 +102,27 @@ describe Trinidad::Extensions::Daemon::TomcatWrapper do
102
102
  ENV['TMPDIR'] = @@tmpdir
103
103
  end
104
104
 
105
- before :each do
106
- @tomcat = mock('tomcat')
107
- @tomcat_wrapper = Trinidad::Extensions::Daemon::TomcatWrapper.new(@tomcat)
108
- end
105
+ let(:tomcat) { mock('tomcat') }
106
+ let(:tomcat_wrapper) do
107
+ Trinidad::Extensions::Daemon::TomcatWrapper.new tomcat
108
+ end
109
109
 
110
110
  it "starts tomcat" do
111
111
  current_pid = $$
112
- com.sun.akuma.Daemon.expects(:new).returns daemon = mock("daemon")
112
+ com.sun.akuma.Daemon::WithoutChdir.expects(:new).returns daemon = mock("daemon")
113
113
  daemon.expects(:isDaemonized).returns true
114
114
  daemon.expects(:init).with("#{File.dirname(__FILE__)}/trinidad.pid")
115
115
 
116
- @tomcat.expects(:start)
117
- @tomcat.expects(:server).returns server = mock("tomcat.server")
116
+ tomcat.expects(:start)
117
+ tomcat.expects(:server).returns server = mock("tomcat.server")
118
118
  server.expects(:await)
119
119
 
120
- @tomcat_wrapper.start
120
+ tomcat_wrapper.start
121
121
  end
122
122
 
123
123
  it "stops tomcat" do
124
- @tomcat.expects(:stop)
125
- @tomcat_wrapper.stop
124
+ tomcat.expects(:stop)
125
+ tomcat_wrapper.stop
126
126
  end
127
127
 
128
128
  end
Binary file
@@ -3,16 +3,12 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
  require 'trinidad_daemon_extension/version'
4
4
 
5
5
  Gem::Specification.new do |s|
6
- s.specification_version = 2 if s.respond_to? :specification_version=
7
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
- s.rubygems_version = '1.3.5'
9
-
10
6
  s.name = 'trinidad_daemon_extension'
11
7
  s.version = Trinidad::Extensions::Daemon::VERSION
12
8
  s.rubyforge_project = 'trinidad_daemon_extension'
13
9
 
14
- s.summary = "Trinidad daemon extension"
15
- s.description = "Trinidad extension to run the Apache Tomcat server as a daemon"
10
+ s.summary = "Daemon extension for Trinidad"
11
+ s.description = "Trinidad extension to run the Apache Tomcat server as a daemon (for Unix only)."
16
12
 
17
13
  s.authors = ["David Calavera"]
18
14
  s.email = 'calavera@apache.org'
@@ -22,15 +18,14 @@ Gem::Specification.new do |s|
22
18
 
23
19
  s.require_paths = %w[lib]
24
20
 
25
- s.add_dependency('trinidad_jars', ">= 1.0.0")
21
+ s.add_dependency('trinidad', ">= 1.3.5")
26
22
 
27
- s.add_development_dependency('rspec', '~> 2.8')
28
- s.add_development_dependency('mocha', '>= 0.10.4')
23
+ s.add_development_dependency('rspec', '~> 2.10')
24
+ s.add_development_dependency('mocha', '>= 0.11')
29
25
 
30
26
  s.files = `git ls-files`.split("\n").sort.
31
27
  reject { |file| file =~ /^\./ }.
32
28
  reject { |file| file =~ /^(rdoc|pkg|src|git-hooks)/ }
33
29
 
34
30
  s.test_files = s.files.select { |path| path =~ /^spec\/.*_spec\.rb/ }
35
-
36
31
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: trinidad_daemon_extension
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.3.1
5
+ version: 0.4.0
6
6
  platform: ruby
7
7
  authors:
8
8
  - David Calavera
@@ -10,42 +10,42 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2012-05-06 00:00:00 Z
13
+ date: 2013-01-14 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
- name: trinidad_jars
17
- prerelease: false
18
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ name: trinidad
17
+ version_requirements: &id001 !ruby/object:Gem::Requirement
19
18
  none: false
20
19
  requirements:
21
20
  - - ">="
22
21
  - !ruby/object:Gem::Version
23
- version: 1.0.0
22
+ version: 1.3.5
23
+ requirement: *id001
24
+ prerelease: false
24
25
  type: :runtime
25
- version_requirements: *id001
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: rspec
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
- version: "2.8"
33
+ version: "2.10"
34
+ requirement: *id002
35
+ prerelease: false
35
36
  type: :development
36
- version_requirements: *id002
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: mocha
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
- version: 0.10.4
44
+ version: "0.11"
45
+ requirement: *id003
46
+ prerelease: false
46
47
  type: :development
47
- version_requirements: *id003
48
- description: Trinidad extension to run the Apache Tomcat server as a daemon
48
+ description: Trinidad extension to run the Apache Tomcat server as a daemon (for Unix only).
49
49
  email: calavera@apache.org
50
50
  executables: []
51
51
 
@@ -82,19 +82,25 @@ required_ruby_version: !ruby/object:Gem::Requirement
82
82
  requirements:
83
83
  - - ">="
84
84
  - !ruby/object:Gem::Version
85
+ hash: 2
86
+ segments:
87
+ - 0
85
88
  version: "0"
86
89
  required_rubygems_version: !ruby/object:Gem::Requirement
87
90
  none: false
88
91
  requirements:
89
92
  - - ">="
90
93
  - !ruby/object:Gem::Version
94
+ hash: 2
95
+ segments:
96
+ - 0
91
97
  version: "0"
92
98
  requirements: []
93
99
 
94
100
  rubyforge_project: trinidad_daemon_extension
95
- rubygems_version: 1.8.15
101
+ rubygems_version: 1.8.24
96
102
  signing_key:
97
- specification_version: 2
98
- summary: Trinidad daemon extension
103
+ specification_version: 3
104
+ summary: Daemon extension for Trinidad
99
105
  test_files:
100
106
  - spec/trinidad_daemon_extension_spec.rb