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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4b636bd97c227eecf2344ccbdc17e29712953325
4
- data.tar.gz: cd69d451f85313509d2a2c4a31887cbf81fb57c2
3
+ metadata.gz: bf76087ad1eed645f45fe797f3b5561d216a9712
4
+ data.tar.gz: fc8ad3b72821063fed4bbbc43f8c822df4c6a578
5
5
  SHA512:
6
- metadata.gz: 4e104a65bd531b7e52ec7f9f74d002b822d004fb0c46556e412392c3b874101a8be06c27fd83bb05e35acad5fa3b2c62251d9ba729a5de08dc472004ffd11b57
7
- data.tar.gz: dc29b4f3a4567780af525fc9b023bae374af3d71ed96f241e294ae35aba9d241009f4496d4c7f25c112dca0a8d3978b3f6223b378488b8dc967bbabff6501af6
6
+ metadata.gz: 22f0891066cbaafd8a7b712a794a095baded766e57536fa477bb7bdffcde3865a8f198bab18c9605fbdc1da49b29e10073160d5ab9fa7efbbe0af5773facbe0b
7
+ data.tar.gz: 954ae5c524084789ad30658011ca7c3d7f796053e3b745ba32dfd85614482b3cccdf5071be411b8bbe3bb4d5ec12d41b0aab48b7f9bfb38b3ea8d22e5e283510
@@ -1,7 +1,7 @@
1
1
  module Origen
2
2
  MAJOR = 0
3
3
  MINOR = 32
4
- BUGFIX = 0
4
+ BUGFIX = 1
5
5
  DEV = nil
6
6
 
7
7
  VERSION = [MAJOR, MINOR, BUGFIX].join(".") + (DEV ? ".pre#{DEV}" : '')
@@ -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
- client_spec = @p4.fetch_client
97
- client_spec['Root'] = options[:local].to_s
98
- client_spec['Client'] = client_name
99
- client_spec['View'] = ["#{@remote_file} //#{client_name}/#{@remote_file.split('/')[-1]}"]
100
- client_spec['Host'] = nil
101
- @p4.save_client(client_spec)
102
- @p4.client = client_name
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.0
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-14 00:00:00.000000000 Z
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