File tree Expand file tree Collapse file tree 4 files changed +23
-34
lines changed Expand file tree Collapse file tree 4 files changed +23
-34
lines changed Original file line number Diff line number Diff line change 12
12
homepage "https://www.graalvm.org/"
13
13
14
14
livecheck do
15
- url "https://www.oracle.com/java/technologies/downloads/"
16
- regex ( %r{/otn_software/java/jdk/(\d +(?:\. \d +)*)\+ (\d +)/}i )
17
- strategy :page_match do |page , regex |
18
- major = page . scan ( %r{href=.*?/technologies/javase-jdk(\d +)-doc-downloads\. html}i )
19
- . max_by { |match | Version . new ( match [ 0 ] ) }
20
- &.first
21
- next if major . blank?
22
-
23
- download_page = Homebrew ::Livecheck ::Strategy . page_content (
24
- "https://www.oracle.com/java/technologies/javase-jdk#{ major } -doc-downloads.html" ,
25
- )
26
- next if ( download_page_content = download_page [ :content ] ) . blank?
27
-
28
- download_page_content . scan ( regex ) . map { |match | "#{ match [ 0 ] } ,#{ match [ 1 ] } " }
15
+ url "https://java.oraclecloud.com/currentJavaReleases"
16
+ regex ( /(?:jdk[._-])?(\d +(?:\. \d +)*)(?:-\d +)?\+ (\d +)/i )
17
+ strategy :json do |json , regex |
18
+ json [ "items" ] &.map do |item |
19
+ match = item [ "releaseFullVersion" ] &.match ( regex )
20
+ next if match . blank?
21
+
22
+ "#{ match [ 1 ] } ,#{ match [ 2 ] } "
23
+ end
29
24
end
30
25
end
31
26
Original file line number Diff line number Diff line change 12
12
homepage "https://www.graalvm.org/"
13
13
14
14
livecheck do
15
- url "https://docs.oracle.com/en/graalvm/jdk/21/docs/release-notes/"
16
- regex ( /<strong>v?(\d +(?:\. \d +)+)\+ (\d +)[ "<]/i )
17
- strategy :page_match do |page , regex |
18
- page . scan ( regex ) . map { |match | "#{ match [ 0 ] } ,#{ match [ 1 ] } " }
15
+ url "https://java.oraclecloud.com/currentJavaReleases/#{ version . major } "
16
+ regex ( /(?:jdk[._-])?(\d +(?:\. \d +)*)(?:-\d +)?\+ (\d +)/i )
17
+ strategy :json do |json , regex |
18
+ match = json [ "releaseFullVersion" ] &.match ( regex )
19
+ next if match . blank?
20
+
21
+ "#{ match [ 1 ] } ,#{ match [ 2 ] } "
19
22
end
20
23
end
21
24
Original file line number Diff line number Diff line change 11
11
homepage "https://www.oracle.com/java/technologies/downloads/"
12
12
13
13
livecheck do
14
- url :homepage
15
- regex ( /<li>\s *JDK\s *v?(\d +(?:\. \d +)*)/i )
16
- strategy :page_match do |page , regex |
17
- major = page . scan ( %r{href=.*?/javase/(\d +)u-relnotes\. html}i )
18
- . max_by { |match | Version . new ( match [ 0 ] ) }
19
- &.first
20
- next if major . blank?
21
-
22
- release_page = Homebrew ::Livecheck ::Strategy . page_content (
23
- "https://www.oracle.com/java/technologies/javase/#{ major } u-relnotes.html" ,
24
- )
25
- next if ( release_page_content = release_page [ :content ] ) . blank?
26
-
27
- release_page_content . scan ( regex ) . map { |match | match [ 0 ] }
14
+ url "https://java.oraclecloud.com/currentJavaReleases"
15
+ strategy :json do |json |
16
+ json [ "items" ] &.filter_map { |item | item [ "releaseVersion" ] }
28
17
end
29
18
end
30
19
Original file line number Diff line number Diff line change 11
11
homepage "https://www.oracle.com/java/technologies/downloads/"
12
12
13
13
livecheck do
14
- url "https://www.oracle.com/java/technologies/javase/#{ version . major } u-relnotes.html"
15
- regex ( /<li>\s *JDK\s *v?(\d +(?:\. \d +)*)/i )
14
+ url "https://java.oraclecloud.com/currentJavaReleases/#{ version . major } "
15
+ strategy :json do |json |
16
+ json [ "releaseVersion" ]
17
+ end
16
18
end
17
19
18
20
depends_on macos : ">= :mojave"
You can’t perform that action at this time.
0 commit comments