origen 0.32.0 → 0.32.1
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/config/version.rb +1 -1
- data/lib/origen/revision_control/perforce.rb +8 -99
- metadata +2 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bf76087ad1eed645f45fe797f3b5561d216a9712
|
4
|
+
data.tar.gz: fc8ad3b72821063fed4bbbc43f8c822df4c6a578
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 22f0891066cbaafd8a7b712a794a095baded766e57536fa477bb7bdffcde3865a8f198bab18c9605fbdc1da49b29e10073160d5ab9fa7efbbe0af5773facbe0b
|
7
|
+
data.tar.gz: 954ae5c524084789ad30658011ca7c3d7f796053e3b745ba32dfd85614482b3cccdf5071be411b8bbe3bb4d5ec12d41b0aab48b7f9bfb38b3ea8d22e5e283510
|
data/config/version.rb
CHANGED
@@ -1,109 +1,18 @@
|
|
1
|
-
require 'P4'
|
2
1
|
module Origen
|
3
2
|
module RevisionControl
|
4
3
|
class Perforce < Base
|
5
|
-
# P4 session
|
6
|
-
attr_reader :p4
|
7
|
-
|
8
|
-
# e.g. myfile.txt
|
9
|
-
attr_accessor :remote_file
|
10
|
-
|
11
4
|
def initialize(options = {})
|
12
5
|
super
|
13
|
-
@remotes_method = :print
|
14
|
-
@p4 = P4.new
|
15
|
-
@p4.maxresults = 1
|
16
|
-
parse_remote
|
17
|
-
@p4.connect
|
18
|
-
unless @p4.connected?
|
19
|
-
Origen.log.error("Could not connect to port #{@p4.port} on client #{@p4.client}!")
|
20
|
-
fail
|
21
|
-
end
|
22
|
-
@p4.run_login
|
23
|
-
end
|
24
|
-
|
25
|
-
# Downloads a file to a local directory, no workspace/client is created. Perfect
|
26
|
-
# for read-only access like an application remote
|
27
|
-
def print(options = {})
|
28
|
-
options = {
|
29
|
-
verbose: true,
|
30
|
-
version: 'Latest'
|
31
|
-
}.merge(options)
|
32
|
-
cmd = [__method__.to_s, '-o', "#{@local}/#{@remote_file.to_s.split('/')[-1]}", @remote_file.to_s]
|
33
|
-
run cmd
|
34
|
-
end
|
35
|
-
|
36
|
-
def checkout(path = nil, options = {})
|
37
|
-
not_yet_supported(__method__)
|
38
|
-
end
|
39
|
-
|
40
|
-
def root
|
41
|
-
not_yet_supported(__method__)
|
42
|
-
end
|
43
|
-
|
44
|
-
def current_branch
|
45
|
-
not_yet_supported(__method__)
|
46
|
-
end
|
47
|
-
|
48
|
-
def diff_cmd
|
49
|
-
not_yet_supported(__method__)
|
50
|
-
end
|
51
|
-
|
52
|
-
def unmanaged
|
53
|
-
not_yet_supported(__method__)
|
54
|
-
end
|
55
|
-
|
56
|
-
def local_modifications
|
57
|
-
not_yet_supported(__method__)
|
58
|
-
end
|
59
|
-
|
60
|
-
def changes
|
61
|
-
not_yet_supported(__method__)
|
62
|
-
end
|
63
|
-
|
64
|
-
def checkin
|
65
|
-
not_yet_supported(__method__)
|
66
|
-
end
|
67
|
-
|
68
|
-
def build
|
69
|
-
not_yet_supported(__method__)
|
70
|
-
end
|
71
|
-
|
72
|
-
private
|
73
|
-
|
74
|
-
# Needs to be in the form of an Array with command, as a Sting, as the first argument
|
75
|
-
# e.g. ["print", "-o", "pins/myfile.txt", "//depot/myprod/main/doc/pinout/myfile.txt"]
|
76
|
-
def run(cmd)
|
77
|
-
p4.run cmd
|
78
|
-
end
|
79
|
-
|
80
|
-
def not_yet_supported(m)
|
81
|
-
Origen.log.warn("The method #{m} is not currently supported by the Perforce API")
|
82
|
-
nil
|
83
|
-
end
|
84
|
-
|
85
|
-
def parse_remote
|
86
|
-
(@p4.port, @remote_file) = @remote.to_s.match(/^p4\:\/\/(\S+\:\d+)(.*)/).captures unless @remote.nil?
|
87
|
-
end
|
88
|
-
|
89
|
-
def configure_client(options)
|
90
|
-
unless options.include? :local
|
91
|
-
Origen.log.error('Need options[:local] to know how to configure the Perforce client!')
|
92
|
-
fail
|
93
|
-
end
|
94
|
-
client_name = "#{Origen.app.name}_#{User.current.id}_#{Time.now.to_i}"
|
95
6
|
begin
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
rescue P4Exception
|
104
|
-
@p4.errors.each { |e| Origen.log.error e }
|
105
|
-
raise
|
7
|
+
require 'origen_perforce'
|
8
|
+
rescue LoadError
|
9
|
+
puts 'To use the Perforce revision control system with Origen, you must add the following gem to your Gemfile:'
|
10
|
+
puts
|
11
|
+
puts " gem 'origen_perforce'"
|
12
|
+
puts
|
13
|
+
exit 1
|
106
14
|
end
|
15
|
+
_initialize_(options)
|
107
16
|
end
|
108
17
|
end
|
109
18
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: origen
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.32.
|
4
|
+
version: 0.32.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stephen McGinty
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-03-
|
11
|
+
date: 2018-03-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -352,26 +352,6 @@ dependencies:
|
|
352
352
|
- - "~>"
|
353
353
|
- !ruby/object:Gem::Version
|
354
354
|
version: 0.8.1
|
355
|
-
- !ruby/object:Gem::Dependency
|
356
|
-
name: p4ruby
|
357
|
-
requirement: !ruby/object:Gem::Requirement
|
358
|
-
requirements:
|
359
|
-
- - "~>"
|
360
|
-
- !ruby/object:Gem::Version
|
361
|
-
version: '2015.2'
|
362
|
-
- - ">="
|
363
|
-
- !ruby/object:Gem::Version
|
364
|
-
version: 2015.2.1313860
|
365
|
-
type: :runtime
|
366
|
-
prerelease: false
|
367
|
-
version_requirements: !ruby/object:Gem::Requirement
|
368
|
-
requirements:
|
369
|
-
- - "~>"
|
370
|
-
- !ruby/object:Gem::Version
|
371
|
-
version: '2015.2'
|
372
|
-
- - ">="
|
373
|
-
- !ruby/object:Gem::Version
|
374
|
-
version: 2015.2.1313860
|
375
355
|
description:
|
376
356
|
email:
|
377
357
|
- stephen.f.mcginty@gmail.com
|