-
Notifications
You must be signed in to change notification settings - Fork 382
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #702 from chocolatey/ruby
(ruby) migrated from ferventcoder
- Loading branch information
Showing
7 changed files
with
1,262 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# <img src="" width="48" height="48"/> [](https://chocolatey.org/packages/ruby) | ||
|
||
Ruby is a dynamic, open source programming language with a focus on simplicity and productivity. It has an elegant syntax that is natural to read and easy to write. | ||
|
||
This package provides a self-contained [Windows-based installer](https://rubyinstaller.org) that includes the Ruby language, an execution environment, important documentation, and more. | ||
|
||
## Package Parameters | ||
|
||
- `/InstallDir` - Ruby installation directory, by default `c:\tools\RubyXY` where XY are major and minor version parts. | ||
- `/NoPath` - Do not add ruby bin folder to machine PATH. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
Copyright (c) 2007-2014, RubyInstaller Team | ||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are met: | ||
|
||
* Redistributions of source code must retain the above copyright | ||
notice, this list of conditions and the following disclaimer. | ||
* Redistributions in binary form must reproduce the above copyright | ||
notice, this list of conditions and the following disclaimer in the | ||
documentation and/or other materials provided with the distribution. | ||
* Neither the name of the RubyInstaller Team nor the names of its | ||
contributors may be used to endorse or promote products derived | ||
from this software without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
DISCLAIMED. IN NO EVENT SHALL THE RUBYINSTALLER TEAM BE LIABLE FOR ANY | ||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
VERIFICATION | ||
|
||
Verification is intended to assist the Chocolatey moderators and community | ||
in verifying that this package's contents are trustworthy. | ||
|
||
Package can be verified like this: | ||
|
||
1. Go to | ||
|
||
x32: https://dl.bintray.com/oneclick/rubyinstaller/rubyinstaller-2.3.3.exe | ||
x64: https://dl.bintray.com/oneclick/rubyinstaller/rubyinstaller-2.3.3-x64.exe | ||
|
||
to download the installer. | ||
|
||
2. You can use one of the following methods to obtain the SHA256 checksum: | ||
- Use powershell function 'Get-FileHash' | ||
- Use Chocolatey utility 'checksum.exe' | ||
|
||
checksum32: 43110F9BCD8A067D69409507CAD6A43F1FCF05E8BD64D096DD9DF47475DE50F3 | ||
checksum64: 3D0A4AD06C5503E1CB88827443593969E689AC96B5161140B08F0BECB7B792CF | ||
|
||
Using AU: | ||
|
||
Get-RemoteChecksum https://dl.bintray.com/oneclick/rubyinstaller/rubyinstaller-2.3.3-x64.exe | ||
|
||
File 'license.txt' is obtained from: | ||
https://raw.githubusercontent.com/oneclick/rubyinstaller/master/LICENSE.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- Do not remove this test for UTF-8: if “Ω” doesn’t appear as greek uppercase omega letter enclosed in quotation marks, you should use an editor that supports UTF-8, not this one. --> | ||
<package xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> | ||
<metadata> | ||
<id>ruby</id> | ||
<version>0.0</version> | ||
<title>Ruby</title> | ||
<authors>Yukihiro Matsumoto</authors> | ||
<owners>chocolatey, Rob Reynolds</owners> | ||
<summary>Ruby - A dynamic, open source programming language with a focus on simplicity and productivity.</summary> | ||
<description>Ruby is a dynamic, open source programming language with a focus on simplicity and productivity. It has an elegant syntax that is natural to read and easy to write. | ||
|
||
This package provides a self-contained [Windows-based installer](https://rubyinstaller.org) that includes the Ruby language, an execution environment, important documentation, and more. | ||
|
||
## Package Parameters | ||
|
||
- `InstallDir` - Ruby installation directory, by default `c:\tools\RubyXY` where XY are major and minor version parts. | ||
- `NoPath` - Do not add ruby bin folder to machine PATH. | ||
</description> | ||
<tags>ruby admin language programming development dynamic cross-platform foss</tags> | ||
<licenseUrl>http://www.ruby-lang.org/en/about/license.txt</licenseUrl> | ||
<projectUrl>http://www.ruby-lang.org</projectUrl> | ||
<projectSourceUrl>https://bugs.ruby-lang.org/projects/ruby-trunk/repository</projectSourceUrl> | ||
<packageSourceUrl>https://github.com/chocolatey/chocolatey-coreteampackages/tree/master/automatic/ruby</packageSourceUrl> | ||
<bugTrackerUrl>https://bugs.ruby-lang.org/projects/ruby-trunk/issues</bugTrackerUrl> | ||
<requireLicenseAcceptance>false</requireLicenseAcceptance> | ||
<releaseNotes>https://www.ruby-lang.org/en/downloads/releases/</releaseNotes> | ||
<iconUrl>https://cdn.rawgit.com/ferventcoder/chocolatey-packages/02c21bebe5abb495a56747cbb9b4b5415c933fc0/icons/ruby.svg</iconUrl> | ||
<dependencies> | ||
<dependency id="chocolatey-core.extension" version="1.3" /> | ||
<dependency id="chocolatey" version="0.10.5" /> | ||
</dependencies> | ||
</metadata> | ||
<files> | ||
<file src="tools\**" target="tools" /> | ||
<file src="legal\**" target="legal" /> | ||
</files> | ||
</package> | ||
<!-- character encoding: “UTF-8” --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
$ErrorActionPreference = 'Stop' | ||
|
||
$toolsDir = Split-Path $MyInvocation.MyCommand.Definition | ||
$rubyDir = 'ruby' + ($Env:ChocolateyPackageVersion -replace '\.').Substring(0,2) | ||
|
||
$pp = Get-PackageParameters | ||
$installDir = if ($pp.InstallDir) { $pp.InstallDir } else { Get-ToolsLocation } | ||
$installDir = Join-Path $installDir $rubyDir | ||
Write-Host "Ruby is going to be installed in '$installDir'" | ||
|
||
$packageArgs = @{ | ||
packageName = 'ruby' | ||
fileType = 'exe' | ||
file = gi "$toolsDir\*_x32.exe" | ||
file64 = gi "$toolsDir\*_x64.exe" | ||
silentArgs = '/verysilent /dir="{0}" /tasks="assocfiles,modpath"' -f $installDir | ||
validExitCodes = @(0) | ||
softwareName = 'ruby *' | ||
} | ||
Install-ChocolateyInstallPackage @packageArgs | ||
rm $toolsDir\*.exe -ea 0 | ||
|
||
if (!$pp.NoPath) { Install-ChocolateyPath (Join-Path $installDir 'bin') Machine } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import-module au | ||
Import-Module "$PSScriptRoot\..\..\scripts\au_extensions.psm1" | ||
|
||
$releases = 'https://rubyinstaller.org/downloads' | ||
|
||
function global:au_SearchReplace { | ||
@{ | ||
".\tools\chocolateyInstall.ps1" = @{ | ||
"(?i)(^\s*packageName\s*=\s*)('.*')" = "`$1'$($Latest.PackageName)'" | ||
"(?i)(^\s*fileType\s*=\s*)('.*')" = "`$1'$($Latest.FileType)'" | ||
} | ||
|
||
".\legal\VERIFICATION.txt" = @{ | ||
"(?i)(\s+x32:).*" = "`${1} $($Latest.URL32)" | ||
"(?i)(\s+x64:).*" = "`${1} $($Latest.URL64)" | ||
"(?i)(checksum32:).*" = "`${1} $($Latest.Checksum32)" | ||
"(?i)(checksum64:).*" = "`${1} $($Latest.Checksum64)" | ||
"(?i)(Get-RemoteChecksum).*" = "`${1} $($Latest.URL64)" | ||
} | ||
} | ||
} | ||
|
||
function global:au_BeforeUpdate { Get-RemoteFiles -Purge } | ||
function global:au_AfterUpdate { Set-DescriptionFromReadme -SkipFirst 2 } | ||
|
||
function global:au_GetLatest { | ||
$download_page = Invoke-WebRequest -Uri $releases -UseBasicParsing | ||
$re = '\.exe$' | ||
$url = $download_page.links | ? href -match $re | select -First 2 -expand href | ||
@{ | ||
Version = $url[0] -split '-|.exe' | select -Last 1 -Skip 1 | ||
URL32 = $url -notmatch 'x64' | select -first 1 | ||
URL64 = $url -match 'x64' | select -first 1 | ||
} | ||
} | ||
|
||
update -ChecksumFor none |
Oops, something went wrong.