warbler_updated 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +10 -0
  3. data/History.txt +411 -0
  4. data/LICENSE.txt +27 -0
  5. data/Mavenfile +32 -0
  6. data/README.rdoc +280 -0
  7. data/Rakefile +63 -0
  8. data/bin/warble +11 -0
  9. data/ext/JarMain.java +334 -0
  10. data/ext/WarMain.java +375 -0
  11. data/ext/WarblerJar.java +199 -0
  12. data/ext/WarblerJarService.java +18 -0
  13. data/lib/warbler/application.rb +104 -0
  14. data/lib/warbler/bundler_helper.rb +22 -0
  15. data/lib/warbler/config.rb +265 -0
  16. data/lib/warbler/executable_helper.rb +25 -0
  17. data/lib/warbler/gems.rb +77 -0
  18. data/lib/warbler/jar.rb +348 -0
  19. data/lib/warbler/pathmap_helper.rb +20 -0
  20. data/lib/warbler/platform_helper.rb +26 -0
  21. data/lib/warbler/rake_helper.rb +30 -0
  22. data/lib/warbler/scripts/rails.rb +5 -0
  23. data/lib/warbler/task.rb +185 -0
  24. data/lib/warbler/templates/bundler.erb +19 -0
  25. data/lib/warbler/templates/config.erb +1 -0
  26. data/lib/warbler/templates/jar.erb +11 -0
  27. data/lib/warbler/templates/jbundler.erb +2 -0
  28. data/lib/warbler/templates/rack.erb +5 -0
  29. data/lib/warbler/templates/rails.erb +1 -0
  30. data/lib/warbler/templates/war.erb +19 -0
  31. data/lib/warbler/traits/bundler.rb +157 -0
  32. data/lib/warbler/traits/gemspec.rb +79 -0
  33. data/lib/warbler/traits/jar.rb +58 -0
  34. data/lib/warbler/traits/jbundler.rb +48 -0
  35. data/lib/warbler/traits/nogemspec.rb +47 -0
  36. data/lib/warbler/traits/rack.rb +33 -0
  37. data/lib/warbler/traits/rails.rb +91 -0
  38. data/lib/warbler/traits/war.rb +260 -0
  39. data/lib/warbler/traits.rb +124 -0
  40. data/lib/warbler/version.rb +10 -0
  41. data/lib/warbler/war.rb +8 -0
  42. data/lib/warbler/web_server.rb +125 -0
  43. data/lib/warbler/zip_support.rb +13 -0
  44. data/lib/warbler.rb +40 -0
  45. data/lib/warbler_jar.jar +0 -0
  46. data/warble.rb +188 -0
  47. data/warbler.gemspec +37 -0
  48. data/web.xml.erb +57 -0
  49. metadata +188 -0
data/warble.rb ADDED
@@ -0,0 +1,188 @@
1
+ # Disable Rake-environment-task framework detection by uncommenting/setting to false
2
+ # Warbler.framework_detection = false
3
+
4
+ # Warbler web application assembly configuration file
5
+ Warbler::Config.new do |config|
6
+ # Features: additional options controlling how the jar is built.
7
+ # Currently the following features are supported:
8
+ # - *gemjar*: package the gem repository in a jar file in WEB-INF/lib
9
+ # - *executable*: embed a web server and make the war executable
10
+ # - *runnable*: allows to run bin scripts e.g. `java -jar my.war -S rake -T`
11
+ # - *compiled*: compile .rb files to .class files
12
+ # config.features = %w(gemjar)
13
+
14
+ # Application directories to be included in the webapp.
15
+ # config.dirs = %w(app config db lib log script vendor tmp)
16
+
17
+ # Additional files/directories to include, above those in config.dirs
18
+ # config.includes = FileList["db"]
19
+
20
+ # Additional files/directories to exclude
21
+ # config.excludes = FileList["lib/tasks/*"]
22
+
23
+ # Additional Java .jar files to include. Note that if .jar files are placed
24
+ # in lib (and not otherwise excluded) then they need not be mentioned here.
25
+ # JRuby and JRuby-Rack are pre-loaded in this list. Be sure to include your
26
+ # own versions if you directly set the value
27
+ # config.java_libs += FileList["lib/java/*.jar"]
28
+
29
+ # Loose Java classes and miscellaneous files to be included.
30
+ # config.java_classes = FileList["target/classes/**.*"]
31
+
32
+ # One or more pathmaps defining how the java classes should be copied into
33
+ # the archive. The example pathmap below accompanies the java_classes
34
+ # configuration above. See http://rake.rubyforge.org/classes/String.html#M000017
35
+ # for details of how to specify a pathmap.
36
+ # config.pathmaps.java_classes << "%{target/classes/,}p"
37
+
38
+ # Bundler support is built-in. If Warbler finds a Gemfile in the
39
+ # project directory, it will be used to collect the gems to bundle
40
+ # in your application. If you wish to explicitly disable this
41
+ # functionality, uncomment here.
42
+ # config.bundler = false
43
+
44
+ # An array of Bundler groups to avoid including in the war file.
45
+ # Defaults to ["development", "test", "assets"].
46
+ # config.bundle_without = []
47
+
48
+ # Other gems to be included. If you don't use Bundler or a gemspec
49
+ # file, you need to tell Warbler which gems your application needs
50
+ # so that they can be packaged in the archive.
51
+ # For Rails applications, the Rails gems are included by default
52
+ # unless the vendor/rails directory is present.
53
+ # config.gems += ["activerecord-jdbcmysql-adapter", "jruby-openssl"]
54
+ # config.gems << "tzinfo"
55
+
56
+ # Uncomment this if you don't want to package rails gem.
57
+ # config.gems -= ["rails"]
58
+
59
+ # The most recent versions of gems are used.
60
+ # You can specify versions of gems by using a hash assignment:
61
+ # config.gems["rails"] = "4.2.5"
62
+
63
+ # You can also use regexps or Gem::Dependency objects for flexibility or
64
+ # finer-grained control.
65
+ # config.gems << /^sinatra-/
66
+ # config.gems << Gem::Dependency.new("sinatra", "= 1.4.7")
67
+
68
+ # Include gem dependencies not mentioned specifically. Default is
69
+ # true, uncomment to turn off.
70
+ # config.gem_dependencies = false
71
+
72
+ # Array of regular expressions matching relative paths in gems to be
73
+ # excluded from the war. Defaults to empty, but you can set it like
74
+ # below, which excludes test files.
75
+ # config.gem_excludes = [/^(test|spec)\//]
76
+
77
+ # Pathmaps for controlling how application files are copied into the archive
78
+ # config.pathmaps.application = ["WEB-INF/%p"]
79
+
80
+ # Name of the archive (without the extension). Defaults to the basename
81
+ # of the project directory.
82
+ # config.jar_name = "mywar"
83
+
84
+ # File extension for the archive. Defaults to either 'jar' or 'war'.
85
+ # config.jar_extension = "jar"
86
+
87
+ # Destionation for the created archive. Defaults to project's root directory.
88
+ # config.autodeploy_dir = "dist/"
89
+
90
+ # Name of the MANIFEST.MF template for the war file. Defaults to a simple
91
+ # MANIFEST.MF that contains the version of Warbler used to create the war file.
92
+ # config.manifest_file = "config/MANIFEST.MF"
93
+
94
+ # When using the 'compiled' feature and specified, only these Ruby
95
+ # files will be compiled. Default is to compile all \.rb files in
96
+ # the application.
97
+ # config.compiled_ruby_files = FileList['app/**/*.rb']
98
+
99
+ # Determines if ruby files in supporting gems will be compiled.
100
+ # Ignored unless compile feature is used.
101
+ # config.compile_gems = false
102
+
103
+ # When set it specify the bytecode version for compiled class files
104
+ # config.bytecode_version = "1.6"
105
+
106
+ # When set to true, Warbler will override the value of ENV['GEM_HOME'] even it
107
+ # has already been set. When set to false it will use any existing value of
108
+ # GEM_HOME if it is set.
109
+ # config.override_gem_home = true
110
+
111
+ # Specify executable
112
+ # Default: First item from alphabetized Gemspec executables array
113
+ # Takes either of two forms:
114
+ # o String: Relative path to the executable from your project root
115
+ # o Two-element Array:
116
+ # [0] Name of the gem that contains the executable
117
+ # [1] Relative path to the executable from the gem root
118
+ # config.executable = ["rake", "bin/rake"]
119
+
120
+ # Sets default (prefixed) parameters for the executables
121
+ # config.executable_params = "do:something"
122
+
123
+ # If set to true, moves jar files into WEB-INF/lib. Prior to version 1.4.2 of Warbler this was done
124
+ # by default. But since 1.4.2 this config defaults to false. It may need to be set to true for
125
+ # web servers that do not explode the WAR file.
126
+ # Alternatively, this option can be set to a regular expression, which will
127
+ # act as a jar selector -- only jar files that match the pattern will be
128
+ # included in the archive.
129
+ # config.move_jars_to_webinf_lib = false
130
+
131
+ # === War files only below here ===
132
+
133
+ # Embedded webserver to use with the 'executable' feature. Currently supported
134
+ # webservers are:
135
+ # - *jetty* - Embedded Jetty from Eclipse
136
+ # config.webserver = 'jetty'
137
+
138
+ # Path to the pre-bundled gem directory inside the war file. Default
139
+ # is 'WEB-INF/gems'. Specify path if gems are already bundled
140
+ # before running Warbler. This also sets 'gem.path' inside web.xml.
141
+ # config.gem_path = "WEB-INF/vendor/bundler_gems"
142
+
143
+ # Files for WEB-INF directory (next to web.xml). This contains
144
+ # web.xml by default. If there is an .erb-File it will be processed
145
+ # with webxml-config. You may want to exclude this file via
146
+ # config.excludes.
147
+ # config.webinf_files += FileList["jboss-web.xml"]
148
+
149
+ # Files to be included in the root of the webapp. Note that files in public
150
+ # will have the leading 'public/' part of the path stripped during staging.
151
+ # config.public_html = FileList["public/**/*", "doc/**/*"]
152
+
153
+ # Pathmaps for controlling how public HTML files are copied into the .war
154
+ # config.pathmaps.public_html = ["%{public/,}p"]
155
+
156
+ # Value of RAILS_ENV for the webapp -- default as shown below
157
+ # config.webxml.rails.env = ENV['RAILS_ENV'] || 'production'
158
+
159
+ # Public ROOT mapping, by default assets are copied into .war ROOT directory.
160
+ # config.public.root = ''
161
+
162
+ # Application booter to use, either :rack or :rails (autodetected by default)
163
+ # config.webxml.booter = :rails
164
+
165
+ # When using the :rack booter, "Rackup" script to use.
166
+ # - For 'rackup.path', the value points to the location of the rackup
167
+ # script in the web archive file. You need to make sure this file
168
+ # gets included in the war, possibly by adding it to config.includes
169
+ # or config.webinf_files above.
170
+ # - For 'rackup', the rackup script you provide as an inline string
171
+ # is simply embedded in web.xml.
172
+ # The script is evaluated in a Rack::Builder to load the application.
173
+ # Examples:
174
+ # config.webxml.rackup.path = 'WEB-INF/hello.ru'
175
+ # config.webxml.rackup = %{require './lib/demo'; run Rack::Adapter::Camping.new(Demo)}
176
+ # config.webxml.rackup = require 'cgi' && CGI::escapeHTML(File.read("config.ru"))
177
+
178
+ # Control the pool of Rails runtimes. Leaving unspecified means
179
+ # the pool will grow as needed to service requests. It is recommended
180
+ # that you fix these values when running a production server!
181
+ # If you're using threadsafe! mode, you probably don't want to set these values,
182
+ # since 1 runtime(default for threadsafe mode) will be enough.
183
+ # config.webxml.jruby.min.runtimes = 2
184
+ # config.webxml.jruby.max.runtimes = 4
185
+
186
+ # JNDI data source name
187
+ # config.webxml.jndi = 'jdbc/rails'
188
+ end
data/warbler.gemspec ADDED
@@ -0,0 +1,37 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require 'warbler/version'
4
+
5
+ Gem::Specification.new do |gem|
6
+ gem.name = "warbler_updated"
7
+ gem.version = Warbler::VERSION
8
+ gem.platform = Gem::Platform::RUBY
9
+ gem.homepage = "https://github.com/jruby/warbler"
10
+ gem.license = 'MIT'
11
+ gem.authors = ["Nick Sieger"]
12
+ gem.email = "nick@nicksieger.com"
13
+ gem.summary = "Warbler chirpily constructs .war files of your Rails applications."
14
+ gem.description = %q{Warbler is a gem to make a Java jar or war file out of any Ruby,
15
+ Rails, or Rack application. Warbler provides a minimal, flexible, Ruby-like way to
16
+ bundle up all of your application files for deployment to a Java environment.}
17
+
18
+ gem.files = `git ls-files`.split("\n").
19
+ reject { |file| file =~ /^\./ }. # .gitignore, .github
20
+ reject { |file| file =~ /^spec|test\// }. # spec/**/*.spec
21
+ reject { |file| file =~ /^integration\// }. # (un-used) *.rake files
22
+ reject { |file| file =~ /^rakelib\// } # (un-used) *.rake files
23
+ gem.test_files = [] # tests and specs add 700k to the gem, so don't include them
24
+ gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
25
+ gem.require_paths = ["lib"]
26
+
27
+ gem.rdoc_options = ["--main", "README.rdoc", "-H", "-f", "darkfish"]
28
+
29
+ gem.required_ruby_version = ">= 2.5"
30
+
31
+ gem.add_runtime_dependency 'rake', ['>= 13.0.3']
32
+ gem.add_runtime_dependency 'jruby-jars', ['>= 9.0.0']
33
+ gem.add_runtime_dependency 'jruby-rack', ['>= 1.1.1', '< 1.3']
34
+ gem.add_runtime_dependency 'rubyzip', '>= 1.0.0'
35
+ gem.add_development_dependency 'jbundler', '~> 0.9'
36
+ gem.add_development_dependency 'rspec', '~> 3.0'
37
+ end
data/web.xml.erb ADDED
@@ -0,0 +1,57 @@
1
+ <web-app xmlns="http://java.sun.com/xml/ns/javaee"
2
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
4
+ version="3.0">
5
+ <!--
6
+ <display-name>Uncomment and put name :here: for Tomcat Dashboard</display-name>-->
7
+
8
+ <%# NOTE: to be renamed to servlet_context_params %>
9
+ <%- webxml.context_params.each do |name, value| -%>
10
+ <context-param>
11
+ <param-name><%= name %></param-name>
12
+ <param-value><%= value %></param-value>
13
+ </context-param>
14
+ <%- end -%>
15
+
16
+ <%- if webxml.respond_to?(:servlet_filter) -%>
17
+ <filter>
18
+ <filter-name><%= webxml.servlet_filter_name %></filter-name>
19
+ <filter-class><%= webxml.servlet_filter %></filter-class>
20
+ <async-supported><%= !! webxml.servlet_filter_async %></async-supported>
21
+ </filter>
22
+ <filter-mapping>
23
+ <filter-name><%= webxml.servlet_filter_name %></filter-name>
24
+ <url-pattern><%= webxml.servlet_filter_url_pattern %></url-pattern>
25
+ </filter-mapping>
26
+ <%- else -%> <%# NOTE: due compatibility when warbler gets downgraded to 2.0.0 %>
27
+ <filter>
28
+ <filter-name>RackFilter</filter-name>
29
+ <filter-class>org.jruby.rack.RackFilter</filter-class>
30
+ <async-supported>true</async-supported>
31
+ </filter>
32
+ <filter-mapping>
33
+ <filter-name>RackFilter</filter-name>
34
+ <url-pattern>/*</url-pattern>
35
+ </filter-mapping>
36
+ <%- end -%>
37
+
38
+ <%- if webxml.respond_to?(:servlet_context_listeners) -%>
39
+ <%- webxml.servlet_context_listeners.each do |listener| -%>
40
+ <listener>
41
+ <listener-class><%= listener %></listener-class>
42
+ </listener>
43
+ <%- end -%>
44
+ <%- else -%> <%# NOTE: due compatibility when warbler gets downgraded to 2.0.0 %>
45
+ <listener>
46
+ <listener-class><%= webxml.servlet_context_listener %></listener-class>
47
+ </listener>
48
+ <%- end -%>
49
+
50
+ <%- [webxml.jndi].flatten.each do |jndi| -%>
51
+ <resource-ref>
52
+ <res-ref-name><%= jndi %></res-ref-name>
53
+ <res-type>javax.sql.DataSource</res-type>
54
+ <res-auth>Container</res-auth>
55
+ </resource-ref>
56
+ <%- end if webxml.jndi -%>
57
+ </web-app>
metadata ADDED
@@ -0,0 +1,188 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: warbler_updated
3
+ version: !ruby/object:Gem::Version
4
+ version: 2.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Nick Sieger
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2024-11-22 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rake
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 13.0.3
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 13.0.3
27
+ - !ruby/object:Gem::Dependency
28
+ name: jruby-jars
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 9.0.0
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: 9.0.0
41
+ - !ruby/object:Gem::Dependency
42
+ name: jruby-rack
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: 1.1.1
48
+ - - "<"
49
+ - !ruby/object:Gem::Version
50
+ version: '1.3'
51
+ type: :runtime
52
+ prerelease: false
53
+ version_requirements: !ruby/object:Gem::Requirement
54
+ requirements:
55
+ - - ">="
56
+ - !ruby/object:Gem::Version
57
+ version: 1.1.1
58
+ - - "<"
59
+ - !ruby/object:Gem::Version
60
+ version: '1.3'
61
+ - !ruby/object:Gem::Dependency
62
+ name: rubyzip
63
+ requirement: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: 1.0.0
68
+ type: :runtime
69
+ prerelease: false
70
+ version_requirements: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: 1.0.0
75
+ - !ruby/object:Gem::Dependency
76
+ name: jbundler
77
+ requirement: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - "~>"
80
+ - !ruby/object:Gem::Version
81
+ version: '0.9'
82
+ type: :development
83
+ prerelease: false
84
+ version_requirements: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - "~>"
87
+ - !ruby/object:Gem::Version
88
+ version: '0.9'
89
+ - !ruby/object:Gem::Dependency
90
+ name: rspec
91
+ requirement: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - "~>"
94
+ - !ruby/object:Gem::Version
95
+ version: '3.0'
96
+ type: :development
97
+ prerelease: false
98
+ version_requirements: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - "~>"
101
+ - !ruby/object:Gem::Version
102
+ version: '3.0'
103
+ description: |-
104
+ Warbler is a gem to make a Java jar or war file out of any Ruby,
105
+ Rails, or Rack application. Warbler provides a minimal, flexible, Ruby-like way to
106
+ bundle up all of your application files for deployment to a Java environment.
107
+ email: nick@nicksieger.com
108
+ executables:
109
+ - warble
110
+ extensions: []
111
+ extra_rdoc_files: []
112
+ files:
113
+ - Gemfile
114
+ - History.txt
115
+ - LICENSE.txt
116
+ - Mavenfile
117
+ - README.rdoc
118
+ - Rakefile
119
+ - bin/warble
120
+ - ext/JarMain.java
121
+ - ext/WarMain.java
122
+ - ext/WarblerJar.java
123
+ - ext/WarblerJarService.java
124
+ - lib/warbler.rb
125
+ - lib/warbler/application.rb
126
+ - lib/warbler/bundler_helper.rb
127
+ - lib/warbler/config.rb
128
+ - lib/warbler/executable_helper.rb
129
+ - lib/warbler/gems.rb
130
+ - lib/warbler/jar.rb
131
+ - lib/warbler/pathmap_helper.rb
132
+ - lib/warbler/platform_helper.rb
133
+ - lib/warbler/rake_helper.rb
134
+ - lib/warbler/scripts/rails.rb
135
+ - lib/warbler/task.rb
136
+ - lib/warbler/templates/bundler.erb
137
+ - lib/warbler/templates/config.erb
138
+ - lib/warbler/templates/jar.erb
139
+ - lib/warbler/templates/jbundler.erb
140
+ - lib/warbler/templates/rack.erb
141
+ - lib/warbler/templates/rails.erb
142
+ - lib/warbler/templates/war.erb
143
+ - lib/warbler/traits.rb
144
+ - lib/warbler/traits/bundler.rb
145
+ - lib/warbler/traits/gemspec.rb
146
+ - lib/warbler/traits/jar.rb
147
+ - lib/warbler/traits/jbundler.rb
148
+ - lib/warbler/traits/nogemspec.rb
149
+ - lib/warbler/traits/rack.rb
150
+ - lib/warbler/traits/rails.rb
151
+ - lib/warbler/traits/war.rb
152
+ - lib/warbler/version.rb
153
+ - lib/warbler/war.rb
154
+ - lib/warbler/web_server.rb
155
+ - lib/warbler/zip_support.rb
156
+ - lib/warbler_jar.jar
157
+ - warble.rb
158
+ - warbler.gemspec
159
+ - web.xml.erb
160
+ homepage: https://github.com/jruby/warbler
161
+ licenses:
162
+ - MIT
163
+ metadata: {}
164
+ post_install_message:
165
+ rdoc_options:
166
+ - "--main"
167
+ - README.rdoc
168
+ - "-H"
169
+ - "-f"
170
+ - darkfish
171
+ require_paths:
172
+ - lib
173
+ required_ruby_version: !ruby/object:Gem::Requirement
174
+ requirements:
175
+ - - ">="
176
+ - !ruby/object:Gem::Version
177
+ version: '2.5'
178
+ required_rubygems_version: !ruby/object:Gem::Requirement
179
+ requirements:
180
+ - - ">="
181
+ - !ruby/object:Gem::Version
182
+ version: '0'
183
+ requirements: []
184
+ rubygems_version: 3.5.18
185
+ signing_key:
186
+ specification_version: 4
187
+ summary: Warbler chirpily constructs .war files of your Rails applications.
188
+ test_files: []