licensed 4.0.0 → 4.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4c0f6c78059b52e669e7febd8a0a146c7d2bc1d2ff9c7a4e962941470a13845c
4
- data.tar.gz: 14c6ff763c08e1317b430704fe8ec4552373f9ab24df80838f114fdb4d1fe906
3
+ metadata.gz: 3746e4cddde0edf382e8821057edf8e850e1c3e7f919ae7ffe8c0a0d2e9673b6
4
+ data.tar.gz: 3bfd9b9455a01be274fec72b4594679845c0e43ea2296690b816edc602e92978
5
5
  SHA512:
6
- metadata.gz: 7c7af4fe377c93becf816adab3b549452dba206aaf03080f18c42f944991f3572e4822ba768c6cc0ef1f320a81b9643738313097637f6da548b5285180a89ae2
7
- data.tar.gz: be4466294a92d6cdb807fb6ace47b2ff0231430b118e60c7059dbfed92379a4e827e75f9df276e916c034f8f9a7226a95ef621239f1dbd0baecb942a30427a1a
6
+ metadata.gz: 3cefdf63dab57c1710903687b8eb4afb8538a8e95f2c7a911d156f44ad221bc47fb127519a72bd76d833f13bbd803c9b77b253b8012964fcd9316e3a73fc1adf
7
+ data.tar.gz: 7af786369bda501fd1196dadf82427d0ba83cb37491aa231ed3b3717b9df30849af017ff0e0450eaeb5f4d24933a1ae1f3d4757821d73e6c6d757289f5555c51
data/CHANGELOG.md CHANGED
@@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## 4.0.1
10
+
11
+ ### Fixed
12
+
13
+ - Running gradle tests will no longer fail when gradle is not available (https://github.com/github/licensed/pull/606)
14
+
9
15
  ## 4.0.0
10
16
 
11
17
  ### Added
@@ -677,4 +683,4 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
677
683
 
678
684
  Initial release :tada:
679
685
 
680
- [Unreleased]: https://github.com/github/licensed/compare/4.0.0...HEAD
686
+ [Unreleased]: https://github.com/github/licensed/compare/4.0.1...HEAD
@@ -42,7 +42,7 @@ module Licensed
42
42
  end
43
43
 
44
44
  def enabled?
45
- gradle_runner.enabled? && File.exist?(config.pwd.join("build.gradle"))
45
+ !executable.to_s.empty? && File.exist?(config.pwd.join("build.gradle"))
46
46
  end
47
47
 
48
48
  def enumerate_dependencies
@@ -62,8 +62,19 @@ module Licensed
62
62
 
63
63
  private
64
64
 
65
+ def executable
66
+ return @executable if defined?(@executable)
67
+
68
+ @executable = begin
69
+ gradlew = File.join(config.pwd, "gradlew")
70
+ return gradlew if File.executable?(gradlew)
71
+
72
+ "gradle" if Licensed::Shell.tool_available?("gradle")
73
+ end
74
+ end
75
+
65
76
  def gradle_runner
66
- @gradle_runner ||= Runner.new(config.pwd, configurations)
77
+ @gradle_runner ||= Runner.new(config.pwd, configurations, executable)
67
78
  end
68
79
 
69
80
  # Returns the configurations to include in license generation.
@@ -116,8 +127,9 @@ module Licensed
116
127
  # The Gradle::Runner class is a wrapper which provides
117
128
  # an interface to run gradle commands with the init script initialized
118
129
  class Runner
119
- def initialize(root_path, configurations)
130
+ def initialize(root_path, configurations, executable)
120
131
  @root_path = root_path
132
+ @executable = executable
121
133
  @init_script = create_init_script(root_path, configurations)
122
134
  end
123
135
 
@@ -126,28 +138,13 @@ module Licensed
126
138
  # The configuration cache is an incubating feature that can be activated manually.
127
139
  # The gradle plugin for licenses does not support it so we prevent it to run for gradle version supporting it.
128
140
  args << "--no-configuration-cache" if gradle_version >= "6.6"
129
- Licensed::Shell.execute(executable, "-q", "--init-script", @init_script.path, *args)
130
- end
131
-
132
- def enabled?
133
- !executable.to_s.empty?
141
+ Licensed::Shell.execute(@executable, "-q", "--init-script", @init_script.path, *args)
134
142
  end
135
143
 
136
144
  private
137
145
 
138
146
  def gradle_version
139
- @gradle_version ||= Licensed::Shell.execute(executable, "--version").scan(/Gradle [\d+]\.[\d+]/).last.split(" ").last
140
- end
141
-
142
- def executable
143
- return @executable if defined?(@executable)
144
-
145
- @executable = begin
146
- gradlew = File.join(@root_path, "gradlew")
147
- return gradlew if File.executable?(gradlew)
148
-
149
- "gradle" if Licensed::Shell.tool_available?("gradle")
150
- end
147
+ @gradle_version ||= Licensed::Shell.execute(@executable, "--version").scan(/Gradle [\d+]\.[\d+]/).last.split(" ").last
151
148
  end
152
149
 
153
150
  def create_init_script(path, configurations)
@@ -202,7 +199,7 @@ module Licensed
202
199
  # Prefixes the gradle command with the project name for multi-build projects.
203
200
  def format_command(command, source_path)
204
201
  Dir.chdir(source_path) do
205
- path = Licensed::Shell.execute(executable, "properties", "-Dorg.gradle.logging.level=quiet").scan(/path:.*/).last.split(" ").last
202
+ path = Licensed::Shell.execute(@executable, "properties", "-Dorg.gradle.logging.level=quiet").scan(/path:.*/).last.split(" ").last
206
203
  path == ":" ? command : "#{path}:#{command}"
207
204
  end
208
205
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  module Licensed
3
- VERSION = "4.0.0".freeze
3
+ VERSION = "4.0.1".freeze
4
4
 
5
5
  def self.previous_major_versions
6
6
  major_version = Gem::Version.new(Licensed::VERSION).segments.first
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: licensed
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0
4
+ version: 4.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - GitHub
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-01-05 00:00:00.000000000 Z
11
+ date: 2023-01-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: licensee