p4ruby 2014.1 → 2014.2.0.pre1
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 +4 -4
- data/LICENSE.txt +24 -0
- data/ext/P4/clientprogressruby.cpp +99 -0
- data/ext/P4/clientprogressruby.h +52 -0
- data/ext/P4/clientuserruby.cpp +726 -0
- data/ext/P4/clientuserruby.h +133 -0
- data/ext/P4/extconf.rb +547 -0
- data/ext/P4/gc_hack.h +10 -0
- data/ext/P4/p4.cpp +1319 -0
- data/ext/P4/p4clientapi.cpp +713 -0
- data/ext/P4/p4clientapi.h +237 -0
- data/ext/P4/p4error.cpp +122 -0
- data/ext/P4/p4error.h +61 -0
- data/ext/P4/p4mapmaker.cpp +459 -0
- data/ext/P4/p4mapmaker.h +69 -0
- data/ext/P4/p4mergedata.cpp +272 -0
- data/ext/P4/p4mergedata.h +97 -0
- data/ext/P4/p4result.cpp +259 -0
- data/ext/P4/p4result.h +86 -0
- data/ext/P4/p4rubydebug.h +45 -0
- data/ext/P4/p4specdata.cpp +108 -0
- data/ext/P4/p4specdata.h +52 -0
- data/ext/P4/p4utils.cpp +62 -0
- data/ext/P4/p4utils.h +46 -0
- data/ext/P4/specmgr.cpp +604 -0
- data/ext/P4/specmgr.h +102 -0
- data/ext/P4/undefdups.h +64 -0
- data/lib/P4.rb +664 -0
- data/lib/P4/version.rb +3 -0
- data/p4-doc/user/p4rubynotes.txt +770 -0
- metadata +80 -36
- data/CHANGES +0 -10
- data/README +0 -9
- data/install.rb +0 -206
- data/p4ruby.gemspec +0 -29
metadata
CHANGED
@@ -1,69 +1,113 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: p4ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2014.2.0.pre1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
- Perforce Software
|
7
|
+
- Perforce Software, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-11-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 10.3.2
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 10.3.2
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake-compiler
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
16
30
|
requirements:
|
17
31
|
- - "~>"
|
18
32
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0'
|
20
|
-
type: :
|
33
|
+
version: '0.9'
|
34
|
+
type: :development
|
21
35
|
prerelease: false
|
22
36
|
version_requirements: !ruby/object:Gem::Requirement
|
23
37
|
requirements:
|
24
38
|
- - "~>"
|
25
39
|
- !ruby/object:Gem::Version
|
26
|
-
version: '0'
|
40
|
+
version: '0.9'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: test-unit
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
30
44
|
requirements:
|
31
|
-
- - "
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: p4util
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
32
60
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
34
|
-
type: :
|
61
|
+
version: 0.0.3
|
62
|
+
type: :development
|
35
63
|
prerelease: false
|
36
64
|
version_requirements: !ruby/object:Gem::Requirement
|
37
65
|
requirements:
|
38
|
-
- - "
|
66
|
+
- - "~>"
|
39
67
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
41
|
-
description: Ruby
|
42
|
-
email:
|
68
|
+
version: 0.0.3
|
69
|
+
description: Ruby extensions to the C++ Perforce API.
|
70
|
+
email: support@perforce.com
|
43
71
|
executables: []
|
44
|
-
extensions:
|
45
|
-
|
46
|
-
|
72
|
+
extensions:
|
73
|
+
- ext/P4/extconf.rb
|
74
|
+
extra_rdoc_files: []
|
47
75
|
files:
|
48
|
-
-
|
49
|
-
-
|
50
|
-
-
|
51
|
-
-
|
52
|
-
|
53
|
-
|
76
|
+
- LICENSE.txt
|
77
|
+
- ext/P4/clientprogressruby.cpp
|
78
|
+
- ext/P4/clientprogressruby.h
|
79
|
+
- ext/P4/clientuserruby.cpp
|
80
|
+
- ext/P4/clientuserruby.h
|
81
|
+
- ext/P4/extconf.rb
|
82
|
+
- ext/P4/gc_hack.h
|
83
|
+
- ext/P4/p4.cpp
|
84
|
+
- ext/P4/p4clientapi.cpp
|
85
|
+
- ext/P4/p4clientapi.h
|
86
|
+
- ext/P4/p4error.cpp
|
87
|
+
- ext/P4/p4error.h
|
88
|
+
- ext/P4/p4mapmaker.cpp
|
89
|
+
- ext/P4/p4mapmaker.h
|
90
|
+
- ext/P4/p4mergedata.cpp
|
91
|
+
- ext/P4/p4mergedata.h
|
92
|
+
- ext/P4/p4result.cpp
|
93
|
+
- ext/P4/p4result.h
|
94
|
+
- ext/P4/p4rubydebug.h
|
95
|
+
- ext/P4/p4specdata.cpp
|
96
|
+
- ext/P4/p4specdata.h
|
97
|
+
- ext/P4/p4utils.cpp
|
98
|
+
- ext/P4/p4utils.h
|
99
|
+
- ext/P4/specmgr.cpp
|
100
|
+
- ext/P4/specmgr.h
|
101
|
+
- ext/P4/undefdups.h
|
102
|
+
- lib/P4.rb
|
103
|
+
- lib/P4/version.rb
|
104
|
+
- p4-doc/user/p4rubynotes.txt
|
105
|
+
homepage: http://www.perforce.com/product/components/apis
|
106
|
+
licenses:
|
107
|
+
- MIT
|
54
108
|
metadata: {}
|
55
109
|
post_install_message:
|
56
|
-
rdoc_options:
|
57
|
-
- "--title"
|
58
|
-
- 'P4Ruby: Ruby interface to the Perforce API'
|
59
|
-
- "--main"
|
60
|
-
- README
|
61
|
-
- "--exclude"
|
62
|
-
- CHANGES
|
63
|
-
- "--exclude"
|
64
|
-
- install.rb
|
65
|
-
- "--exclude"
|
66
|
-
- p4ruby.gemspec
|
110
|
+
rdoc_options: []
|
67
111
|
require_paths:
|
68
112
|
- lib
|
69
113
|
required_ruby_version: !ruby/object:Gem::Requirement
|
@@ -73,13 +117,13 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
73
117
|
version: '0'
|
74
118
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
75
119
|
requirements:
|
76
|
-
- - "
|
120
|
+
- - ">"
|
77
121
|
- !ruby/object:Gem::Version
|
78
|
-
version:
|
122
|
+
version: 1.3.1
|
79
123
|
requirements: []
|
80
124
|
rubyforge_project:
|
81
125
|
rubygems_version: 2.2.2
|
82
126
|
signing_key:
|
83
127
|
specification_version: 4
|
84
|
-
summary: Ruby
|
128
|
+
summary: Ruby extensions to the C++ Perforce API
|
85
129
|
test_files: []
|
data/CHANGES
DELETED
data/README
DELETED
data/install.rb
DELETED
@@ -1,206 +0,0 @@
|
|
1
|
-
require 'net/ftp'
|
2
|
-
require 'rbconfig'
|
3
|
-
require 'zlib'
|
4
|
-
require 'rubygems/package'
|
5
|
-
|
6
|
-
BUILD_DIR = "./build"
|
7
|
-
DIST_DIR = "./dist"
|
8
|
-
|
9
|
-
FTP_SERVER = "ftp.perforce.com"
|
10
|
-
TOP_DIR = "perforce"
|
11
|
-
P4RUBY_FTP_DIR = "bin.tools"
|
12
|
-
|
13
|
-
P4RUBY_ARCHIVE = "p4ruby.tgz"
|
14
|
-
|
15
|
-
class Installer
|
16
|
-
def initialize
|
17
|
-
unless File.directory?(DIST_DIR)
|
18
|
-
Dir.mkdir(DIST_DIR)
|
19
|
-
end
|
20
|
-
|
21
|
-
unless File.directory?(BUILD_DIR)
|
22
|
-
Dir.mkdir(BUILD_DIR)
|
23
|
-
end
|
24
|
-
|
25
|
-
@platform = guess_platform
|
26
|
-
|
27
|
-
#TODO some way of the user supplying their own ftp path/ local path for the api's
|
28
|
-
fetch
|
29
|
-
build
|
30
|
-
end
|
31
|
-
|
32
|
-
def fetch
|
33
|
-
p4_ftp = P4Ruby_FTP.new(@platform)
|
34
|
-
p4_ftp.download
|
35
|
-
end
|
36
|
-
|
37
|
-
def build
|
38
|
-
wd = Dir.getwd
|
39
|
-
api_dir = get_api_build_dir
|
40
|
-
Dir.chdir(get_ruby_build_dir)
|
41
|
-
puts `yes | ruby p4conf.rb -d #{api_dir}`
|
42
|
-
puts `make`
|
43
|
-
puts `ruby test.rb`
|
44
|
-
puts `make install`
|
45
|
-
#TODO Deal with known issue wheree we have to ignore -Werror in Makefile
|
46
|
-
Dir.chdir(wd)
|
47
|
-
end
|
48
|
-
|
49
|
-
def guess_cpu(os)
|
50
|
-
cpu = RbConfig::CONFIG['target_cpu']
|
51
|
-
case os
|
52
|
-
when :darwin, :linux
|
53
|
-
if cpu =~ /i686/
|
54
|
-
"x86"
|
55
|
-
else
|
56
|
-
cpu
|
57
|
-
end
|
58
|
-
else
|
59
|
-
case cpu
|
60
|
-
when /ia/i
|
61
|
-
'ia64'
|
62
|
-
else
|
63
|
-
cpu
|
64
|
-
end
|
65
|
-
end
|
66
|
-
end
|
67
|
-
|
68
|
-
def guess_platform()
|
69
|
-
case RbConfig::CONFIG["target_os"].downcase
|
70
|
-
when /nt|mswin/
|
71
|
-
"nt#{guess_cpu(:windows)}"
|
72
|
-
when /mingw/
|
73
|
-
"mingwx86"
|
74
|
-
when /darwin/
|
75
|
-
#TODO look at darwin 100, can you complile bin for 90 on 100?
|
76
|
-
"darwin90#{guess_cpu(:darwin)}"
|
77
|
-
when /solaris/
|
78
|
-
"solaris10#{guess_cpu(:solaris)}"
|
79
|
-
when /linux/
|
80
|
-
"linux26#{guess_cpu(:linux)}"
|
81
|
-
when /cygwin/
|
82
|
-
#No longer built for
|
83
|
-
end
|
84
|
-
end
|
85
|
-
|
86
|
-
def get_ruby_build_dir
|
87
|
-
Dir.foreach(BUILD_DIR) do |d|
|
88
|
-
if d =~ /p4ruby/
|
89
|
-
return File.join(BUILD_DIR,d)
|
90
|
-
end
|
91
|
-
end
|
92
|
-
end
|
93
|
-
|
94
|
-
def get_api_build_dir
|
95
|
-
Dir.foreach(BUILD_DIR) do |d|
|
96
|
-
if d =~ /p4api/
|
97
|
-
return File.join(Dir.getwd, BUILD_DIR,d)
|
98
|
-
end
|
99
|
-
end
|
100
|
-
end
|
101
|
-
end
|
102
|
-
|
103
|
-
class P4Ruby_FTP
|
104
|
-
|
105
|
-
def initialize(platform)
|
106
|
-
@ftp = Net::FTP.new(FTP_SERVER)
|
107
|
-
@ftp.login
|
108
|
-
@ftp.chdir(TOP_DIR)
|
109
|
-
|
110
|
-
@latest = latest_version
|
111
|
-
@ftp.chdir("r#{@latest}")
|
112
|
-
|
113
|
-
@platform = "bin.#{platform}"
|
114
|
-
|
115
|
-
if @platform =~ /nt|mingw/
|
116
|
-
@p4api_archive = "p4api.zip"
|
117
|
-
else
|
118
|
-
@p4api_archive = "p4api.tgz"
|
119
|
-
end
|
120
|
-
end
|
121
|
-
|
122
|
-
def versions
|
123
|
-
remote_files_matching(".", /r(1\d\.\d)/) { |match|
|
124
|
-
match.captures.first
|
125
|
-
}.sort
|
126
|
-
end
|
127
|
-
|
128
|
-
def latest_version
|
129
|
-
versions.reverse_each{ |v|
|
130
|
-
begin
|
131
|
-
remote_files_matching("r#{v}/bin.tools",/p4ruby/) do
|
132
|
-
return v
|
133
|
-
end
|
134
|
-
rescue
|
135
|
-
next
|
136
|
-
end
|
137
|
-
}
|
138
|
-
end
|
139
|
-
|
140
|
-
def remote_files_matching(dir, regex)
|
141
|
-
@ftp.ls(dir.to_s).map { |entry|
|
142
|
-
if match = entry.match(regex)
|
143
|
-
yield match
|
144
|
-
else
|
145
|
-
nil
|
146
|
-
end
|
147
|
-
}.reject { |entry|
|
148
|
-
entry.nil?
|
149
|
-
}
|
150
|
-
end
|
151
|
-
|
152
|
-
def download
|
153
|
-
begin
|
154
|
-
download_p4api
|
155
|
-
download_p4ruby
|
156
|
-
rescue => e
|
157
|
-
puts "Failed to download API or p4ruby, please compile manually"
|
158
|
-
end
|
159
|
-
end
|
160
|
-
|
161
|
-
def download_p4api
|
162
|
-
@ftp.chdir(@platform)
|
163
|
-
@ftp.getbinaryfile(@p4api_archive, "#{DIST_DIR}/#{@p4api_archive}", 1024)
|
164
|
-
@ftp.chdir("..")
|
165
|
-
|
166
|
-
decompress("#{DIST_DIR}/#{@p4api_archive}","#{BUILD_DIR}/")
|
167
|
-
end
|
168
|
-
|
169
|
-
def download_p4ruby
|
170
|
-
@ftp.chdir(P4RUBY_FTP_DIR)
|
171
|
-
@ftp.getbinaryfile(P4RUBY_ARCHIVE, "#{DIST_DIR}/#{P4RUBY_ARCHIVE}", 1024)
|
172
|
-
@ftp.chdir("..")
|
173
|
-
|
174
|
-
decompress("#{DIST_DIR}/#{P4RUBY_ARCHIVE}","#{BUILD_DIR}/")
|
175
|
-
end
|
176
|
-
|
177
|
-
def decompress(tgz, destination)
|
178
|
-
if tgz =~ /\.zip/
|
179
|
-
`unzip #{tgz} -d #{destination}`
|
180
|
-
return
|
181
|
-
end
|
182
|
-
Gem::Package::TarReader.new(Zlib::GzipReader.open tgz) do |tar|
|
183
|
-
tar.each do |entry|
|
184
|
-
if entry.directory?
|
185
|
-
puts "Making dir #{File.join(destination, entry.full_name)}"
|
186
|
-
unless File.exists?(File.join(destination, entry.full_name))
|
187
|
-
Dir.mkdir(File.join(destination, entry.full_name))
|
188
|
-
end
|
189
|
-
elsif entry.file?
|
190
|
-
puts "Making file #{File.join(destination, entry.full_name)}"
|
191
|
-
unless File.exists?(File.join(destination, entry.full_name))
|
192
|
-
File.open(File.join(destination, entry.full_name), "w") do |f|
|
193
|
-
f.write(entry.read)
|
194
|
-
end
|
195
|
-
end
|
196
|
-
elsif entry.header.typeflag == '2'
|
197
|
-
#TODO remove if not necessary
|
198
|
-
binding.pry
|
199
|
-
end
|
200
|
-
end
|
201
|
-
end
|
202
|
-
end
|
203
|
-
end
|
204
|
-
|
205
|
-
i = Installer.new
|
206
|
-
|
data/p4ruby.gemspec
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
|
2
|
-
Gem::Specification.new { |t|
|
3
|
-
t.name = "p4ruby"
|
4
|
-
t.version = "2014.1"
|
5
|
-
t.summary = "Ruby interface to the Perforce API"
|
6
|
-
t.description = t.summary + "."
|
7
|
-
t.author = "Perforce Software (ruby gem by Brett Bates and Jennifer Bottom)"
|
8
|
-
t.email = "jbottom@perforce.com"
|
9
|
-
t.homepage = "https://rubygems.org/gems/p4ruby"
|
10
|
-
|
11
|
-
t.add_runtime_dependency 'rake', '~> 0'
|
12
|
-
t.add_runtime_dependency 'test-unit', '>=0'
|
13
|
-
|
14
|
-
t.files = %w[
|
15
|
-
README
|
16
|
-
CHANGES
|
17
|
-
install.rb
|
18
|
-
p4ruby.gemspec
|
19
|
-
]
|
20
|
-
|
21
|
-
t.extra_rdoc_files = ["README"]
|
22
|
-
rdoc_exclude = t.files - t.extra_rdoc_files
|
23
|
-
t.rdoc_options +=
|
24
|
-
["--title", "P4Ruby: #{t.summary}", "--main", "README"] +
|
25
|
-
rdoc_exclude.inject(Array.new) { |acc, pattern|
|
26
|
-
acc + ["--exclude", pattern]
|
27
|
-
}
|
28
|
-
}
|
29
|
-
|