perforce 1.0.1 → 1.0.2
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.
- data/README +7 -9
- data/lib/perforce.rb +13 -15
- data/perforce.gemspec +1 -1
- metadata +3 -3
data/README
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
|
2
|
-
= Perforce - Streamlined wrapper for
|
2
|
+
= Perforce - Streamlined wrapper for P4Ruby
|
3
3
|
|
4
4
|
The classes Perforce and Perforce::Changelist present a simplified
|
5
5
|
interface to the Perforce API. They encapsulate all the functionality
|
@@ -9,7 +9,7 @@ These are small classes implemented atop P4, the class installed by
|
|
9
9
|
the P4Ruby package. The underlying P4 object is always available
|
10
10
|
with Perforce#p4. See http://p4ruby.rubyforge.org.
|
11
11
|
|
12
|
-
|
12
|
+
== Install
|
13
13
|
|
14
14
|
% gem install perforce
|
15
15
|
|
@@ -17,15 +17,13 @@ Or for the regular (non-gem) .tgz package,
|
|
17
17
|
|
18
18
|
% ruby install.rb [--uninstall]
|
19
19
|
|
20
|
-
|
20
|
+
== Links
|
21
21
|
|
22
|
-
* http://rubyforge.org/frs/?group_id=6958
|
22
|
+
* Download: http://rubyforge.org/frs/?group_id=6958
|
23
|
+
* P4Ruby installer: http://rubyforge.org/frs/?group_id=6957
|
24
|
+
* Repository: http://github.com/quix/perforce
|
23
25
|
|
24
|
-
|
25
|
-
|
26
|
-
* http://github.com/quix/perforce
|
27
|
-
|
28
|
-
==== Credits
|
26
|
+
== Credits
|
29
27
|
|
30
28
|
P4Ruby and the Perforce API are Copyright (c) 1997-2008 Perforce
|
31
29
|
Software. All rights reserved.
|
data/lib/perforce.rb
CHANGED
@@ -104,7 +104,8 @@ class Perforce
|
|
104
104
|
#
|
105
105
|
# Revert these files.
|
106
106
|
#
|
107
|
-
def revert_files(files)
|
107
|
+
def revert_files(*files)
|
108
|
+
files = files.flatten
|
108
109
|
unless files.empty?
|
109
110
|
run("revert", *files)
|
110
111
|
end
|
@@ -150,9 +151,9 @@ class Perforce
|
|
150
151
|
# # Changes are submitted when the block ends.
|
151
152
|
# #
|
152
153
|
#
|
153
|
-
def edit_and_submit(changelist_description, files)
|
154
|
+
def edit_and_submit(changelist_description, *files)
|
154
155
|
changelist = new_changelist(changelist_description)
|
155
|
-
changelist.add_files(files)
|
156
|
+
changelist.add_files(*files)
|
156
157
|
yield
|
157
158
|
changelist.submit
|
158
159
|
end
|
@@ -302,7 +303,8 @@ class Perforce
|
|
302
303
|
#
|
303
304
|
# This is used for both editing files and adding new files.
|
304
305
|
#
|
305
|
-
def add_files(files)
|
306
|
+
def add_files(*files)
|
307
|
+
files = files.flatten
|
306
308
|
unless files.empty?
|
307
309
|
@perforce.run("edit", "-c", @number, *files)
|
308
310
|
@perforce.run("add", "-c", @number, *files)
|
@@ -312,7 +314,8 @@ class Perforce
|
|
312
314
|
#
|
313
315
|
# Revert these files in this changelist.
|
314
316
|
#
|
315
|
-
def revert_files(files)
|
317
|
+
def revert_files(*files)
|
318
|
+
files = files.flatten
|
316
319
|
unless files.empty?
|
317
320
|
@perforce.run("revert", "-c", @number, *files)
|
318
321
|
end
|
@@ -321,7 +324,8 @@ class Perforce
|
|
321
324
|
#
|
322
325
|
# Open files for deletion. This action is added to the changelist.
|
323
326
|
#
|
324
|
-
def delete_files(files)
|
327
|
+
def delete_files(*files)
|
328
|
+
files = files.flatten
|
325
329
|
unless files.empty?
|
326
330
|
@perforce.run("delete", "-c", @number, *files)
|
327
331
|
end
|
@@ -386,14 +390,8 @@ class Perforce
|
|
386
390
|
#
|
387
391
|
# Revert unchanged files in this Changelist.
|
388
392
|
#
|
389
|
-
def revert_unchanged_files(
|
390
|
-
files =
|
391
|
-
if in_files.nil?
|
392
|
-
self.files
|
393
|
-
else
|
394
|
-
in_files
|
395
|
-
end
|
396
|
-
|
393
|
+
def revert_unchanged_files(files = nil)
|
394
|
+
files = (files && files.flatten) || self.files
|
397
395
|
unless files.empty?
|
398
396
|
@perforce.run("revert", "-a", "-c", @number, *files)
|
399
397
|
end
|
@@ -403,7 +401,7 @@ end
|
|
403
401
|
|
404
402
|
# version < 1.8.7 compatibility
|
405
403
|
unless respond_to? :tap
|
406
|
-
|
404
|
+
class Object #:nodoc:
|
407
405
|
def tap #:nodoc:
|
408
406
|
yield self
|
409
407
|
self
|
data/perforce.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: perforce
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James M. Lawrence
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date:
|
12
|
+
date: 2009-05-26 00:00:00 -04:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -61,7 +61,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
61
61
|
requirements: []
|
62
62
|
|
63
63
|
rubyforge_project: perforce
|
64
|
-
rubygems_version: 1.3.
|
64
|
+
rubygems_version: 1.3.1
|
65
65
|
signing_key:
|
66
66
|
specification_version: 2
|
67
67
|
summary: Streamlined wrapper for p4ruby
|