warbler 1.4.1 → 1.4.2

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -11,4 +11,6 @@ warbler.iws
11
11
  warbler.ipr
12
12
  warbler-*.gem
13
13
  log
14
- integration/**/*.iml
14
+ integration/**/*.iml
15
+ build.log
16
+ .ruby-version
@@ -1,5 +1,5 @@
1
1
  rvm:
2
- - jruby-1.7.7
2
+ - jruby-1.7.8
3
3
  branches:
4
4
  only:
5
5
  - master
@@ -20,9 +20,8 @@ matrix:
20
20
  env: ''
21
21
  - rvm: jruby
22
22
  env: MAVEN_OPTS="-XX:MaxPermSize=128m"
23
- script: cd integration && mvn clean verify
23
+ script: mvn clean verify
24
24
  allow_failures:
25
- - rvm: jruby
26
25
  - rvm: jruby-head
27
26
  notifications:
28
27
  irc:
@@ -1,3 +1,11 @@
1
+ == 1.4.2
2
+ - #241: jars from jruby.jar itself do not get copied over to WEB-INF/lib
3
+ - #199: javascript_include_tag and stylesheet_link_tag not generating digestions
4
+ - #247: better support for Rails 4 asset pipeline
5
+ - #169: Compile war not loading assets
6
+ - #243: Added the move_jars_to_webinf_lib method back in...
7
+ - #249: Warbler 1.4.1 fails to compile on Windows
8
+
1
9
  == 1.4.1
2
10
  - Support for JBundler
3
11
  - #165: Problem with bundler git gems
@@ -0,0 +1,25 @@
1
+ #-*- mode: ruby -*-
2
+
3
+ # tell the gem setup for maven where the java sources are
4
+ # and how to name the jar file (default path for the jar: ./lib )
5
+ gemspec( :jar => 'warbler_jar.jar',
6
+ :source => 'ext' )
7
+
8
+ # just dump the POM as pom.xml as read-only file
9
+ properties( 'tesla.dump.pom' => 'pom.xml',
10
+ 'tesla.dump.readOnly' => true )
11
+
12
+ # dependencies needed for compilation
13
+ scope :provided do
14
+ jar 'org.jruby:jruby', '1.7.8'
15
+ jar 'org.eclipse.jetty:jetty-webapp', '8.1.9.v20130131'
16
+ end
17
+
18
+ plugin :compiler, '3.1', :source => '1.5', :target => '1.5'
19
+
20
+ plugin :invoker, '1.8' do
21
+ execute_goals( :install, :run,
22
+ :id => 'integration-test',
23
+ :projectsDirectory => 'integration',
24
+ :streamLogs => true )
25
+ end
data/Rakefile CHANGED
@@ -1,3 +1,4 @@
1
+ #-*- mode: ruby -*-
1
2
  #--
2
3
  # Copyright (c) 2010-2012 Engine Yard, Inc.
3
4
  # Copyright (c) 2007-2009 Sun Microsystems, Inc.
@@ -5,12 +6,8 @@
5
6
  # See the file LICENSE.txt for details.
6
7
  #++
7
8
 
8
- begin
9
- require 'bundler/setup'
10
- rescue LoadError => e
11
- require('rubygems') && retry
12
- puts "Please `gem install bundler' and run `bundle install' to ensure you have all dependencies"
13
- raise e
9
+ unless defined? Bundler
10
+ warn "\nPlease `gem install bundler' and run `bundle install' to ensure you have all dependencies and run inside a bundler context 'bundle exec rake'.\n\n"
14
11
  end
15
12
 
16
13
  require 'bundler/gem_helper'
@@ -19,7 +16,7 @@ gem_helper.install
19
16
  gemspec = gem_helper.gemspec
20
17
 
21
18
  require 'rake/clean'
22
- CLEAN << "pkg" << "doc"
19
+ CLEAN << "pkg" << "doc" << Dir['integration/**/target']
23
20
 
24
21
  require 'rspec/core/rake_task'
25
22
  RSpec::Core::RakeTask.new(:spec) do |t|
@@ -28,31 +25,21 @@ end
28
25
 
29
26
  task :default => :spec
30
27
 
31
- jar_file = "lib/warbler_jar.jar"
32
- begin
33
- require 'ant'
34
- directory "pkg/classes"
35
- CLEAN << "pkg"
28
+ # use Mavenfile to define :jar task
29
+ require 'maven/ruby/tasks'
36
30
 
37
- file jar_file => FileList['ext/*.java', 'pkg/classes'] do
38
- rm_rf FileList['pkg/classes/**/*']
39
- ant.javac :srcdir => "ext", :includes => "*.java", :destdir => "pkg/classes",
40
- :source => "1.5", :target => "1.5", :debug => true,
41
- :classpath => "${java.class.path}:${sun.boot.class.path}",
42
- :includeantRuntime => false
43
-
44
- ant.jar :basedir => "pkg/classes", :destfile => jar_file, :includes => "*.class"
45
- end
31
+ desc 'run some integration test'
32
+ task :integration do
33
+ maven.verify
34
+ end
46
35
 
47
- desc "Compile and jar the Warbler Java helper classes"
48
- task :jar => jar_file
49
- rescue LoadError
50
- task :jar do
51
- puts "Run 'jar' with JRuby to re-compile the java jar booster"
52
- end
36
+ desc 'generate the pom.xml from the Mavenfile'
37
+ task :pom do
38
+ maven.validate
53
39
  end
54
40
 
55
41
  # Make sure jar gets compiled before the gem is built
42
+ # the jar tasks is part of maven-tasks
56
43
  task :build => :jar
57
44
 
58
45
  require 'rdoc/task'
@@ -0,0 +1,10 @@
1
+ #-*- mode: ruby -*-
2
+
3
+ require 'maven/ruby/tasks'
4
+
5
+ task :default do
6
+ # chdir might not work with jruby, in that case run 'rake verify' from the parrent dir
7
+ Dir.chdir '..' do
8
+ maven.install
9
+ end
10
+ end
@@ -8,21 +8,43 @@
8
8
  <packaging>pom</packaging>
9
9
 
10
10
  <modules>
11
- <module>gem-initializer</module>
12
11
  <module>simple_rack_test</module>
12
+
13
13
  <module>rails4_test</module>
14
+
14
15
  <module>runnable_test</module>
15
16
  </modules>
16
17
 
17
18
  <properties>
18
- <version.jruby-maven-plugins>0.28.4</version.jruby-maven-plugins>
19
+ <version.jruby-maven-plugins>1.0.0-rc</version.jruby-maven-plugins>
19
20
  <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
20
21
  <jruby.version>1.7.9</jruby.version>
21
- <warbler.version>1.4.1.dev</warbler.version>
22
- <rubygems.home>${session.executionRootDirectory}/target/rubygems</rubygems.home>
22
+ <!-- prereleased gems ARE snapshots -->
23
+ <warbler.version>1.4.1.dev-SNAPSHOT</warbler.version>
24
+ <gem.home>${session.executionRootDirectory}/target/rubygems</gem.home>
25
+ <gem.path>${session.executionRootDirectory}/target/rubygems</gem.path>
23
26
  </properties>
24
27
 
28
+ <repositories>
29
+ <repository>
30
+ <id>rubygems-releases</id>
31
+ <url>http://rubygems-proxy.torquebox.org/releases</url>
32
+ </repository>
33
+ </repositories>
34
+
25
35
  <dependencies>
36
+ <dependency>
37
+ <groupId>rubygems</groupId>
38
+ <artifactId>bundler</artifactId>
39
+ <version>1.5.3</version>
40
+ <type>gem</type>
41
+ </dependency>
42
+ <dependency>
43
+ <groupId>rubygems</groupId>
44
+ <artifactId>warbler</artifactId>
45
+ <version>${warbler.version}</version>
46
+ <type>gem</type>
47
+ </dependency>
26
48
  <dependency>
27
49
  <groupId>junit</groupId>
28
50
  <artifactId>junit</artifactId>
@@ -45,35 +67,6 @@
45
67
  </resource>
46
68
  </resources>
47
69
  <plugins>
48
- <plugin>
49
- <groupId>org.apache.maven.plugins</groupId>
50
- <artifactId>maven-antrun-plugin</artifactId>
51
- <executions>
52
- <execution>
53
- <id>create-target-dir</id>
54
- <phase>process-resources</phase>
55
- <configuration>
56
- <tasks>
57
- <mkdir dir="target"/>
58
- <mkdir dir="${rubygems.home}"/>
59
- </tasks>
60
- </configuration>
61
- <goals>
62
- <goal>run</goal>
63
- </goals>
64
- </execution>
65
- </executions>
66
- </plugin>
67
- <plugin>
68
- <groupId>org.apache.maven.plugins</groupId>
69
- <artifactId>maven-jar-plugin</artifactId>
70
- <version>2.4</version>
71
- <configuration>
72
- <excludes>
73
- <exclude>${basedir}/src/main/ruby</exclude>
74
- </excludes>
75
- </configuration>
76
- </plugin>
77
70
  <plugin>
78
71
  <groupId>org.apache.maven.plugins</groupId>
79
72
  <artifactId>maven-failsafe-plugin</artifactId>
@@ -87,6 +80,16 @@
87
80
  </execution>
88
81
  </executions>
89
82
  </plugin>
83
+ <plugin>
84
+ <groupId>de.saumya.mojo</groupId>
85
+ <artifactId>gem-maven-plugin</artifactId>
86
+ <version>${version.jruby-maven-plugins}</version>
87
+ <executions>
88
+ <execution>
89
+ <goals><goal>initialize</goal></goals>
90
+ </execution>
91
+ </executions>
92
+ </plugin>
90
93
  </plugins>
91
94
  <pluginManagement>
92
95
  <plugins>
@@ -137,25 +140,27 @@
137
140
  <groupId>de.saumya.mojo</groupId>
138
141
  <artifactId>jruby-maven-plugin</artifactId>
139
142
  <version>${version.jruby-maven-plugins}</version>
140
- <extensions>true</extensions>
141
143
  <configuration>
142
- <gemHome>${rubygems.home}</gemHome>
144
+ <gemHome>${gem.home}</gemHome>
143
145
  <jrubySwitches>--1.9</jrubySwitches>
144
146
  <jrubyVersion>${jruby.version}</jrubyVersion>
145
147
  </configuration>
146
148
  <executions>
149
+
147
150
  <execution>
148
151
  <id>bundle-install</id>
149
- <goals><goal>jruby</goal></goals>
152
+
153
+ <goals><goal>jruby</goal></goals>
150
154
  <configuration>
151
- <args>-C ${basedir}/src/main/ruby -S ${rubygems.home}/bin/bundle install</args>
155
+ <args>-C ${basedir}/src/main/ruby -S ${gem.home}/bin/bundle install</args>
152
156
  </configuration>
153
157
  </execution>
158
+
154
159
  <execution>
155
160
  <id>create-war</id>
156
161
  <goals><goal>jruby</goal></goals>
157
162
  <configuration>
158
- <args>-C ${basedir}/src/main/ruby -S ${rubygems.home}/bin/warble</args>
163
+ <args>-C ${basedir}/src/main/ruby -S ${gem.home}/bin/warble</args>
159
164
  </configuration>
160
165
  </execution>
161
166
  </executions>
@@ -14,16 +14,6 @@
14
14
  <name>rails4_test</name>
15
15
  <url>http://maven.apache.org</url>
16
16
 
17
- <dependencies>
18
- <dependency>
19
- <groupId>${project.groupId}</groupId>
20
- <artifactId>gem-initializer</artifactId>
21
- <version>${project.version}</version>
22
- <type>pom</type>
23
- <scope>test</scope>
24
- </dependency>
25
- </dependencies>
26
-
27
17
  <build>
28
18
  <plugins>
29
19
  <plugin>
@@ -18,15 +18,6 @@
18
18
  <test-file>test-file.tmp</test-file>
19
19
  </properties>
20
20
 
21
- <dependencies>
22
- <dependency>
23
- <groupId>${project.groupId}</groupId>
24
- <artifactId>gem-initializer</artifactId>
25
- <version>${project.version}</version>
26
- <type>pom</type>
27
- </dependency>
28
- </dependencies>
29
-
30
21
  <build>
31
22
  <plugins>
32
23
  <plugin>
@@ -14,29 +14,12 @@
14
14
  <name>simple_rack_test</name>
15
15
  <url>http://maven.apache.org</url>
16
16
 
17
- <dependencies>
18
- <dependency>
19
- <groupId>${project.groupId}</groupId>
20
- <artifactId>gem-initializer</artifactId>
21
- <version>${project.version}</version>
22
- <type>pom</type>
23
- </dependency>
24
- </dependencies>
25
-
26
17
  <build>
27
18
  <plugins>
28
19
  <plugin>
29
20
  <groupId>de.saumya.mojo</groupId>
30
21
  <artifactId>jruby-maven-plugin</artifactId>
31
22
  <executions>
32
- <execution>
33
- <id>install-gems</id>
34
- <phase>initialize</phase>
35
- <goals><goal>jruby</goal></goals>
36
- <configuration>
37
- <args>-S ${basedir}/src/main/ruby/bin/install-gems.rb</args>
38
- </configuration>
39
- </execution>
40
23
  <execution>
41
24
  <id>create-war</id>
42
25
  <phase>pre-integration-test</phase>
@@ -33,6 +33,7 @@ require 'warbler/version'
33
33
  require 'warbler/executable_helper'
34
34
  require 'warbler/rake_helper'
35
35
  require 'warbler/pathmap_helper'
36
+ require 'warbler/platform_helper'
36
37
  require 'warbler/task'
37
38
  require 'warbler/application'
38
39
  require 'warbler/web_server'
@@ -164,6 +164,10 @@ module Warbler
164
164
  # * <tt>jetty</tt> - Embedded Jetty from Eclipse
165
165
  attr_accessor :webserver
166
166
 
167
+ # If set to true, Warbler will move jar files into the WEB-INF/lib directory of the
168
+ # created war file. This may be needed for some web servers. Defaults to false.
169
+ attr_accessor :move_jars_to_webinf_lib
170
+
167
171
  # These file will be placed in the META-INF directory of the jar or war that warbler
168
172
  # produces. They are primarily used as launchers by the runnable feature.
169
173
  attr_accessor :script_files
@@ -195,6 +199,7 @@ module Warbler
195
199
  @override_gem_home = true
196
200
  @script_files = []
197
201
  @warbler_scripts = "#{WARBLER_HOME}/lib/warbler/scripts"
202
+ @move_jars_to_webinf_lib = false
198
203
 
199
204
  before_configure
200
205
  yield self if block_given?
@@ -19,6 +19,7 @@ module Warbler
19
19
  class Jar
20
20
  include PathmapHelper
21
21
  include RakeHelper
22
+ include PlatformHelper
22
23
 
23
24
  DEFAULT_MANIFEST = %{Manifest-Version: 1.0\nCreated-By: Warbler #{Warbler::VERSION}\n\n}
24
25
 
@@ -50,7 +51,12 @@ module Warbler
50
51
  compat_version = ''
51
52
  end
52
53
  # Need to use the version of JRuby in the application to compile it
53
- system %Q{env -i java -classpath #{config.java_libs.join(File::PATH_SEPARATOR)} org.jruby.Main #{compat_version} -S jrubyc \"#{compiled_ruby_files.join('" "')}\"}
54
+ javac_cmd = %Q{java -classpath #{config.java_libs.join(File::PATH_SEPARATOR)} org.jruby.Main #{compat_version} -S jrubyc \"#{compiled_ruby_files.join('" "')}\"}
55
+ if which('env')
56
+ system %Q{env -i #{javac_cmd}}
57
+ else
58
+ system javac_cmd
59
+ end
54
60
  raise "Compile failed" if $?.exitstatus > 0
55
61
  end
56
62
 
@@ -0,0 +1,26 @@
1
+ #--
2
+ # Copyright (c) 2010-2012 Engine Yard, Inc.
3
+ # Copyright (c) 2007-2009 Sun Microsystems, Inc.
4
+ # This source code is available under the MIT license.
5
+ # See the file LICENSE.txt for details.
6
+ #++
7
+
8
+ module Warbler
9
+ module PlatformHelper
10
+ # Cross-platform way of finding an executable in the $PATH.
11
+ # Thanks to @mislav
12
+ #
13
+ # which('ruby') #=> /usr/bin/ruby
14
+ def which(cmd)
15
+ exts = ENV['PATHEXT'] ? ENV['PATHEXT'].split(';') : ['']
16
+ ENV['PATH'].split(File::PATH_SEPARATOR).each do |path|
17
+ exts.each { |ext|
18
+ exe = File.join(path, "#{cmd}#{ext}")
19
+ return exe if File.executable? exe
20
+ }
21
+ end
22
+ return nil
23
+ end
24
+ end
25
+ end
26
+
@@ -49,8 +49,10 @@ module Warbler
49
49
  config.webxml.jruby.min.runtimes = 1 unless Integer === config.webxml.jruby.min.runtimes
50
50
  config.webxml.jruby.max.runtimes = 1 unless Integer === config.webxml.jruby.max.runtimes
51
51
  end
52
- end
53
52
 
53
+ config.includes += FileList["public/assets/manifest-*.json"].existing
54
+ config.includes += FileList["public/assets/manifest.yml"].existing
55
+ end
54
56
 
55
57
  def default_app_name
56
58
  File.basename(File.expand_path(defined?(::Rails.root) ? ::Rails.root : (defined?(RAILS_ROOT) ? RAILS_ROOT : Dir.getwd)))
@@ -76,7 +76,7 @@ module Warbler
76
76
  def update_archive(jar)
77
77
  add_public_files(jar)
78
78
  add_webxml(jar)
79
- move_jars_to_webinf_lib(jar)
79
+ move_jars_to_webinf_lib(jar) if config.move_jars_to_webinf_lib
80
80
  add_runnables(jar) if config.features.include?("runnable")
81
81
  add_executables(jar) if config.features.include?("executable")
82
82
  add_gemjar(jar) if config.features.include?("gemjar")
@@ -6,5 +6,5 @@
6
6
  #++
7
7
 
8
8
  module Warbler
9
- VERSION = "1.4.1"
9
+ VERSION = "1.4.2"
10
10
  end
Binary file
data/pom.xml ADDED
@@ -0,0 +1,162 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
3
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
4
+ <modelVersion>4.0.0</modelVersion>
5
+ <groupId>rubygems</groupId>
6
+ <artifactId>warbler</artifactId>
7
+ <version>1.4.1.dev-SNAPSHOT</version>
8
+ <packaging>gem</packaging>
9
+ <name>Warbler chirpily constructs .war files of your Rails applications.</name>
10
+ <description>Warbler is a gem to make a Java jar or war file out of any Ruby,
11
+ Rails, Merb, or Rack application. Warbler provides a minimal,
12
+ flexible, Ruby-like way to bundle up all of your application files for
13
+ deployment to a Java environment.</description>
14
+ <url>http://caldersphere.rubyforge.org/warbler</url>
15
+ <properties>
16
+ <tesla.dump.readOnly>true</tesla.dump.readOnly>
17
+ <jruby.plugins.version>1.0.0-rc4</jruby.plugins.version>
18
+ <tesla.dump.pom>pom.xml</tesla.dump.pom>
19
+ <project.build.sourceEncoding>utf-8</project.build.sourceEncoding>
20
+ </properties>
21
+ <dependencies>
22
+ <dependency>
23
+ <groupId>rubygems</groupId>
24
+ <artifactId>rake</artifactId>
25
+ <version>[0.9.6,)</version>
26
+ <type>gem</type>
27
+ </dependency>
28
+ <dependency>
29
+ <groupId>rubygems</groupId>
30
+ <artifactId>jruby-jars</artifactId>
31
+ <version>[1.5.6,2.0)</version>
32
+ <type>gem</type>
33
+ </dependency>
34
+ <dependency>
35
+ <groupId>rubygems</groupId>
36
+ <artifactId>jruby-rack</artifactId>
37
+ <version>[1.0.0,)</version>
38
+ <type>gem</type>
39
+ </dependency>
40
+ <dependency>
41
+ <groupId>rubygems</groupId>
42
+ <artifactId>rubyzip</artifactId>
43
+ <version>[0.9,1.1)</version>
44
+ <type>gem</type>
45
+ </dependency>
46
+ <dependency>
47
+ <groupId>rubygems</groupId>
48
+ <artifactId>ruby-maven</artifactId>
49
+ <version>[3.1.1.0.0,3.1.1.0.0.0.0.0.0.1)</version>
50
+ <type>gem</type>
51
+ <scope>test</scope>
52
+ </dependency>
53
+ <dependency>
54
+ <groupId>rubygems</groupId>
55
+ <artifactId>rspec</artifactId>
56
+ <version>[2.10,2.99999]</version>
57
+ <type>gem</type>
58
+ <scope>test</scope>
59
+ </dependency>
60
+ <dependency>
61
+ <groupId>rubygems</groupId>
62
+ <artifactId>rdoc</artifactId>
63
+ <version>[2.4.2,)</version>
64
+ <type>gem</type>
65
+ <scope>test</scope>
66
+ </dependency>
67
+ <dependency>
68
+ <groupId>org.jruby</groupId>
69
+ <artifactId>jruby</artifactId>
70
+ <version>1.7.8</version>
71
+ <scope>provided</scope>
72
+ </dependency>
73
+ <dependency>
74
+ <groupId>org.eclipse.jetty</groupId>
75
+ <artifactId>jetty-webapp</artifactId>
76
+ <version>8.1.9.v20130131</version>
77
+ <scope>provided</scope>
78
+ </dependency>
79
+ </dependencies>
80
+ <repositories>
81
+ <repository>
82
+ <id>rubygems-releases</id>
83
+ <url>http://rubygems-proxy.torquebox.org/releases</url>
84
+ </repository>
85
+ </repositories>
86
+ <build>
87
+ <sourceDirectory>ext</sourceDirectory>
88
+ <extensions>
89
+ <extension>
90
+ <groupId>de.saumya.mojo</groupId>
91
+ <artifactId>gem-extension</artifactId>
92
+ <version>${jruby.plugins.version}</version>
93
+ </extension>
94
+ </extensions>
95
+ <directory>${basedir}/pkg</directory>
96
+ <plugins>
97
+ <plugin>
98
+ <artifactId>maven-jar-plugin</artifactId>
99
+ <version>2.4</version>
100
+ <executions>
101
+ <execution>
102
+ <phase>prepare-package</phase>
103
+ <goals>
104
+ <goal>jar</goal>
105
+ </goals>
106
+ </execution>
107
+ </executions>
108
+ <configuration>
109
+ <outputDirectory>lib</outputDirectory>
110
+ <finalName>warbler_jar</finalName>
111
+ </configuration>
112
+ </plugin>
113
+ <plugin>
114
+ <artifactId>maven-clean-plugin</artifactId>
115
+ <version>2.4</version>
116
+ <configuration>
117
+ <filesets>
118
+ <fileset>
119
+ <directory>lib</directory>
120
+ <includes>
121
+ <include>warbler_jar.jar</include>
122
+ </includes>
123
+ </fileset>
124
+ </filesets>
125
+ </configuration>
126
+ </plugin>
127
+ <plugin>
128
+ <groupId>de.saumya.mojo</groupId>
129
+ <artifactId>gem-maven-plugin</artifactId>
130
+ <version>${jruby.plugins.version}</version>
131
+ <configuration>
132
+ <gemspec>warbler.gemspec</gemspec>
133
+ </configuration>
134
+ </plugin>
135
+ <plugin>
136
+ <artifactId>maven-compiler-plugin</artifactId>
137
+ <version>3.1</version>
138
+ <configuration>
139
+ <source>1.5</source>
140
+ <target>1.5</target>
141
+ </configuration>
142
+ </plugin>
143
+ <plugin>
144
+ <artifactId>maven-invoker-plugin</artifactId>
145
+ <version>1.8</version>
146
+ <executions>
147
+ <execution>
148
+ <id>integration-test</id>
149
+ <goals>
150
+ <goal>install</goal>
151
+ <goal>run</goal>
152
+ </goals>
153
+ <configuration>
154
+ <projectsDirectory>integration</projectsDirectory>
155
+ <streamLogs>true</streamLogs>
156
+ </configuration>
157
+ </execution>
158
+ </executions>
159
+ </plugin>
160
+ </plugins>
161
+ </build>
162
+ </project>
@@ -558,16 +558,32 @@ describe Warbler::Jar do
558
558
  rm_f FileList["app/sample.jar", "lib/existing.jar"]
559
559
  end
560
560
 
561
- it "moves jar files to WEB-INF/lib" do
562
- jar.apply(config)
563
- file_list(%r{WEB-INF/lib/app-sample.jar}).should_not be_empty
564
- file_list(%r{WEB-INF/app/sample.jar}).should_not be_empty
561
+ context "with move_jars_to_webinf_lib set to true" do
562
+ before :each do
563
+ use_config do |config|
564
+ config.move_jars_to_webinf_lib = true
565
+ end
566
+ end
567
+
568
+ it "moves jar files to WEB-INF/lib" do
569
+ jar.apply(config)
570
+ file_list(%r{WEB-INF/lib/app-sample.jar}).should_not be_empty
571
+ file_list(%r{WEB-INF/app/sample.jar}).should_not be_empty
572
+ end
573
+
574
+ it "leaves jar files alone that are already in WEB-INF/lib" do
575
+ jar.apply(config)
576
+ file_list(%r{WEB-INF/lib/lib-existing.jar}).should be_empty
577
+ file_list(%r{WEB-INF/lib/existing.jar}).should_not be_empty
578
+ end
565
579
  end
566
580
 
567
- it "leaves jar files alone that are already in WEB-INF/lib" do
568
- jar.apply(config)
569
- file_list(%r{WEB-INF/lib/lib-existing.jar}).should be_empty
570
- file_list(%r{WEB-INF/lib/existing.jar}).should_not be_empty
581
+ context "with move_jars_to_webinf_lib not set" do
582
+ it "moves jar files to WEB-INF/lib" do
583
+ jar.apply(config)
584
+ file_list(%r{WEB-INF/lib/app-sample.jar}).should be_empty
585
+ file_list(%r{WEB-INF/app/sample.jar}).should_not be_empty
586
+ end
571
587
  end
572
588
  end
573
589
 
@@ -673,6 +689,23 @@ describe Warbler::Jar do
673
689
  end
674
690
  end
675
691
 
692
+ context "with asset_pipeline" do
693
+ let (:manifest_file) { "public/assets/manifest.yml" }
694
+
695
+ before do
696
+ mkdir File.dirname(manifest_file)
697
+ File.open(manifest_file, "w")
698
+ end
699
+
700
+ after do
701
+ rm_rf File.dirname(manifest_file)
702
+ end
703
+
704
+ it "automatically adds asset pipeline manifest file to the included files" do
705
+ config.includes.should include("public/assets/manifest.yml")
706
+ end
707
+ end
708
+
676
709
  context "with threadsafe! enabled in production.rb" do
677
710
  before :each do
678
711
  cp "config/environments/production.rb", "config/environments/production.rb.orig"
@@ -701,6 +734,23 @@ describe Warbler::Jar do
701
734
 
702
735
  context "with rails version 4" do
703
736
 
737
+ let (:manifest_file) { "public/assets/manifest-1234.json" }
738
+
739
+ shared_examples_for "asset pipeline" do
740
+ it "automatically adds asset pipeline manifest file to the included files" do
741
+ config.includes.should include(manifest_file)
742
+ end
743
+ end
744
+
745
+ before do
746
+ mkdir File.dirname(manifest_file)
747
+ File.open(manifest_file, "w")
748
+ end
749
+
750
+ after do
751
+ rm_rf File.dirname(manifest_file)
752
+ end
753
+
704
754
  context "When rails version is specified in Gemfile" do
705
755
  before :each do
706
756
  File.open("Gemfile", "a") { |f| f.puts "gem 'rails', '4.0.0'" }
@@ -711,6 +761,7 @@ describe Warbler::Jar do
711
761
  end
712
762
 
713
763
  it_should_behave_like "threaded environment"
764
+ it_should_behave_like "asset pipeline"
714
765
  end
715
766
 
716
767
  context "when rails version is not specified in Gemfile" do
@@ -725,6 +776,7 @@ describe Warbler::Jar do
725
776
  end
726
777
 
727
778
  it_should_behave_like "threaded environment"
779
+ it_should_behave_like "asset pipeline"
728
780
  end
729
781
  end
730
782
 
data/warble.rb CHANGED
@@ -100,6 +100,11 @@ Warbler::Config.new do |config|
100
100
  # Sets default (prefixed) parameters for the executables
101
101
  # config.executable_params = "do:something"
102
102
 
103
+ # If set to true, moves jar files into WEB-INF/lib. Prior to version 1.4.2 of Warbler this was done
104
+ # by default. But since 1.4.2 this config defaults to false. It may need to be set to true for
105
+ # web servers that do not explode the WAR file.
106
+ # config.move_jars_to_webinf_lib = false
107
+
103
108
  # === War files only below here ===
104
109
 
105
110
  # Path to the pre-bundled gem directory inside the war file. Default
@@ -25,10 +25,12 @@ deployment to a Java environment.}
25
25
  gem.rubyforge_project = "caldersphere"
26
26
 
27
27
  gem.add_runtime_dependency 'rake', [">= 0.9.6"]
28
- gem.add_runtime_dependency 'jruby-jars', [">= 1.5.6"]
28
+ # restrict it for maven not to find jruby-9000.dev
29
+ gem.add_runtime_dependency 'jruby-jars', [">= 1.5.6", '< 2.0']
29
30
  gem.add_runtime_dependency 'jruby-rack', [">= 1.0.0"]
30
31
  gem.add_runtime_dependency 'rubyzip', [">= 0.9", "< 1.1"]
31
- gem.add_development_dependency 'jbundler', "~> 0.5"
32
+ gem.add_development_dependency 'jbundler', "~> 0.5.5"
33
+ gem.add_development_dependency 'ruby-maven', '~> 3.1.1.0'
32
34
  gem.add_development_dependency 'rspec', "~> 2.10"
33
35
  gem.add_development_dependency 'rdoc', ">= 2.4.2"
34
36
  end
metadata CHANGED
@@ -1,124 +1,163 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: warbler
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.1
4
+ version: 1.4.2
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - Nick Sieger
8
- autorequire:
9
+ autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2014-02-14 00:00:00.000000000 Z
12
+ date: 2014-03-08 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: rake
15
- version_requirements: !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
16
18
  requirements:
17
- - - '>='
19
+ - - ! '>='
18
20
  - !ruby/object:Gem::Version
19
21
  version: 0.9.6
20
- requirement: !ruby/object:Gem::Requirement
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
21
26
  requirements:
22
- - - '>='
27
+ - - ! '>='
23
28
  - !ruby/object:Gem::Version
24
29
  version: 0.9.6
25
- prerelease: false
26
- type: :runtime
27
30
  - !ruby/object:Gem::Dependency
28
31
  name: jruby-jars
29
- version_requirements: !ruby/object:Gem::Requirement
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
30
34
  requirements:
31
- - - '>='
35
+ - - ! '>='
32
36
  - !ruby/object:Gem::Version
33
37
  version: 1.5.6
34
- requirement: !ruby/object:Gem::Requirement
38
+ - - <
39
+ - !ruby/object:Gem::Version
40
+ version: '2.0'
41
+ type: :runtime
42
+ prerelease: false
43
+ version_requirements: !ruby/object:Gem::Requirement
44
+ none: false
35
45
  requirements:
36
- - - '>='
46
+ - - ! '>='
37
47
  - !ruby/object:Gem::Version
38
48
  version: 1.5.6
39
- prerelease: false
40
- type: :runtime
49
+ - - <
50
+ - !ruby/object:Gem::Version
51
+ version: '2.0'
41
52
  - !ruby/object:Gem::Dependency
42
53
  name: jruby-rack
43
- version_requirements: !ruby/object:Gem::Requirement
54
+ requirement: !ruby/object:Gem::Requirement
55
+ none: false
44
56
  requirements:
45
- - - '>='
57
+ - - ! '>='
46
58
  - !ruby/object:Gem::Version
47
59
  version: 1.0.0
48
- requirement: !ruby/object:Gem::Requirement
60
+ type: :runtime
61
+ prerelease: false
62
+ version_requirements: !ruby/object:Gem::Requirement
63
+ none: false
49
64
  requirements:
50
- - - '>='
65
+ - - ! '>='
51
66
  - !ruby/object:Gem::Version
52
67
  version: 1.0.0
53
- prerelease: false
54
- type: :runtime
55
68
  - !ruby/object:Gem::Dependency
56
69
  name: rubyzip
57
- version_requirements: !ruby/object:Gem::Requirement
70
+ requirement: !ruby/object:Gem::Requirement
71
+ none: false
58
72
  requirements:
59
- - - '>='
73
+ - - ! '>='
60
74
  - !ruby/object:Gem::Version
61
75
  version: '0.9'
62
76
  - - <
63
77
  - !ruby/object:Gem::Version
64
78
  version: '1.1'
65
- requirement: !ruby/object:Gem::Requirement
79
+ type: :runtime
80
+ prerelease: false
81
+ version_requirements: !ruby/object:Gem::Requirement
82
+ none: false
66
83
  requirements:
67
- - - '>='
84
+ - - ! '>='
68
85
  - !ruby/object:Gem::Version
69
86
  version: '0.9'
70
87
  - - <
71
88
  - !ruby/object:Gem::Version
72
89
  version: '1.1'
73
- prerelease: false
74
- type: :runtime
75
90
  - !ruby/object:Gem::Dependency
76
91
  name: jbundler
92
+ requirement: !ruby/object:Gem::Requirement
93
+ none: false
94
+ requirements:
95
+ - - ~>
96
+ - !ruby/object:Gem::Version
97
+ version: 0.5.5
98
+ type: :development
99
+ prerelease: false
77
100
  version_requirements: !ruby/object:Gem::Requirement
101
+ none: false
78
102
  requirements:
79
103
  - - ~>
80
104
  - !ruby/object:Gem::Version
81
- version: '0.5'
105
+ version: 0.5.5
106
+ - !ruby/object:Gem::Dependency
107
+ name: ruby-maven
82
108
  requirement: !ruby/object:Gem::Requirement
109
+ none: false
83
110
  requirements:
84
111
  - - ~>
85
112
  - !ruby/object:Gem::Version
86
- version: '0.5'
87
- prerelease: false
113
+ version: 3.1.1.0
88
114
  type: :development
89
- - !ruby/object:Gem::Dependency
90
- name: rspec
115
+ prerelease: false
91
116
  version_requirements: !ruby/object:Gem::Requirement
117
+ none: false
92
118
  requirements:
93
119
  - - ~>
94
120
  - !ruby/object:Gem::Version
95
- version: '2.10'
121
+ version: 3.1.1.0
122
+ - !ruby/object:Gem::Dependency
123
+ name: rspec
96
124
  requirement: !ruby/object:Gem::Requirement
125
+ none: false
97
126
  requirements:
98
127
  - - ~>
99
128
  - !ruby/object:Gem::Version
100
129
  version: '2.10'
101
- prerelease: false
102
130
  type: :development
103
- - !ruby/object:Gem::Dependency
104
- name: rdoc
131
+ prerelease: false
105
132
  version_requirements: !ruby/object:Gem::Requirement
133
+ none: false
106
134
  requirements:
107
- - - '>='
135
+ - - ~>
108
136
  - !ruby/object:Gem::Version
109
- version: 2.4.2
137
+ version: '2.10'
138
+ - !ruby/object:Gem::Dependency
139
+ name: rdoc
110
140
  requirement: !ruby/object:Gem::Requirement
141
+ none: false
111
142
  requirements:
112
- - - '>='
143
+ - - ! '>='
113
144
  - !ruby/object:Gem::Version
114
145
  version: 2.4.2
115
- prerelease: false
116
146
  type: :development
117
- description: |-
118
- Warbler is a gem to make a Java jar or war file out of any Ruby,
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ none: false
150
+ requirements:
151
+ - - ! '>='
152
+ - !ruby/object:Gem::Version
153
+ version: 2.4.2
154
+ description: ! 'Warbler is a gem to make a Java jar or war file out of any Ruby,
155
+
119
156
  Rails, Merb, or Rack application. Warbler provides a minimal,
157
+
120
158
  flexible, Ruby-like way to bundle up all of your application files for
121
- deployment to a Java environment.
159
+
160
+ deployment to a Java environment.'
122
161
  email: nick@nicksieger.com
123
162
  executables:
124
163
  - warble
@@ -130,6 +169,7 @@ files:
130
169
  - Gemfile
131
170
  - History.txt
132
171
  - LICENSE.txt
172
+ - Mavenfile
133
173
  - README.rdoc
134
174
  - Rakefile
135
175
  - bin/warble
@@ -140,7 +180,7 @@ files:
140
180
  - ext/jetty/pom.xml
141
181
  - ext/jetty/src/main/java/JettyWarMain.java
142
182
  - ext/jetty/src/main/resources/webdefault.xml
143
- - integration/gem-initializer/pom.xml
183
+ - integration/Rakefile
144
184
  - integration/pom.xml
145
185
  - integration/rails4_test/pom.xml
146
186
  - integration/rails4_test/src/main/ruby/Gemfile
@@ -229,6 +269,7 @@ files:
229
269
  - lib/warbler/gems.rb
230
270
  - lib/warbler/jar.rb
231
271
  - lib/warbler/pathmap_helper.rb
272
+ - lib/warbler/platform_helper.rb
232
273
  - lib/warbler/rake_helper.rb
233
274
  - lib/warbler/scripts/rails.rb
234
275
  - lib/warbler/task.rb
@@ -254,6 +295,7 @@ files:
254
295
  - lib/warbler/web_server.rb
255
296
  - lib/warbler/zip_support.rb
256
297
  - lib/warbler_jar.jar
298
+ - pom.xml
257
299
  - spec/drb_default_id_conv.rb
258
300
  - spec/drb_helper.rb
259
301
  - spec/sample_bundler/.bundle/config
@@ -342,8 +384,7 @@ files:
342
384
  homepage: http://caldersphere.rubyforge.org/warbler
343
385
  licenses:
344
386
  - MIT
345
- metadata: {}
346
- post_install_message:
387
+ post_install_message:
347
388
  rdoc_options:
348
389
  - --main
349
390
  - README.rdoc
@@ -353,23 +394,25 @@ rdoc_options:
353
394
  require_paths:
354
395
  - lib
355
396
  required_ruby_version: !ruby/object:Gem::Requirement
397
+ none: false
356
398
  requirements:
357
- - - '>='
399
+ - - ! '>='
358
400
  - !ruby/object:Gem::Version
359
401
  version: '0'
360
402
  required_rubygems_version: !ruby/object:Gem::Requirement
403
+ none: false
361
404
  requirements:
362
- - - '>='
405
+ - - ! '>='
363
406
  - !ruby/object:Gem::Version
364
407
  version: '0'
365
408
  requirements: []
366
409
  rubyforge_project: caldersphere
367
- rubygems_version: 2.1.9
368
- signing_key:
369
- specification_version: 4
410
+ rubygems_version: 1.8.28
411
+ signing_key:
412
+ specification_version: 3
370
413
  summary: Warbler chirpily constructs .war files of your Rails applications.
371
414
  test_files:
372
- - integration/gem-initializer/pom.xml
415
+ - integration/Rakefile
373
416
  - integration/pom.xml
374
417
  - integration/rails4_test/pom.xml
375
418
  - integration/rails4_test/src/main/ruby/Gemfile
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: 4263713e65c4c0f07c101ab6e8859f9c2f153f55
4
- data.tar.gz: 8156a547e769eead7e69635950ad5066b671deec
5
- SHA512:
6
- metadata.gz: f39deef15841bb1ad34144a87f898f9180036b3f7bf9a13f95d17f3952ef71e22c69f9f9610befba1b0615e888a15318e978219ca481c434accd382ee0027bd6
7
- data.tar.gz: 014b087fd609ae7c54a321fb935aebeccec3a13bc6a72fb8ab05c2b5e7ce31691e81bb8248d3fca7fa33605661a1595f20d01a862da019f17a8da12511526acd
@@ -1,68 +0,0 @@
1
- <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3
- <modelVersion>4.0.0</modelVersion>
4
-
5
- <parent>
6
- <groupId>org.jruby.warbler</groupId>
7
- <artifactId>integration-tests</artifactId>
8
- <version>1.0-SNAPSHOT</version>
9
- </parent>
10
- <artifactId>gem-initializer</artifactId>
11
- <packaging>pom</packaging>
12
-
13
- <build>
14
- <plugins>
15
- <plugin>
16
- <groupId>de.saumya.mojo</groupId>
17
- <artifactId>jruby-maven-plugin</artifactId>
18
- <executions>
19
- <execution>
20
- <id>build-warbler</id>
21
- <inherited>true</inherited>
22
- <phase>compile</phase>
23
- <goals>
24
- <goal>jruby</goal>
25
- </goals>
26
- <configuration>
27
- <args>-C../../ -S gem build warbler.gemspec</args>
28
- </configuration>
29
- </execution>
30
- </executions>
31
- </plugin>
32
- <plugin>
33
- <groupId>de.saumya.mojo</groupId>
34
- <artifactId>jruby-maven-plugin</artifactId>
35
- <executions>
36
- <execution>
37
- <id>install-warbler</id>
38
- <inherited>true</inherited>
39
- <phase>compile</phase>
40
- <goals>
41
- <goal>jruby</goal>
42
- </goals>
43
- <configuration>
44
- <args>-S gem install ${basedir}/../../warbler-${warbler.version}.gem</args>
45
- </configuration>
46
- </execution>
47
- </executions>
48
- </plugin>
49
- <plugin>
50
- <groupId>de.saumya.mojo</groupId>
51
- <artifactId>jruby-maven-plugin</artifactId>
52
- <executions>
53
- <execution>
54
- <id>install-bundler</id>
55
- <inherited>true</inherited>
56
- <phase>compile</phase>
57
- <goals>
58
- <goal>jruby</goal>
59
- </goals>
60
- <configuration>
61
- <args>-S gem install bundler</args>
62
- </configuration>
63
- </execution>
64
- </executions>
65
- </plugin>
66
- </plugins>
67
- </build>
68
- </project>