warbler 1.4.2 → 1.4.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: a4464dec04874d3dce2dd2ffd5b4c5ee82a0d475
4
+ data.tar.gz: cb9ea2082c156117e3990ac48012c9db695c379a
5
+ SHA512:
6
+ metadata.gz: 64e0e83ebff4d7b073f90009ce1c47627fbea84799919f7842ba03b1fe91dcd5d9d331506dc7bb0838dd0f09b39bac3bfec4868bec084730fc83e8befa88aca9
7
+ data.tar.gz: 784b4e947ec1c06ec230f15d5cc566d33dc964a99c417c5d417f5a43af5c0f97f753a55b3b0b8b3715ac5c0505ea43cb98cb6d31823a78068b6cc3b0f1b5046e
@@ -10,7 +10,7 @@ matrix:
10
10
  include:
11
11
  - rvm: jruby-head
12
12
  env: JRUBY_OPTS="--server -Xcext.enabled=false -Xcompile.invokedynamic=false"
13
- - rvm: jruby-1.7.9
13
+ - rvm: jruby-1.7.12
14
14
  env: JRUBY_OPTS="--server -Xcext.enabled=false -Xcompile.invokedynamic=false"
15
15
  - rvm: 1.8.7
16
16
  env: ''
data/Gemfile CHANGED
@@ -6,6 +6,7 @@ group :development do
6
6
  gem "jruby-openssl", :platform => :jruby
7
7
  gem "rcov", ">= 0.9.8", :platform => :mri_18
8
8
  gem "childprocess", :platform => :mri
9
+ gem "maven-tools", "~> 0.34.5"
9
10
  end
10
11
 
11
12
  if RUBY_VERSION < "1.9"
@@ -1,3 +1,11 @@
1
+ == 1.4.3
2
+ - Fixed a bug w/ symlinks that was introduced around jruby-1.7.10
3
+ - #258: Bytecode version option for compiled class files
4
+ - #259: Update README.rdoc to not require warbler in Gemfile
5
+ - #260: Can't convert TrueClass into String
6
+ - #167: Excluding rb and class files when using compiled flag
7
+ - #254: Fixes #167 by excluding config.excludes from compiled files
8
+
1
9
  == 1.4.2
2
10
  - #241: jars from jruby.jar itself do not get copied over to WEB-INF/lib
3
11
  - #199: javascript_include_tag and stylesheet_link_tag not generating digestions
@@ -226,7 +226,7 @@ simply add the following code somewhere in the +Rakefile+ :
226
226
  If you're using Bundler, you'll want to add Warbler to your +Gemfile+ :
227
227
 
228
228
  group :development do
229
- gem "warbler"
229
+ gem "warbler", :require => false
230
230
  end
231
231
 
232
232
  Now you should be able to invoke <tt>rake war</tt> to create your war file.
@@ -18,9 +18,9 @@
18
18
  <properties>
19
19
  <version.jruby-maven-plugins>1.0.0-rc</version.jruby-maven-plugins>
20
20
  <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
21
- <jruby.version>1.7.9</jruby.version>
21
+ <jruby.version>1.7.12</jruby.version>
22
22
  <!-- prereleased gems ARE snapshots -->
23
- <warbler.version>1.4.1.dev-SNAPSHOT</warbler.version>
23
+ <warbler.version>1.4.3-SNAPSHOT</warbler.version>
24
24
  <gem.home>${session.executionRootDirectory}/target/rubygems</gem.home>
25
25
  <gem.path>${session.executionRootDirectory}/target/rubygems</gem.path>
26
26
  </properties>
@@ -130,6 +130,10 @@ module Warbler
130
130
  # Defaults to true
131
131
  attr_accessor :override_gem_home
132
132
 
133
+ # Explicit bytecode version for compiled ruby files. If given bytecode version is
134
+ # specified when ruby files are compiled using jrubyc
135
+ attr_accessor :bytecode_version
136
+
133
137
  # Extra configuration for web.xml. Controls how the dynamically-generated web.xml
134
138
  # file is generated.
135
139
  #
@@ -40,8 +40,9 @@ module Warbler
40
40
  # option to configure what gets compiled?
41
41
  return if config.compiled_ruby_files.nil? || config.compiled_ruby_files.empty?
42
42
 
43
- run_javac(config, config.compiled_ruby_files)
44
- replace_compiled_ruby_files(config, config.compiled_ruby_files)
43
+ compiled_ruby_files = config.compiled_ruby_files - config.excludes.to_a
44
+ run_javac(config, compiled_ruby_files)
45
+ replace_compiled_ruby_files(config, compiled_ruby_files)
45
46
  end
46
47
 
47
48
  def run_javac(config, compiled_ruby_files)
@@ -51,7 +52,7 @@ module Warbler
51
52
  compat_version = ''
52
53
  end
53
54
  # Need to use the version of JRuby in the application to compile it
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
+ javac_cmd = %Q{java -classpath #{config.java_libs.join(File::PATH_SEPARATOR)} #{java_version(config)} org.jruby.Main #{compat_version} -S jrubyc \"#{compiled_ruby_files.join('" "')}\"}
55
56
  if which('env')
56
57
  system %Q{env -i #{javac_cmd}}
57
58
  else
@@ -59,6 +60,10 @@ module Warbler
59
60
  end
60
61
  raise "Compile failed" if $?.exitstatus > 0
61
62
  end
63
+
64
+ def java_version(config)
65
+ config.bytecode_version ? "-Djava.specification.version=#{config.bytecode_version}" : ''
66
+ end
62
67
 
63
68
  def replace_compiled_ruby_files(config, compiled_ruby_files)
64
69
  # Exclude the rb files and recreate them. This
@@ -155,7 +160,7 @@ module Warbler
155
160
  end.each do |d|
156
161
  @files[apply_pathmaps(config, d, :application)] = nil
157
162
  end
158
- @app_filelist = FileList[*(config.dirs.map{|d| "#{d}/**/*"})]
163
+ @app_filelist = FileList[*(config.dirs.map{|d| %W{#{d}/**/*/**/* #{d}/*}}.flatten)]
159
164
  @app_filelist.include *(config.includes.to_a)
160
165
  @app_filelist.exclude *(config.excludes.to_a)
161
166
  @app_filelist.map {|f| add_with_pathmaps(config, f, :application) }
@@ -1,2 +1,2 @@
1
1
  # the jars are already loaded via the servlet classloader
2
- ENV['JBUNDLE_SKIP'] = true
2
+ ENV['JBUNDLE_SKIP'] = 'true'
@@ -6,5 +6,5 @@
6
6
  #++
7
7
 
8
8
  module Warbler
9
- VERSION = "1.4.2"
9
+ VERSION = "1.4.3"
10
10
  end
Binary file
data/pom.xml CHANGED
@@ -4,7 +4,7 @@
4
4
  <modelVersion>4.0.0</modelVersion>
5
5
  <groupId>rubygems</groupId>
6
6
  <artifactId>warbler</artifactId>
7
- <version>1.4.1.dev-SNAPSHOT</version>
7
+ <version>1.4.3-SNAPSHOT</version>
8
8
  <packaging>gem</packaging>
9
9
  <name>Warbler chirpily constructs .war files of your Rails applications.</name>
10
10
  <description>Warbler is a gem to make a Java jar or war file out of any Ruby,
@@ -167,6 +167,15 @@ describe Warbler::Jar do
167
167
  file_list(%r{^sample_jar/lib$}).should be_empty
168
168
  file_list(%r{^sample_jar/bin$}).should_not be_empty
169
169
  end
170
+
171
+ it "excludes .rb and .class files from compile" do
172
+ config.compiled_ruby_files = %w(lib/sample_jar.rb)
173
+ config.excludes += FileList["lib/sample_jar.*"]
174
+ jar.compile(config)
175
+ jar.apply(config)
176
+ file_list(%r{^sample_jar/lib/sample_jar\.class$}).should be_empty
177
+ jar.contents('sample_jar/lib/sample_jar.rb').should_not =~ /load __FILE__\.sub/
178
+ end
170
179
  end
171
180
 
172
181
  context "with a gemspec without a default executable" do
@@ -54,7 +54,7 @@ describe Warbler::Jar, "with JBundler" do
54
54
  it "adds JBUNDLE_SKIP to init.rb" do
55
55
  jar.add_init_file(config)
56
56
  contents = jar.contents('META-INF/init.rb')
57
- contents.should =~ /ENV\['JBUNDLE_SKIP'\]/
57
+ contents.should =~ /ENV\['JBUNDLE_SKIP'\] = 'true'/
58
58
  end
59
59
 
60
60
  it "uses ENV['JBUNDLE_JARFILE'] if set" do
@@ -125,6 +125,25 @@ describe Warbler::Task do
125
125
  end
126
126
  end
127
127
 
128
+ it "should allow bytecode version in config" do
129
+ config.features << "compiled"
130
+ config.bytecode_version = '1.6'
131
+ silence { run_task "warble" }
132
+
133
+ java_class_magic_number = [0xCA,0xFE,0xBA,0xBE].map { |magic_char| magic_char.chr }.join
134
+ # 0x32 is version 50, i.e. Java6
135
+ java6_version_bytes = [0x00,0x32].map { |magic_char| magic_char.chr }.join
136
+
137
+ Warbler::ZipSupport.open("#{config.jar_name}.war") do |zf|
138
+ class_file_bytes = zf.get_input_stream('WEB-INF/lib/ruby_one_nine.class') {|io| io.read }
139
+ java_class_header = class_file_bytes[0..3]
140
+ bytecode_version = class_file_bytes[6..7]
141
+
142
+ java_class_header.should == java_class_magic_number
143
+ bytecode_version.should == java6_version_bytes
144
+ end
145
+ end
146
+
128
147
  it "should delete .class files after finishing the jar" do
129
148
  config.features << "compiled"
130
149
  silence { run_task "warble" }
data/warble.rb CHANGED
@@ -88,6 +88,9 @@ Warbler::Config.new do |config|
88
88
  # files will be compiled. Default is to compile all \.rb files in
89
89
  # the application.
90
90
  # config.compiled_ruby_files = FileList['app/**/*.rb']
91
+
92
+ # When set it specify the bytecode version for compiled class files
93
+ # config.bytecode_version = "1.6"
91
94
 
92
95
  # When set to true, Warbler will override the value of ENV['GEM_HOME'] even it
93
96
  # has already been set. When set to false it will use any existing value of
metadata CHANGED
@@ -1,163 +1,144 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: warbler
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.2
5
- prerelease:
4
+ version: 1.4.3
6
5
  platform: ruby
7
6
  authors:
8
7
  - Nick Sieger
9
- autorequire:
8
+ autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2014-03-08 00:00:00.000000000 Z
11
+ date: 2014-05-24 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: rake
16
- requirement: !ruby/object:Gem::Requirement
17
- none: false
15
+ version_requirements: !ruby/object:Gem::Requirement
18
16
  requirements:
19
- - - ! '>='
17
+ - - '>='
20
18
  - !ruby/object:Gem::Version
21
19
  version: 0.9.6
22
- type: :runtime
23
- prerelease: false
24
- version_requirements: !ruby/object:Gem::Requirement
25
- none: false
20
+ requirement: !ruby/object:Gem::Requirement
26
21
  requirements:
27
- - - ! '>='
22
+ - - '>='
28
23
  - !ruby/object:Gem::Version
29
24
  version: 0.9.6
25
+ prerelease: false
26
+ type: :runtime
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: jruby-jars
32
- requirement: !ruby/object:Gem::Requirement
33
- none: false
29
+ version_requirements: !ruby/object:Gem::Requirement
34
30
  requirements:
35
- - - ! '>='
31
+ - - '>='
36
32
  - !ruby/object:Gem::Version
37
33
  version: 1.5.6
38
34
  - - <
39
35
  - !ruby/object:Gem::Version
40
36
  version: '2.0'
41
- type: :runtime
42
- prerelease: false
43
- version_requirements: !ruby/object:Gem::Requirement
44
- none: false
37
+ requirement: !ruby/object:Gem::Requirement
45
38
  requirements:
46
- - - ! '>='
39
+ - - '>='
47
40
  - !ruby/object:Gem::Version
48
41
  version: 1.5.6
49
42
  - - <
50
43
  - !ruby/object:Gem::Version
51
44
  version: '2.0'
45
+ prerelease: false
46
+ type: :runtime
52
47
  - !ruby/object:Gem::Dependency
53
48
  name: jruby-rack
54
- requirement: !ruby/object:Gem::Requirement
55
- none: false
49
+ version_requirements: !ruby/object:Gem::Requirement
56
50
  requirements:
57
- - - ! '>='
51
+ - - '>='
58
52
  - !ruby/object:Gem::Version
59
53
  version: 1.0.0
60
- type: :runtime
61
- prerelease: false
62
- version_requirements: !ruby/object:Gem::Requirement
63
- none: false
54
+ requirement: !ruby/object:Gem::Requirement
64
55
  requirements:
65
- - - ! '>='
56
+ - - '>='
66
57
  - !ruby/object:Gem::Version
67
58
  version: 1.0.0
59
+ prerelease: false
60
+ type: :runtime
68
61
  - !ruby/object:Gem::Dependency
69
62
  name: rubyzip
70
- requirement: !ruby/object:Gem::Requirement
71
- none: false
63
+ version_requirements: !ruby/object:Gem::Requirement
72
64
  requirements:
73
- - - ! '>='
65
+ - - '>='
74
66
  - !ruby/object:Gem::Version
75
67
  version: '0.9'
76
68
  - - <
77
69
  - !ruby/object:Gem::Version
78
70
  version: '1.1'
79
- type: :runtime
80
- prerelease: false
81
- version_requirements: !ruby/object:Gem::Requirement
82
- none: false
71
+ requirement: !ruby/object:Gem::Requirement
83
72
  requirements:
84
- - - ! '>='
73
+ - - '>='
85
74
  - !ruby/object:Gem::Version
86
75
  version: '0.9'
87
76
  - - <
88
77
  - !ruby/object:Gem::Version
89
78
  version: '1.1'
79
+ prerelease: false
80
+ type: :runtime
90
81
  - !ruby/object:Gem::Dependency
91
82
  name: jbundler
92
- requirement: !ruby/object:Gem::Requirement
93
- none: false
83
+ version_requirements: !ruby/object:Gem::Requirement
94
84
  requirements:
95
85
  - - ~>
96
86
  - !ruby/object:Gem::Version
97
87
  version: 0.5.5
98
- type: :development
99
- prerelease: false
100
- version_requirements: !ruby/object:Gem::Requirement
101
- none: false
88
+ requirement: !ruby/object:Gem::Requirement
102
89
  requirements:
103
90
  - - ~>
104
91
  - !ruby/object:Gem::Version
105
92
  version: 0.5.5
93
+ prerelease: false
94
+ type: :development
106
95
  - !ruby/object:Gem::Dependency
107
96
  name: ruby-maven
108
- requirement: !ruby/object:Gem::Requirement
109
- none: false
97
+ version_requirements: !ruby/object:Gem::Requirement
110
98
  requirements:
111
99
  - - ~>
112
100
  - !ruby/object:Gem::Version
113
101
  version: 3.1.1.0
114
- type: :development
115
- prerelease: false
116
- version_requirements: !ruby/object:Gem::Requirement
117
- none: false
102
+ requirement: !ruby/object:Gem::Requirement
118
103
  requirements:
119
104
  - - ~>
120
105
  - !ruby/object:Gem::Version
121
106
  version: 3.1.1.0
107
+ prerelease: false
108
+ type: :development
122
109
  - !ruby/object:Gem::Dependency
123
110
  name: rspec
124
- requirement: !ruby/object:Gem::Requirement
125
- none: false
111
+ version_requirements: !ruby/object:Gem::Requirement
126
112
  requirements:
127
113
  - - ~>
128
114
  - !ruby/object:Gem::Version
129
115
  version: '2.10'
130
- type: :development
131
- prerelease: false
132
- version_requirements: !ruby/object:Gem::Requirement
133
- none: false
116
+ requirement: !ruby/object:Gem::Requirement
134
117
  requirements:
135
118
  - - ~>
136
119
  - !ruby/object:Gem::Version
137
120
  version: '2.10'
121
+ prerelease: false
122
+ type: :development
138
123
  - !ruby/object:Gem::Dependency
139
124
  name: rdoc
140
- requirement: !ruby/object:Gem::Requirement
141
- none: false
125
+ version_requirements: !ruby/object:Gem::Requirement
142
126
  requirements:
143
- - - ! '>='
127
+ - - '>='
144
128
  - !ruby/object:Gem::Version
145
129
  version: 2.4.2
146
- type: :development
147
- prerelease: false
148
- version_requirements: !ruby/object:Gem::Requirement
149
- none: false
130
+ requirement: !ruby/object:Gem::Requirement
150
131
  requirements:
151
- - - ! '>='
132
+ - - '>='
152
133
  - !ruby/object:Gem::Version
153
134
  version: 2.4.2
154
- description: ! 'Warbler is a gem to make a Java jar or war file out of any Ruby,
155
-
135
+ prerelease: false
136
+ type: :development
137
+ description: |-
138
+ Warbler is a gem to make a Java jar or war file out of any Ruby,
156
139
  Rails, Merb, or Rack application. Warbler provides a minimal,
157
-
158
140
  flexible, Ruby-like way to bundle up all of your application files for
159
-
160
- deployment to a Java environment.'
141
+ deployment to a Java environment.
161
142
  email: nick@nicksieger.com
162
143
  executables:
163
144
  - warble
@@ -384,7 +365,8 @@ files:
384
365
  homepage: http://caldersphere.rubyforge.org/warbler
385
366
  licenses:
386
367
  - MIT
387
- post_install_message:
368
+ metadata: {}
369
+ post_install_message:
388
370
  rdoc_options:
389
371
  - --main
390
372
  - README.rdoc
@@ -394,22 +376,20 @@ rdoc_options:
394
376
  require_paths:
395
377
  - lib
396
378
  required_ruby_version: !ruby/object:Gem::Requirement
397
- none: false
398
379
  requirements:
399
- - - ! '>='
380
+ - - '>='
400
381
  - !ruby/object:Gem::Version
401
382
  version: '0'
402
383
  required_rubygems_version: !ruby/object:Gem::Requirement
403
- none: false
404
384
  requirements:
405
- - - ! '>='
385
+ - - '>='
406
386
  - !ruby/object:Gem::Version
407
387
  version: '0'
408
388
  requirements: []
409
389
  rubyforge_project: caldersphere
410
- rubygems_version: 1.8.28
411
- signing_key:
412
- specification_version: 3
390
+ rubygems_version: 2.2.2
391
+ signing_key:
392
+ specification_version: 4
413
393
  summary: Warbler chirpily constructs .war files of your Rails applications.
414
394
  test_files:
415
395
  - integration/Rakefile