jetty-run 0.1.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,103 @@
1
+ require 'maven/ruby/pom_magic'
2
+ require 'maven/jetty/jetty_project'
3
+ require 'fileutils'
4
+
5
+ module Maven
6
+ module Jetty
7
+ class PomMagic < Maven::Ruby::PomMagic
8
+
9
+ def generate_pom( dir = '.', *args )
10
+
11
+ proj = JettyProject.new
12
+
13
+ ensure_web_xml( dir, proj )
14
+ ensure_mavenfile( dir )
15
+ ensure_keystore( dir )
16
+ ensure_overlays( dir )
17
+
18
+ load_standard_files( dir, proj )
19
+
20
+ pom_xml( dir, proj, args )
21
+ end
22
+
23
+ def ensure_overlays( dir )
24
+ target = target_dir( dir )
25
+ Dir[ File.join( File.dirname( __FILE__ ), "override-*-web.xml" ) ].each do |f|
26
+ FileUtils.cp( f, target )
27
+ end
28
+ end
29
+
30
+ # def ensure_mavenfile( dir )
31
+ # mavenfile = File.join( dir, 'Mavenfile' )
32
+ # unless File.exists?( mavenfile )
33
+ # content = File.read( File.join( File.dirname( __FILE__ ), 'Mavenfile' ) )
34
+ # File.open( mavenfile, 'w' ) do |f|
35
+ # f.puts content
36
+ # end
37
+ # warn "created Mavenfile with some locked down versions."
38
+ # end
39
+ # end
40
+
41
+ def ensure_web_xml( dir, proj, source = File.dirname( __FILE__ ), target = nil )
42
+ target ||= File.join( config_dir( dir ), 'web.xml' )
43
+ if !File.exists?( target ) && !File.exists?( File.join( dir, 'src', 'main', 'webapp', 'WEB-INF', 'web.xml' ) )
44
+ flavour = rails?( dir ) ? "rails" : "rack"
45
+ web_xml = File.join( source, "#{flavour}-web.xml" )
46
+ FileUtils.cp( web_xml, target )
47
+ warn "create web.xml with some defaults"
48
+ end
49
+ end
50
+
51
+ def rails?( dir )
52
+ File.exists? File.join( dir, 'config', 'application.rb' )
53
+ end
54
+
55
+ def config_dir( dir )
56
+ if File.exists?( File.join( dir, 'config' ) )
57
+ File.join( dir, 'config' )
58
+ else
59
+ dir
60
+ end
61
+ end
62
+
63
+ def target_dir( dir )
64
+ target = File.join( dir, 'target', 'jetty' )
65
+ unless File.exists?( target )
66
+ FileUtils.mkdir_p target
67
+ end
68
+ target
69
+ end
70
+
71
+ def ensure_keystore( dir )
72
+ target = File.join( target_dir( dir ), 'server.keystore' )
73
+ if !File.exists?( target ) && !File.exists?( File.join( dir, 'src', 'test', 'resources', 'server.keystore' ) )
74
+ store = File.join( File.dirname( __FILE__ ), "server.keystore" )
75
+ FileUtils.cp( store, target )
76
+ end
77
+ end
78
+
79
+ # def first_gemspec( dir = '.' )
80
+ # gemspecs = Dir[ File.join( dir, "*.gemspec" ) ]
81
+ # if gemspecs.size > 0
82
+ # File.expand_path( gemspecs[ 0 ] )
83
+ # end
84
+ # end
85
+
86
+ # def file( name, dir = '.' )
87
+ # File.expand_path( File.join( dir, name ) )
88
+ # end
89
+
90
+ # def pom_xml( dir = '.', proj, args )
91
+ # index = args.index( '-f' ) || args.index( '--file' )
92
+ # name = args[ index + 1 ] if index
93
+ # pom = File.join( dir, name || '.pom.xml' )
94
+ # File.open(pom, 'w') do |f|
95
+ # f.puts proj.to_xml
96
+ # end
97
+ # args += ['-f', pom] unless name
98
+ # args
99
+ # end
100
+
101
+ end
102
+ end
103
+ end
@@ -0,0 +1,68 @@
1
+ <!--
2
+ Copyright (C) 2013 Christian Meier
3
+
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
5
+ this software and associated documentation files (the "Software"), to deal in
6
+ the Software without restriction, including without limitation the rights to
7
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
8
+ the Software, and to permit persons to whom the Software is furnished to do so,
9
+ subject to the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be included in all
12
+ copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
16
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
17
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
18
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
19
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
+ -->
21
+ <!DOCTYPE web-app PUBLIC
22
+ "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
23
+ "http://java.sun.com/dtd/web-app_2_3.dtd">
24
+ <web-app>
25
+ <welcome-file-list>
26
+ <welcome-file>/index.html</welcome-file>
27
+ </welcome-file-list>
28
+
29
+ <context-param>
30
+ <param-name>jruby.max.runtimes</param-name>
31
+ <param-value>1</param-value>
32
+ </context-param>
33
+ <context-param>
34
+ <param-name>jruby.min.runtimes</param-name>
35
+ <param-value>1</param-value>
36
+ </context-param>
37
+ <context-param>
38
+ <param-name>jruby.compat.version</param-name>
39
+ <param-value>1.9</param-value>
40
+ </context-param>
41
+ <!-- for more config options see https://github.com/jruby/jruby-rack -->
42
+
43
+ <filter>
44
+ <filter-name>RackFilter</filter-name>
45
+ <filter-class>org.jruby.rack.RackFilter</filter-class>
46
+ <!-- optional filter configuration init-params : -->
47
+ <init-param>
48
+ <param-name>resetUnhandledResponse</param-name>
49
+ <param-value>true</param-value> <!-- true (default), false or buffer -->
50
+ </init-param>
51
+ <init-param>
52
+ <param-name>addsHtmlToPathInfo</param-name>
53
+ <param-value>true</param-value> <!-- true (default), false -->
54
+ </init-param>
55
+ <init-param>
56
+ <param-name>verifiesHtmlResource</param-name>
57
+ <param-value>false</param-value> <!-- true, false (default) -->
58
+ </init-param>
59
+ </filter>
60
+ <filter-mapping>
61
+ <filter-name>RackFilter</filter-name>
62
+ <url-pattern>/*</url-pattern>
63
+ </filter-mapping>
64
+
65
+ <listener>
66
+ <listener-class>org.jruby.rack.RackServletContextListener</listener-class>
67
+ </listener>
68
+ </web-app>
@@ -0,0 +1,68 @@
1
+ <!--
2
+ Copyright (C) 2013 Christian Meier
3
+
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
5
+ this software and associated documentation files (the "Software"), to deal in
6
+ the Software without restriction, including without limitation the rights to
7
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
8
+ the Software, and to permit persons to whom the Software is furnished to do so,
9
+ subject to the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be included in all
12
+ copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
16
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
17
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
18
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
19
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
+ -->
21
+ <!DOCTYPE web-app PUBLIC
22
+ "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
23
+ "http://java.sun.com/dtd/web-app_2_3.dtd">
24
+ <web-app>
25
+ <welcome-file-list>
26
+ <welcome-file>/index.html</welcome-file>
27
+ </welcome-file-list>
28
+
29
+ <context-param>
30
+ <param-name>jruby.max.runtimes</param-name>
31
+ <param-value>1</param-value>
32
+ </context-param>
33
+ <context-param>
34
+ <param-name>jruby.min.runtimes</param-name>
35
+ <param-value>1</param-value>
36
+ </context-param>
37
+ <context-param>
38
+ <param-name>jruby.compat.version</param-name>
39
+ <param-value>1.9</param-value>
40
+ </context-param>
41
+ <!-- for more config options see https://github.com/jruby/jruby-rack -->
42
+
43
+ <filter>
44
+ <filter-name>RackFilter</filter-name>
45
+ <filter-class>org.jruby.rack.RackFilter</filter-class>
46
+ <!-- optional filter configuration init-params : -->
47
+ <init-param>
48
+ <param-name>resetUnhandledResponse</param-name>
49
+ <param-value>true</param-value> <!-- true (default), false or buffer -->
50
+ </init-param>
51
+ <init-param>
52
+ <param-name>addsHtmlToPathInfo</param-name>
53
+ <param-value>true</param-value> <!-- true (default), false -->
54
+ </init-param>
55
+ <init-param>
56
+ <param-name>verifiesHtmlResource</param-name>
57
+ <param-value>false</param-value> <!-- true, false (default) -->
58
+ </init-param>
59
+ </filter>
60
+ <filter-mapping>
61
+ <filter-name>RackFilter</filter-name>
62
+ <url-pattern>/*</url-pattern>
63
+ </filter-mapping>
64
+
65
+ <listener>
66
+ <listener-class>org.jruby.rack.rails.RailsServletContextListener</listener-class>
67
+ </listener>
68
+ </web-app>
@@ -0,0 +1,48 @@
1
+ <!DOCTYPE web-app PUBLIC
2
+ "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
3
+ "http://java.sun.com/dtd/web-app_2_3.dtd">
4
+ <web-app>
5
+ <welcome-file-list>
6
+ <welcome-file>/index.html</welcome-file>
7
+ </welcome-file-list>
8
+
9
+ <context-param>
10
+ <param-name>jruby.max.runtimes</param-name>
11
+ <param-value>1</param-value>
12
+ </context-param>
13
+ <context-param>
14
+ <param-name>jruby.min.runtimes</param-name>
15
+ <param-value>1</param-value>
16
+ </context-param>
17
+ <context-param>
18
+ <param-name>jruby.compat.version</param-name>
19
+ <param-value>1.8</param-value>
20
+ </context-param>
21
+ <!-- for more config options see https://github.com/jruby/jruby-rack -->
22
+
23
+ <filter>
24
+ <filter-name>RackFilter</filter-name>
25
+ <filter-class>org.jruby.rack.RackFilter</filter-class>
26
+ <!-- optional filter configuration init-params : -->
27
+ <init-param>
28
+ <param-name>resetUnhandledResponse</param-name>
29
+ <param-value>true</param-value> <!-- true (default), false or buffer -->
30
+ </init-param>
31
+ <init-param>
32
+ <param-name>addsHtmlToPathInfo</param-name>
33
+ <param-value>true</param-value> <!-- true (default), false -->
34
+ </init-param>
35
+ <init-param>
36
+ <param-name>verifiesHtmlResource</param-name>
37
+ <param-value>false</param-value> <!-- true, false (default) -->
38
+ </init-param>
39
+ </filter>
40
+ <filter-mapping>
41
+ <filter-name>RackFilter</filter-name>
42
+ <url-pattern>/*</url-pattern>
43
+ </filter-mapping>
44
+
45
+ <listener>
46
+ <listener-class>org.jruby.rack.rails.RailsServletContextListener</listener-class>
47
+ </listener>
48
+ </web-app>
@@ -1,5 +1,25 @@
1
+ #
2
+ # Copyright (C) 2013 Christian Meier
3
+ #
4
+ # Permission is hereby granted, free of charge, to any person obtaining a copy of
5
+ # this software and associated documentation files (the "Software"), to deal in
6
+ # the Software without restriction, including without limitation the rights to
7
+ # use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
8
+ # the Software, and to permit persons to whom the Software is furnished to do so,
9
+ # subject to the following conditions:
10
+ #
11
+ # The above copyright notice and this permission notice shall be included in all
12
+ # copies or substantial portions of the Software.
13
+ #
14
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
16
+ # FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
17
+ # COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
18
+ # IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
19
+ # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
+ #
1
21
  module Maven
2
22
  module Jetty
3
- VERSION = '0.1.0'.freeze
23
+ VERSION = '0.2.1'.freeze
4
24
  end
5
25
  end
metadata CHANGED
@@ -1,112 +1,174 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jetty-run
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 21
4
5
  prerelease:
5
- version: 0.1.0
6
+ segments:
7
+ - 0
8
+ - 2
9
+ - 1
10
+ version: 0.2.1
6
11
  platform: ruby
7
12
  authors:
8
- - Kristian Meier
13
+ - Christian Meier
9
14
  autorequire:
10
15
  bindir: bin
11
16
  cert_chain: []
12
17
 
13
- date: 2012-06-13 00:00:00 Z
18
+ date: 2013-03-04 00:00:00 Z
14
19
  dependencies:
15
- - !ruby/object:Gem::Dependency
16
- name: rake
17
- prerelease: false
18
- requirement: &id001 !ruby/object:Gem::Requirement
19
- none: false
20
- requirements:
21
- - - "="
22
- - !ruby/object:Gem::Version
23
- version: 0.9.2.2
24
- type: :development
25
- version_requirements: *id001
26
- - !ruby/object:Gem::Dependency
27
- name: minitest
28
- prerelease: false
29
- requirement: &id002 !ruby/object:Gem::Requirement
30
- none: false
31
- requirements:
32
- - - ~>
33
- - !ruby/object:Gem::Version
34
- version: 2.10.0
35
- type: :development
36
- version_requirements: *id002
37
- - !ruby/object:Gem::Dependency
38
- name: cucumber
39
- prerelease: false
40
- requirement: &id003 !ruby/object:Gem::Requirement
41
- none: false
42
- requirements:
43
- - - ~>
44
- - !ruby/object:Gem::Version
45
- version: 1.1.9
46
- type: :development
47
- version_requirements: *id003
48
- - !ruby/object:Gem::Dependency
49
- name: ruby-maven
50
- prerelease: false
51
- requirement: &id004 !ruby/object:Gem::Requirement
52
- none: false
53
- requirements:
54
- - - "="
55
- - !ruby/object:Gem::Version
56
- version: 3.0.4.0.29.0
57
- type: :runtime
58
- version_requirements: *id004
59
- description: installs and run jetty from within a rails directory with ssl and none ssl port
20
+ - !ruby/object:Gem::Dependency
21
+ name: rake
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ none: false
25
+ requirements:
26
+ - - ~>
27
+ - !ruby/object:Gem::Version
28
+ hash: 35
29
+ segments:
30
+ - 10
31
+ - 0
32
+ version: "10.0"
33
+ type: :development
34
+ version_requirements: *id001
35
+ - !ruby/object:Gem::Dependency
36
+ name: minitest
37
+ prerelease: false
38
+ requirement: &id002 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ~>
42
+ - !ruby/object:Gem::Version
43
+ hash: 23
44
+ segments:
45
+ - 4
46
+ - 6
47
+ version: "4.6"
48
+ type: :development
49
+ version_requirements: *id002
50
+ - !ruby/object:Gem::Dependency
51
+ name: cucumber
52
+ prerelease: false
53
+ requirement: &id003 !ruby/object:Gem::Requirement
54
+ none: false
55
+ requirements:
56
+ - - ~>
57
+ - !ruby/object:Gem::Version
58
+ hash: 11
59
+ segments:
60
+ - 1
61
+ - 2
62
+ version: "1.2"
63
+ type: :development
64
+ version_requirements: *id003
65
+ - !ruby/object:Gem::Dependency
66
+ name: copyright-headers
67
+ prerelease: false
68
+ requirement: &id004 !ruby/object:Gem::Requirement
69
+ none: false
70
+ requirements:
71
+ - - ~>
72
+ - !ruby/object:Gem::Version
73
+ hash: 15
74
+ segments:
75
+ - 1
76
+ - 0
77
+ version: "1.0"
78
+ type: :development
79
+ version_requirements: *id004
80
+ - !ruby/object:Gem::Dependency
81
+ name: ruby-maven
82
+ prerelease: false
83
+ requirement: &id005 !ruby/object:Gem::Requirement
84
+ none: false
85
+ requirements:
86
+ - - ~>
87
+ - !ruby/object:Gem::Version
88
+ hash: 243
89
+ segments:
90
+ - 3
91
+ - 0
92
+ - 4
93
+ - 1
94
+ - 4
95
+ version: 3.0.4.1.4
96
+ type: :runtime
97
+ version_requirements: *id005
98
+ description: installs and run jetty from within a rack/rails directory with ssl and none ssl port
60
99
  email:
61
- - m.kristian@web.de
100
+ - m.kristian@web.de
62
101
  executables:
63
- - jetty-run
102
+ - jetty-run
64
103
  extensions: []
65
104
 
66
105
  extra_rdoc_files: []
67
106
 
68
107
  files:
69
- - bin/jetty-run
70
- - bin/jetty-run~
71
- - lib/jetty-run.rb
72
- - lib/jetty-run.rb~
73
- - lib/jetty_run.rb~
74
- - lib/jetty_run.rb
75
- - lib/maven/jetty/version.rb
76
- - lib/maven/jetty/ruby_maven.rb~
77
- - lib/maven/jetty/web.xml~
78
- - lib/maven/jetty/rails_project.rb
79
- - lib/maven/jetty/ruby_maven.rb
80
- - lib/maven/jetty/rails_project.rb~
81
- - lib/maven/jetty/version.rb~
82
- - lib/maven/jetty/web.xml
83
- - MIT-LICENSE
84
- - README.md
85
- - TODO.md
108
+ - bin/jetty-run
109
+ - bin/jetty-run~
110
+ - lib/jetty-run.rb
111
+ - lib/jetty-run.rb~
112
+ - lib/jetty_run.rb~
113
+ - lib/jetty_run.rb
114
+ - lib/maven/jetty/pom_magic.rb
115
+ - lib/maven/jetty/server.keystore
116
+ - lib/maven/jetty/Mavenfile~
117
+ - lib/maven/jetty/cli.rb~
118
+ - lib/maven/jetty/rack-web.xml
119
+ - lib/maven/jetty/version.rb
120
+ - lib/maven/jetty/override-rack-web.xml
121
+ - lib/maven/jetty/override-rails-developement-web.xml~
122
+ - lib/maven/jetty/ruby_maven.rb~
123
+ - lib/maven/jetty/jetty_project.rb
124
+ - lib/maven/jetty/web.xml~
125
+ - lib/maven/jetty/override-rails-development-web.xml
126
+ - lib/maven/jetty/rack_project.rb~
127
+ - lib/maven/jetty/jetty_project.rb~
128
+ - lib/maven/jetty/cli.rb
129
+ - lib/maven/jetty/override-rails-production-web.xml
130
+ - lib/maven/jetty/rack-web.xml~
131
+ - lib/maven/jetty/override-rack-web.xml~
132
+ - lib/maven/jetty/pom_magic.rb~
133
+ - lib/maven/jetty/rails-web.xml
134
+ - lib/maven/jetty/rails_project.rb~
135
+ - lib/maven/jetty/version.rb~
136
+ - lib/maven/jetty/rails-web.xml~
137
+ - lib/maven/jetty/Mavenfile
138
+ - lib/maven/jetty/override-rails-production-web.xml~
139
+ - MIT-LICENSE
140
+ - README.md
141
+ - TODO.md
86
142
  homepage: http://github.com/mkristian/jetty-run
87
- licenses: []
88
-
143
+ licenses:
144
+ - MIT
89
145
  post_install_message:
90
146
  rdoc_options: []
91
147
 
92
148
  require_paths:
93
- - lib
149
+ - lib
94
150
  required_ruby_version: !ruby/object:Gem::Requirement
95
151
  none: false
96
152
  requirements:
97
- - - ">="
98
- - !ruby/object:Gem::Version
99
- version: "0"
153
+ - - ">="
154
+ - !ruby/object:Gem::Version
155
+ hash: 3
156
+ segments:
157
+ - 0
158
+ version: "0"
100
159
  required_rubygems_version: !ruby/object:Gem::Requirement
101
160
  none: false
102
161
  requirements:
103
- - - ">="
104
- - !ruby/object:Gem::Version
105
- version: "0"
162
+ - - ">="
163
+ - !ruby/object:Gem::Version
164
+ hash: 3
165
+ segments:
166
+ - 0
167
+ version: "0"
106
168
  requirements: []
107
169
 
108
170
  rubyforge_project:
109
- rubygems_version: 1.8.24
171
+ rubygems_version: 1.8.15
110
172
  signing_key:
111
173
  specification_version: 3
112
174
  summary: run rails with jetty