From aad7c15bfbec43c3716f8a82bc3af22e1a55579d Mon Sep 17 00:00:00 2001 From: Miodrag Milic Date: Mon, 24 Apr 2017 23:58:43 +0200 Subject: [PATCH 1/4] (ruby) migrated from ferventcoder --- automatic/ruby/README.md | 10 + automatic/ruby/legal/LICENSE.txt | 25 + automatic/ruby/legal/VERIFICATION.txt | 27 + automatic/ruby/ruby.nuspec | 39 + automatic/ruby/tools/chocolateyInstall.ps1 | 23 + automatic/ruby/update.ps1 | 37 + icons/ruby.svg | 1101 ++++++++++++++++++++ 7 files changed, 1262 insertions(+) create mode 100644 automatic/ruby/README.md create mode 100644 automatic/ruby/legal/LICENSE.txt create mode 100644 automatic/ruby/legal/VERIFICATION.txt create mode 100644 automatic/ruby/ruby.nuspec create mode 100644 automatic/ruby/tools/chocolateyInstall.ps1 create mode 100644 automatic/ruby/update.ps1 create mode 100644 icons/ruby.svg diff --git a/automatic/ruby/README.md b/automatic/ruby/README.md new file mode 100644 index 00000000000..16b99ef72b5 --- /dev/null +++ b/automatic/ruby/README.md @@ -0,0 +1,10 @@ +# [](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. \ No newline at end of file diff --git a/automatic/ruby/legal/LICENSE.txt b/automatic/ruby/legal/LICENSE.txt new file mode 100644 index 00000000000..9818aa4d8ef --- /dev/null +++ b/automatic/ruby/legal/LICENSE.txt @@ -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. diff --git a/automatic/ruby/legal/VERIFICATION.txt b/automatic/ruby/legal/VERIFICATION.txt new file mode 100644 index 00000000000..38efa1830e1 --- /dev/null +++ b/automatic/ruby/legal/VERIFICATION.txt @@ -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 diff --git a/automatic/ruby/ruby.nuspec b/automatic/ruby/ruby.nuspec new file mode 100644 index 00000000000..b328224fabc --- /dev/null +++ b/automatic/ruby/ruby.nuspec @@ -0,0 +1,39 @@ + + + + + ruby + 0.0 + Ruby + Yukihiro Matsumoto + chocolatey, Rob Reynolds + Ruby - A dynamic, open source programming language with a focus on simplicity and productivity. + 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. + + ruby admin language programming development dynamic cross-platform foss + http://www.ruby-lang.org/en/about/license.txt + http://www.ruby-lang.org + https://bugs.ruby-lang.org/projects/ruby-trunk/repository + https://github.com/chocolatey/chocolatey-coreteampackages/tree/master/automatic/ruby + https://bugs.ruby-lang.org/projects/ruby-trunk/issues + false + https://www.ruby-lang.org/en/downloads/releases/ + https://cdn.rawgit.com/ferventcoder/chocolatey-packages/02c21bebe5abb495a56747cbb9b4b5415c933fc0/icons/ruby.svg + + + + + + + + + + + diff --git a/automatic/ruby/tools/chocolateyInstall.ps1 b/automatic/ruby/tools/chocolateyInstall.ps1 new file mode 100644 index 00000000000..aa843e7b21b --- /dev/null +++ b/automatic/ruby/tools/chocolateyInstall.ps1 @@ -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 } diff --git a/automatic/ruby/update.ps1 b/automatic/ruby/update.ps1 new file mode 100644 index 00000000000..1c3a4020b74 --- /dev/null +++ b/automatic/ruby/update.ps1 @@ -0,0 +1,37 @@ +import-module au +. $PSScriptRoot\..\..\scripts\Set-DescriptionFromReadme.ps1 + +$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 diff --git a/icons/ruby.svg b/icons/ruby.svg new file mode 100644 index 00000000000..3a92f4cadbf --- /dev/null +++ b/icons/ruby.svg @@ -0,0 +1,1101 @@ + + + +image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From e872c6eb45550d70981b2304f8401379f67c3901 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miodrag=20Mili=C4=87?= Date: Tue, 25 Apr 2017 00:06:12 +0200 Subject: [PATCH 2/4] (ruby) using au_extensions.psm1 --- automatic/ruby/update.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/automatic/ruby/update.ps1 b/automatic/ruby/update.ps1 index 1c3a4020b74..a19a42aaebd 100644 --- a/automatic/ruby/update.ps1 +++ b/automatic/ruby/update.ps1 @@ -1,5 +1,5 @@ import-module au -. $PSScriptRoot\..\..\scripts\Set-DescriptionFromReadme.ps1 +Import-Module "$PSScriptRoot\..\..\scripts\au_extensions.psm1 $releases = 'https://rubyinstaller.org/downloads' From f1ab27361f362c0e92ea548aafce86a8f069bec2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miodrag=20Mili=C4=87?= Date: Tue, 25 Apr 2017 08:58:21 +0200 Subject: [PATCH 3/4] Update update.ps1 --- automatic/ruby/update.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/automatic/ruby/update.ps1 b/automatic/ruby/update.ps1 index a19a42aaebd..a6211fa49a0 100644 --- a/automatic/ruby/update.ps1 +++ b/automatic/ruby/update.ps1 @@ -1,5 +1,5 @@ import-module au -Import-Module "$PSScriptRoot\..\..\scripts\au_extensions.psm1 +Import-Module "$PSScriptRoot\..\..\scripts\au_extensions.psm1" $releases = 'https://rubyinstaller.org/downloads' From 11e53dd8ea617c555bc1077d4faa69b230fb669b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miodrag=20Mili=C4=87?= Date: Tue, 25 Apr 2017 08:58:44 +0200 Subject: [PATCH 4/4] Update README.md --- automatic/ruby/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/automatic/ruby/README.md b/automatic/ruby/README.md index 16b99ef72b5..15eb414eb6d 100644 --- a/automatic/ruby/README.md +++ b/automatic/ruby/README.md @@ -6,5 +6,5 @@ This package provides a self-contained [Windows-based installer](https://rubyins ## 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. \ No newline at end of file +- `/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.