rspec-openhab-scripting 0.0.1-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/lib/rspec/bundler/inline.rb +12 -0
- data/lib/rspec/openhab/api.rb +34 -0
- data/lib/rspec/openhab/core/cron_scheduler.rb +13 -0
- data/lib/rspec/openhab/core/load_path.rb +13 -0
- data/lib/rspec/openhab/core/logger.rb +24 -0
- data/lib/rspec/openhab/core/openhab_setup.rb +11 -0
- data/lib/rspec/openhab/core/osgi.rb +19 -0
- data/lib/rspec/openhab/core/script_handling.rb +21 -0
- data/lib/rspec/openhab/dsl/imports.rb +231 -0
- data/lib/rspec/openhab/dsl/timers/timer.rb +86 -0
- data/lib/rspec/openhab/version.rb +7 -0
- data/lib/rspec-openhab-scripting.rb +115 -0
- data/lib/rspec-openhab-scripting_jars.rb +14 -0
- data/vendor/gems/jar-dependencies-1.0.0/lib/jar-dependencies.rb +24 -0
- data/vendor/gems/jar-dependencies-1.0.0/lib/jar_dependencies.rb +397 -0
- data/vendor/gems/jar-dependencies-1.0.0/lib/jar_install_post_install_hook.rb +29 -0
- data/vendor/gems/jar-dependencies-1.0.0/lib/jars/attach_jars_pom.rb +35 -0
- data/vendor/gems/jar-dependencies-1.0.0/lib/jars/classpath.rb +92 -0
- data/vendor/gems/jar-dependencies-1.0.0/lib/jars/gemspec_artifacts.rb +220 -0
- data/vendor/gems/jar-dependencies-1.0.0/lib/jars/gemspec_pom.rb +11 -0
- data/vendor/gems/jar-dependencies-1.0.0/lib/jars/installer.rb +221 -0
- data/vendor/gems/jar-dependencies-1.0.0/lib/jars/lock.rb +75 -0
- data/vendor/gems/jar-dependencies-1.0.0/lib/jars/lock_down.rb +102 -0
- data/vendor/gems/jar-dependencies-1.0.0/lib/jars/lock_down_pom.rb +35 -0
- data/vendor/gems/jar-dependencies-1.0.0/lib/jars/maven_exec.rb +88 -0
- data/vendor/gems/jar-dependencies-1.0.0/lib/jars/maven_factory.rb +138 -0
- data/vendor/gems/jar-dependencies-1.0.0/lib/jars/maven_require.rb +48 -0
- data/vendor/gems/jar-dependencies-1.0.0/lib/jars/maven_settings.rb +124 -0
- data/vendor/gems/jar-dependencies-1.0.0/lib/jars/output_jars_pom.rb +16 -0
- data/vendor/gems/jar-dependencies-1.0.0/lib/jars/post_install_hook.rb +33 -0
- data/vendor/gems/jar-dependencies-1.0.0/lib/jars/setup.rb +9 -0
- data/vendor/gems/jar-dependencies-1.0.0/lib/jars/version.rb +7 -0
- data/vendor/gems/jar-dependencies-1.0.0/lib/rubygems_plugin.rb +24 -0
- metadata +217 -0
@@ -0,0 +1,88 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "jar_dependencies"
|
4
|
+
require "jars/maven_factory"
|
5
|
+
|
6
|
+
module Jars
|
7
|
+
class MavenExec
|
8
|
+
def find_spec(allow_no_file)
|
9
|
+
specs = Dir["*.gemspec"]
|
10
|
+
case specs.size
|
11
|
+
when 0
|
12
|
+
raise "no gemspec found" unless allow_no_file
|
13
|
+
when 1
|
14
|
+
specs.first
|
15
|
+
else
|
16
|
+
raise "more then one gemspec found. please specify a specfile" unless allow_no_file
|
17
|
+
end
|
18
|
+
end
|
19
|
+
private :find_spec
|
20
|
+
|
21
|
+
attr_reader :basedir, :spec, :specfile
|
22
|
+
|
23
|
+
def initialize(spec = nil)
|
24
|
+
@options = {}
|
25
|
+
setup(spec)
|
26
|
+
rescue StandardError, LoadError => e
|
27
|
+
# If spec load fails, skip looking for jar-dependencies
|
28
|
+
warn "jar-dependencies: #{e}"
|
29
|
+
warn e.backtrace.join("\n") if Jars.verbose?
|
30
|
+
end
|
31
|
+
|
32
|
+
def setup(spec = nil, allow_no_file: false)
|
33
|
+
spec ||= find_spec(allow_no_file)
|
34
|
+
|
35
|
+
case spec
|
36
|
+
when String
|
37
|
+
@specfile = File.expand_path(spec)
|
38
|
+
@basedir = File.dirname(@specfile)
|
39
|
+
Dir.chdir(@basedir) do
|
40
|
+
spec = eval(File.read(@specfile), TOPLEVEL_BINDING, @specfile) # rubocop:disable Security/Eval
|
41
|
+
end
|
42
|
+
when Gem::Specification
|
43
|
+
if File.exist?(spec.loaded_from)
|
44
|
+
@basedir = spec.gem_dir
|
45
|
+
@specfile = spec.loaded_from
|
46
|
+
else
|
47
|
+
# this happens with bundle and local gems
|
48
|
+
# there the spec_file is "not installed" but inside
|
49
|
+
# the gem_dir directory
|
50
|
+
Dir.chdir(spec.gem_dir) do
|
51
|
+
setup(nil, allow_no_file: true)
|
52
|
+
end
|
53
|
+
end
|
54
|
+
when MavenRequireDSL
|
55
|
+
@specfile = @basedir = Dir.pwd
|
56
|
+
when nil
|
57
|
+
# ignore
|
58
|
+
else
|
59
|
+
Jars.debug("spec must be either String or Gem::Specification. " \
|
60
|
+
"File an issue on github if you need it.")
|
61
|
+
end
|
62
|
+
@spec = spec
|
63
|
+
end
|
64
|
+
|
65
|
+
def ruby_maven_install_options=(options)
|
66
|
+
@options = options
|
67
|
+
end
|
68
|
+
|
69
|
+
def resolve_dependencies_list(file)
|
70
|
+
factory = MavenFactory.new(@options)
|
71
|
+
maven = factory.maven_new(File.expand_path("gemspec_pom.rb", __dir__))
|
72
|
+
|
73
|
+
is_local_file = File.expand_path(File.dirname(@specfile)) == File.expand_path(Dir.pwd)
|
74
|
+
maven.attach_repos
|
75
|
+
maven.attach_jars(@spec, all_dependencies: is_local_file)
|
76
|
+
|
77
|
+
maven["jars.specfile"] = @specfile.to_s
|
78
|
+
maven["outputAbsoluteArtifactFilename"] = "true"
|
79
|
+
maven["includeTypes"] = "jar"
|
80
|
+
maven["outputScope"] = "true"
|
81
|
+
maven["useRepositoryLayout"] = "true"
|
82
|
+
maven["outputDirectory"] = Jars.home.to_s
|
83
|
+
maven["outputFile"] = file.to_s
|
84
|
+
|
85
|
+
maven.exec("dependency:copy-dependencies", "dependency:list")
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
@@ -0,0 +1,138 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "jar_dependencies"
|
4
|
+
require "jars/gemspec_artifacts"
|
5
|
+
|
6
|
+
module Jars
|
7
|
+
class MavenFactory
|
8
|
+
module AttachJars
|
9
|
+
def attach_jars(spec, all_dependencies: false)
|
10
|
+
@index ||= 0
|
11
|
+
@done ||= []
|
12
|
+
|
13
|
+
deps = GemspecArtifacts.new(spec)
|
14
|
+
deps.artifacts.each do |a|
|
15
|
+
# for this gemspec we want to include all artifacts but
|
16
|
+
# for all others we want to exclude provided and test artifacts
|
17
|
+
next unless !@done.include?(a.key) && (all_dependencies || ((a.scope != "provided") && (a.scope != "test")))
|
18
|
+
|
19
|
+
# ruby dsl is not working reliably for classifier
|
20
|
+
self["jars.#{@index}"] = a.to_coord_no_classifier
|
21
|
+
if a.exclusions
|
22
|
+
jndex = 0
|
23
|
+
a.exclusions.each do |ex|
|
24
|
+
self["jars.#{@index}.exclusions.#{jndex}"] = ex.to_s
|
25
|
+
jndex += 1
|
26
|
+
end
|
27
|
+
end
|
28
|
+
self["jars.#{@index}.scope"] = a.scope if a.scope
|
29
|
+
self["jars.#{@index}.classifier"] = a.classifier if a.classifier
|
30
|
+
@index += 1
|
31
|
+
@done << a.key
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
def attach_repos
|
36
|
+
Jars.additional_maven_repos.each_with_index do |repo, index|
|
37
|
+
self["jars.repos.#{index}"] = repo
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
attr_reader :debug, :verbose
|
43
|
+
|
44
|
+
def initialize(options = nil, debug = Jars.debug?, verbose = Jars.verbose?)
|
45
|
+
@options = (options || {}).dup
|
46
|
+
@options.delete(:ignore_dependencies)
|
47
|
+
@debug = debug
|
48
|
+
@verbose = verbose
|
49
|
+
@installed_maven = false
|
50
|
+
end
|
51
|
+
|
52
|
+
def maven_new(pom)
|
53
|
+
lazy_load_maven
|
54
|
+
maven = setup(Maven::Ruby::Maven.new)
|
55
|
+
|
56
|
+
maven.extend AttachJars
|
57
|
+
# TODO: copy pom to tmp dir in case it is not a real file
|
58
|
+
maven.options["-f"] = pom
|
59
|
+
maven
|
60
|
+
end
|
61
|
+
|
62
|
+
private
|
63
|
+
|
64
|
+
def setup(maven)
|
65
|
+
maven.verbose = @verbose
|
66
|
+
maven.options["-X"] = nil if @debug
|
67
|
+
if @verbose
|
68
|
+
maven.options["-e"] = nil
|
69
|
+
elsif !@debug
|
70
|
+
maven.options["--quiet"] = nil
|
71
|
+
end
|
72
|
+
maven["verbose"] = (@debug || @verbose) == true
|
73
|
+
|
74
|
+
maven.options["-s"] = Jars::MavenSettings.effective_settings if Jars.maven_settings
|
75
|
+
|
76
|
+
maven["maven.repo.local"] = java.io.File.new(Jars.local_maven_repo).absolute_path.to_s
|
77
|
+
|
78
|
+
maven
|
79
|
+
end
|
80
|
+
|
81
|
+
def lazy_load_maven
|
82
|
+
add_gem_to_load_path("ruby-maven")
|
83
|
+
add_gem_to_load_path("ruby-maven-libs")
|
84
|
+
if @installed_maven
|
85
|
+
puts
|
86
|
+
puts "using maven for the first time results in maven"
|
87
|
+
puts "downloading all its default plugin and can take time."
|
88
|
+
puts "as those plugins get cached on disk and further execution"
|
89
|
+
puts "of maven is much faster then the first time."
|
90
|
+
puts
|
91
|
+
end
|
92
|
+
require "maven/ruby/maven"
|
93
|
+
end
|
94
|
+
|
95
|
+
def find_spec_via_rubygems(name, req)
|
96
|
+
require "rubygems/dependency"
|
97
|
+
dep = Gem::Dependency.new(name, req)
|
98
|
+
dep.matching_specs(true).last
|
99
|
+
end
|
100
|
+
|
101
|
+
def add_gem_to_load_path(name)
|
102
|
+
# if the gem is already activated => good
|
103
|
+
return if Gem.loaded_specs[name]
|
104
|
+
|
105
|
+
# just install gem if needed and add it to the load_path
|
106
|
+
# and leave activated gems as they are
|
107
|
+
req = requirement(name)
|
108
|
+
unless (spec = find_spec_via_rubygems(name, req))
|
109
|
+
spec = install_gem(name, req)
|
110
|
+
end
|
111
|
+
raise "failed to resolve gem '#{name}' if you're using Bundler add it as a dependency" unless spec
|
112
|
+
|
113
|
+
path = File.join(spec.full_gem_path, spec.require_path)
|
114
|
+
$LOAD_PATH << path unless $LOAD_PATH.include?(path)
|
115
|
+
end
|
116
|
+
|
117
|
+
def requirement(name)
|
118
|
+
jars = Gem.loaded_specs["jar-dependencies"]
|
119
|
+
dep = jars.nil? ? nil : jars.dependencies.detect { |d| d.name == name }
|
120
|
+
dep.nil? ? Gem::Requirement.create(">0") : dep.requirement
|
121
|
+
end
|
122
|
+
|
123
|
+
def install_gem(name, req)
|
124
|
+
@installed_maven = true
|
125
|
+
puts "Installing gem '#{name}' . . ."
|
126
|
+
require "rubygems/dependency_installer"
|
127
|
+
inst = Gem::DependencyInstaller.new(@options ||= {})
|
128
|
+
inst.install(name, req).first
|
129
|
+
rescue => e
|
130
|
+
if Jars.verbose?
|
131
|
+
warn e.inspect.to_s
|
132
|
+
warn e.backtrace.join("\n")
|
133
|
+
end
|
134
|
+
raise "there was an error installing '#{name} (#{req})' " \
|
135
|
+
"#{@options[:domain]}. please install it manually: #{e.inspect}"
|
136
|
+
end
|
137
|
+
end
|
138
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Jars
|
4
|
+
class MavenRequireDSL
|
5
|
+
attr_reader :requirements
|
6
|
+
|
7
|
+
def initialize
|
8
|
+
@requirements = []
|
9
|
+
end
|
10
|
+
|
11
|
+
def require(args)
|
12
|
+
@requirements << args
|
13
|
+
end
|
14
|
+
|
15
|
+
def resolve_dependencies_list(deps_lst)
|
16
|
+
mvn = Jars::MavenExec.new(self)
|
17
|
+
require "jars/maven_exec"
|
18
|
+
mvn.resolve_dependencies_list(deps_lst)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
def maven_require(&block)
|
24
|
+
require "jars/installer"
|
25
|
+
require "tempfile"
|
26
|
+
|
27
|
+
dsl = Jars::MavenRequireDSL.new
|
28
|
+
dsl.instance_eval(&block)
|
29
|
+
|
30
|
+
deps_lst = File.join(Dir.pwd, "deps.lst")
|
31
|
+
attempts = 1
|
32
|
+
|
33
|
+
dsl.resolve_dependencies_list(deps_lst) unless File.exist?(deps_lst)
|
34
|
+
begin
|
35
|
+
deps = Jars::Installer.load_from_maven(deps_lst)
|
36
|
+
|
37
|
+
deps.each do |dep|
|
38
|
+
require_jar(*dep.gav.split(":"))
|
39
|
+
end
|
40
|
+
rescue LoadError
|
41
|
+
raise unless attempts == 1
|
42
|
+
|
43
|
+
attempts += 1
|
44
|
+
|
45
|
+
File.unlink(deps_lst)
|
46
|
+
retry
|
47
|
+
end
|
48
|
+
end
|
@@ -0,0 +1,124 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "rubygems/uri_formatter"
|
4
|
+
module Jars
|
5
|
+
class MavenSettings
|
6
|
+
LINE_SEPARATOR = ENV_JAVA["line.separator"]
|
7
|
+
|
8
|
+
class << self
|
9
|
+
def local_settings
|
10
|
+
@_jars_maven_local_settings_ = nil unless instance_variable_defined?(:@_jars_maven_local_settings_)
|
11
|
+
if @_jars_maven_local_settings_.nil? && (settings = Jars.absolute("settings.xml")) && File.exist?(settings)
|
12
|
+
@_jars_maven_local_settings_ = settings
|
13
|
+
end
|
14
|
+
@_jars_maven_local_settings_ || nil
|
15
|
+
end
|
16
|
+
|
17
|
+
def user_settings
|
18
|
+
@_jars_maven_user_settings_ = nil unless instance_variable_defined?(:@_jars_maven_user_settings_)
|
19
|
+
if @_jars_maven_user_settings_.nil?
|
20
|
+
if (settings = Jars.absolute(Jars.to_prop(MAVEN_SETTINGS)))
|
21
|
+
unless File.exist?(settings)
|
22
|
+
Jars.warn { "configured ENV['#{MAVEN_SETTINGS}'] = '#{settings}' not found" }
|
23
|
+
settings = false
|
24
|
+
end
|
25
|
+
else # use maven default (user) settings
|
26
|
+
settings = File.join(Jars.user_home, ".m2", "settings.xml")
|
27
|
+
settings = false unless File.exist?(settings)
|
28
|
+
end
|
29
|
+
@_jars_maven_user_settings_ = settings
|
30
|
+
end
|
31
|
+
@_jars_maven_user_settings_ || nil
|
32
|
+
end
|
33
|
+
|
34
|
+
def effective_settings
|
35
|
+
@_jars_effective_maven_settings_ = nil unless instance_variable_defined?(:@_jars_effective_maven_settings_)
|
36
|
+
if @_jars_effective_maven_settings_.nil?
|
37
|
+
begin
|
38
|
+
require "rubygems/request"
|
39
|
+
|
40
|
+
http = Gem::Request.proxy_uri(Gem.configuration[:http_proxy] || Gem::Request.get_proxy_from_env("http"))
|
41
|
+
https = Gem::Request.proxy_uri(Gem.configuration[:https_proxy] || Gem::Request.get_proxy_from_env("https"))
|
42
|
+
rescue
|
43
|
+
Jars.debug("ignore rubygems proxy configuration as rubygems is too old")
|
44
|
+
end
|
45
|
+
@_jars_effective_maven_settings_ = if http.nil? && https.nil?
|
46
|
+
settings
|
47
|
+
else
|
48
|
+
setup_interpolated_settings(http, https) || settings
|
49
|
+
end
|
50
|
+
end
|
51
|
+
@_jars_effective_maven_settings_
|
52
|
+
end
|
53
|
+
|
54
|
+
def cleanup
|
55
|
+
File.unlink(effective_settings) if effective_settings != settings
|
56
|
+
ensure
|
57
|
+
reset
|
58
|
+
end
|
59
|
+
|
60
|
+
def reset
|
61
|
+
instance_variables.each { |var| instance_variable_set(var, nil) }
|
62
|
+
end
|
63
|
+
|
64
|
+
def settings
|
65
|
+
@_jars_maven_settings_ = nil unless instance_variable_defined?(:@_jars_maven_settings_)
|
66
|
+
local_settings || user_settings if @_jars_maven_settings_.nil?
|
67
|
+
end
|
68
|
+
|
69
|
+
def global_settings
|
70
|
+
@_jars_maven_global_settings_ = nil unless instance_variable_defined?(:@_jars_maven_global_settings_)
|
71
|
+
if @_jars_maven_global_settings_.nil?
|
72
|
+
if (mvn_home = ENV["M2_HOME"] || ENV["MAVEN_HOME"])
|
73
|
+
settings = File.join(mvn_home, "conf/settings.xml")
|
74
|
+
settings = false unless File.exist?(settings)
|
75
|
+
else
|
76
|
+
settings = false
|
77
|
+
end
|
78
|
+
@_jars_maven_global_settings_ = settings
|
79
|
+
end
|
80
|
+
@_jars_maven_global_settings_ || nil
|
81
|
+
end
|
82
|
+
|
83
|
+
private
|
84
|
+
|
85
|
+
def setup_interpolated_settings(http, https)
|
86
|
+
proxy = raw_proxy_settings_xml(http, https).gsub("\n", LINE_SEPARATOR)
|
87
|
+
if settings.nil?
|
88
|
+
raw = "<settings>#{LINE_SEPARATOR}#{proxy}</settings>"
|
89
|
+
else
|
90
|
+
raw = File.read(settings)
|
91
|
+
if raw.include?("<proxy>")
|
92
|
+
Jars.warn("can not interpolated proxy info for #{settings}")
|
93
|
+
return
|
94
|
+
else
|
95
|
+
raw.sub!("<settings>", "<settings>#{LINE_SEPARATOR}#{proxy}")
|
96
|
+
end
|
97
|
+
end
|
98
|
+
tempfile = java.io.File.create_temp_file("settings", ".xml")
|
99
|
+
tempfile.delete_on_exit
|
100
|
+
File.write(tempfile.path, raw)
|
101
|
+
tempfile.path
|
102
|
+
end
|
103
|
+
|
104
|
+
def raw_proxy_settings_xml(http, https)
|
105
|
+
raw = File.read(File.join(File.dirname(__FILE__), "settings.xml"))
|
106
|
+
if http
|
107
|
+
raw.sub!("__HTTP_ACTIVE__", "true")
|
108
|
+
raw.sub!("__HTTP_SERVER__", http.host)
|
109
|
+
raw.sub!("__HTTP_PORT__", http.port.to_s)
|
110
|
+
else
|
111
|
+
raw.sub!("__HTTP_ACTIVE__", "false")
|
112
|
+
end
|
113
|
+
if https
|
114
|
+
raw.sub!("__HTTPS_ACTIVE__", "true")
|
115
|
+
raw.sub!("__HTTPS_SERVER__", https.host)
|
116
|
+
raw.sub!("__HTTPS_PORT__", https.port.to_s)
|
117
|
+
else
|
118
|
+
raw.sub!("__HTTPS_ACTIVE__", "false")
|
119
|
+
end
|
120
|
+
raw
|
121
|
+
end
|
122
|
+
end
|
123
|
+
end
|
124
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# this file is maven DSL
|
4
|
+
|
5
|
+
if ENV_JAVA["jars.quiet"] != "true"
|
6
|
+
model.dependencies.each do |d|
|
7
|
+
puts " #{d.group_id}:#{d.artifact_id}" \
|
8
|
+
"#{d.classifier ? ":#{d.classifier}" : ""}" \
|
9
|
+
":#{d.version}:#{d.scope || "compile"}"
|
10
|
+
next if d.exclusions.empty?
|
11
|
+
|
12
|
+
puts " exclusions: #{d.exclusions.collect do |e|
|
13
|
+
"#{e.group_id}:#{e.artifact_id}"
|
14
|
+
end.join}"
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
#
|
4
|
+
# Copyright (C) 2014 Christian Meier
|
5
|
+
#
|
6
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy of
|
7
|
+
# this software and associated documentation files (the "Software"), to deal in
|
8
|
+
# the Software without restriction, including without limitation the rights to
|
9
|
+
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
10
|
+
# the Software, and to permit persons to whom the Software is furnished to do so,
|
11
|
+
# subject to the following conditions:
|
12
|
+
#
|
13
|
+
# The above copyright notice and this permission notice shall be included in all
|
14
|
+
# copies or substantial portions of the Software.
|
15
|
+
#
|
16
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
18
|
+
# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
19
|
+
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
20
|
+
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
21
|
+
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
22
|
+
#
|
23
|
+
|
24
|
+
module Jars
|
25
|
+
def self.post_install_hook(gem_installer)
|
26
|
+
unless (ENV["JARS_SKIP"] || ENV_JAVA["jars.skip"]) == "true"
|
27
|
+
require "jars/installer"
|
28
|
+
jars = Jars::Installer.new(gem_installer.spec)
|
29
|
+
jars.ruby_maven_install_options = gem_installer.options || {}
|
30
|
+
jars.vendor_jars
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
#
|
4
|
+
# Copyright (C) 2014 Christian Meier
|
5
|
+
#
|
6
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy of
|
7
|
+
# this software and associated documentation files (the "Software"), to deal in
|
8
|
+
# the Software without restriction, including without limitation the rights to
|
9
|
+
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
10
|
+
# the Software, and to permit persons to whom the Software is furnished to do so,
|
11
|
+
# subject to the following conditions:
|
12
|
+
#
|
13
|
+
# The above copyright notice and this permission notice shall be included in all
|
14
|
+
# copies or substantial portions of the Software.
|
15
|
+
#
|
16
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
18
|
+
# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
19
|
+
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
20
|
+
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
21
|
+
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
22
|
+
#
|
23
|
+
|
24
|
+
require "jar_install_post_install_hook"
|