Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows Ruby 1.9 #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ end

task :update_docs do
ruby_path = File.join(
Config::CONFIG["bindir"],
Config::CONFIG["RUBY_INSTALL_NAME"])
RbConfig::CONFIG["bindir"],
RbConfig::CONFIG["RUBY_INSTALL_NAME"])

help = "--help"
command = "ruby #{File.basename(INSTALLER)} #{help}"
Expand Down
21 changes: 16 additions & 5 deletions install.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
class Installer
include FileUtils

CONFIG = Config::CONFIG
CONFIG = RbConfig::CONFIG
BIT64 = (1.size == 8)

RB_BASENAME = Pathname.new "P4.rb"
Expand All @@ -29,12 +29,17 @@ class Installer
]

SERVER = "ftp.perforce.com"
SERVER_TOP_DIR = Pathname.new "perforce"
SERVER_TOP_DIR = Pathname.new "pub/perforce"

# Mysterious "ghost" releases which lack files
HOSED_VERSIONS = %w[09.3 11.1]
HOSED_VERSIONS = %w[09.3 11.1 12.2]

if RUBY_PLATFORM == 'i386-mingw32'
P4API_REMOTE_BASENAME = Pathname.new "p4api.zip"
else
P4API_REMOTE_BASENAME = Pathname.new "p4api.tgz"
end

P4API_REMOTE_BASENAME = Pathname.new "p4api.tgz"
P4RUBY_REMOTE_BASENAME = Pathname.new "p4ruby.tgz"

WORK_DIR = Pathname.new "work"
Expand Down Expand Up @@ -199,6 +204,8 @@ def guess_platform(opts = {})

if config_os =~ %r!cygwin!i
"cygwin" + windows_cpu
elsif (config_os =~ %r!mingw!i) && (CONFIG["MAJOR"].to_i == 1) && (CONFIG["MINOR"].to_i == 9)
"mingw" + windows_cpu
elsif config_os =~ %r!(mswin|mingw)!i
"nt" + windows_cpu
elsif @s.local
Expand Down Expand Up @@ -253,7 +260,11 @@ def sys(*args)
end

def unpack(distfile, target_dir)
sys("tar", "zxvf", distfile.to_s, "-C", target_dir.to_s)
if File.extname(distfile.to_s).downcase == '.zip'
sys('unzip', distfile.to_s, '-d', target_dir.to_s)
else
sys("tar", "zxvf", distfile.to_s, "-C", target_dir.to_s)
end
end

def fetch_spec(spec)
Expand Down