jarbler 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +2 -1
- data/lib/jarbler/builder.rb +5 -0
- data/lib/jarbler/config.rb +6 -1
- data/lib/jarbler/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2c6eb4bd62cd4f241608b950e6cc12818efba108f75c79650a6ddcfa558315f6
|
4
|
+
data.tar.gz: 13574e8c87bcb8d8a3a3ed2a6263046559982d8de8572aaaa31a24ff81717c62
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e87be06e969d43ec0584c96708456404d54011362a681a7f99617f72c3a7108a8e203e7a26279e5106f0f535b75cde0a2f1e3df10874b354816d519893d37161
|
7
|
+
data.tar.gz: 2bffe72a8c78ba10605de7da93002f10eb08018ca17c88f932d1da49abefbfa6b68898f6d3ab22a338435dc57564118c1cf525272c45e277e099182952f0ceb9
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -58,7 +58,8 @@ The default configuration is focused on Ruby on Rails applications.<br>
|
|
58
58
|
| compile_ruby_files | false | Ahead of time compilation of all .rb files of application and Gem dependencies to .class files. Only store .class files in jar. Requires JRuby runtime. |
|
59
59
|
| executable | "bin/rails" | The ruby start file to run at execution of jar file. File extension .class is used automatically if start file is .rb and AOT compilation is used. |
|
60
60
|
| executable_params | ["server", "-e", "production", "-p", "8080"] | Command line parameters to be used for the ruby executable |
|
61
|
-
|
|
61
|
+
| excludes_from_compile | ["config"] | The files and dirs of the project to exclude from the compilation of .rb files |
|
62
|
+
| excludes | ["tmp/cache", "tmp/pids", ...] (see generated template file for whole content) | The files and dirs of the project to exclude from the include option |
|
62
63
|
| include_gems_to_compile | false | Should .rb files of the project gems also be compiled if compile_ruby_files = true |
|
63
64
|
| includes | ["app", "bin", "config", ...] (see generated template file for whole content) | The files and dirs of the project to include in the jar file |
|
64
65
|
| jar_name | < Name of project dir >.jar | The name of the generated jar file |
|
data/lib/jarbler/builder.rb
CHANGED
@@ -275,6 +275,11 @@ module Jarbler
|
|
275
275
|
ruby_files = ruby_files.select { |f| !(f =~ /\.#{File::SEPARATOR}gems#{File::SEPARATOR}/) } # Exclude ./gems/* directories from compiling
|
276
276
|
end
|
277
277
|
|
278
|
+
# Exclude named files or directories from compiling
|
279
|
+
config.excludes_from_compile.each do |exclude|
|
280
|
+
ruby_files = ruby_files.select { |f| !(f =~ /\.#{File::SEPARATOR}app_root#{File::SEPARATOR}#{exclude}/) }
|
281
|
+
end
|
282
|
+
|
278
283
|
ruby_files.each do |ruby_file|
|
279
284
|
debug "Compile Ruby file #{ruby_file}"
|
280
285
|
full_file_name = File.join(Dir.pwd, ruby_file) # full name including path is required by the JRuby compiler
|
data/lib/jarbler/config.rb
CHANGED
@@ -3,7 +3,7 @@ require 'json'
|
|
3
3
|
|
4
4
|
module Jarbler
|
5
5
|
class Config
|
6
|
-
attr_accessor :jar_name, :includes, :excludes, :jruby_version, :executable, :executable_params, :compile_ruby_files, :include_gems_to_compile
|
6
|
+
attr_accessor :jar_name, :includes, :excludes, :jruby_version, :executable, :executable_params, :compile_ruby_files, :include_gems_to_compile, :excludes_from_compile
|
7
7
|
|
8
8
|
CONFIG_FILE = 'config/jarble.rb'
|
9
9
|
# create instance of Config class with defaults or from config file
|
@@ -29,6 +29,7 @@ module Jarbler
|
|
29
29
|
def initialize
|
30
30
|
@compile_ruby_files = false
|
31
31
|
@excludes = %w(tmp/cache tmp/pids tmp/sockets vendor/bundle vendor/cache vendor/ruby)
|
32
|
+
@excludes_from_compile = %w(config)
|
32
33
|
@executable = 'bin/rails'
|
33
34
|
@executable_params = %w(server -e production -p 8080)
|
34
35
|
@include_gems_to_compile = false
|
@@ -72,6 +73,9 @@ module Jarbler
|
|
72
73
|
# Compile also the .rb files of the gems of the project to Java .class files?
|
73
74
|
# config.include_gems_to_compile = #{include_gems_to_compile}
|
74
75
|
|
76
|
+
# Directories or files to exclude from the compilation if compile_ruby_files = true
|
77
|
+
# config.excludes_from_compile = #{excludes_from_compile}
|
78
|
+
|
75
79
|
".split("\n"))
|
76
80
|
end
|
77
81
|
|
@@ -137,6 +141,7 @@ module Jarbler
|
|
137
141
|
raise "Invalid config value for compile_ruby_files: #{compile_ruby_files}" unless [true, false].include?(compile_ruby_files)
|
138
142
|
raise "compile_ruby_files = true is supported only with JRuby! Current runtime is '#{RUBY_ENGINE}'" if compile_ruby_files && (defined?(RUBY_ENGINE) && RUBY_ENGINE != 'jruby')
|
139
143
|
raise "include_gems_to_compile = true is supported only if compile_ruby_files = true!" if include_gems_to_compile && !compile_ruby_files
|
144
|
+
raise "Invalid config value for excludes_from_compile: #{excludes_from_compile}" unless excludes_from_compile.is_a?(Array)
|
140
145
|
end
|
141
146
|
end
|
142
147
|
end
|
data/lib/jarbler/version.rb
CHANGED