origen 0.12.1 → 0.13.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/origen +0 -22
- data/config/version.rb +2 -2
- data/lib/origen.rb +11 -0
- data/lib/origen/core_ext.rb +1 -0
- data/lib/origen/core_ext/regexp.rb +16 -0
- data/lib/origen/database/key_value_store.rb +14 -3
- data/lib/origen/database/key_value_stores.rb +2 -2
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 337374eae5a026a7c7e1384271736512a03581fb
|
4
|
+
data.tar.gz: ff8998208b3ea0dec2d1f8d764395c022c92a110
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a9daab3584692eab42da79cd7b1262eac2c70a9921f4e5a2235243ec4132974ace8f00ad58c8c385c25d2d788b76cfe0256dd7d6c9ae204128d9eb8b9472bc30
|
7
|
+
data.tar.gz: 238c335dec7d87f24c80a82f9d130367760fd57437228dd8059224112be81349cc9b589a12e48cb7432e41d1c86da22ae252284d0119d9806073696613d3aca9
|
data/bin/origen
CHANGED
@@ -8,8 +8,6 @@ require 'fileutils'
|
|
8
8
|
class OrigenBootError < StandardError
|
9
9
|
end
|
10
10
|
|
11
|
-
ORIGEN_MIN_GCC_VERSION = '4.6.3'
|
12
|
-
|
13
11
|
# Keep a note of the pwd at the time when Origen was first loaded, this is initially used
|
14
12
|
# by the site_config lookup.
|
15
13
|
$_origen_invocation_pwd ||= Pathname.pwd
|
@@ -87,26 +85,6 @@ if origen_root && File.exist?(ENV['BUNDLE_GEMFILE']) && Origen.site_config.gem_m
|
|
87
85
|
`bundle config build.#{switches}`
|
88
86
|
end
|
89
87
|
end
|
90
|
-
gcc_version = begin
|
91
|
-
begin
|
92
|
-
line = `gcc --version`.split("\n").first
|
93
|
-
rescue
|
94
|
-
puts "You don't seem to have gcc available, make sure you following the Origen installation instructions:"
|
95
|
-
puts 'http://origen-sdk.org/origen/latest/guides/starting/installing/'
|
96
|
-
exit 1
|
97
|
-
end
|
98
|
-
if line =~ /(\d+\.\d+\.\d+)/
|
99
|
-
Regexp.last_match(1)
|
100
|
-
end
|
101
|
-
end
|
102
|
-
if gcc_version
|
103
|
-
if gcc_version < ORIGEN_MIN_GCC_VERSION
|
104
|
-
puts "Origen requires a minimum of GCC version #{ORIGEN_MIN_GCC_VERSION}, but you have #{gcc_version}."
|
105
|
-
exit 1
|
106
|
-
end
|
107
|
-
else
|
108
|
-
puts 'Unable to determine gcc version, proceeding with fingers crossed...'
|
109
|
-
end
|
110
88
|
end
|
111
89
|
result = system(cmd)
|
112
90
|
end
|
data/config/version.rb
CHANGED
data/lib/origen.rb
CHANGED
@@ -683,6 +683,17 @@ unless defined? RGen::ORIGENTRANSITION
|
|
683
683
|
@current_command
|
684
684
|
end
|
685
685
|
|
686
|
+
# Provides a global Origen session stored at ~/.origen/session (Origen.home)
|
687
|
+
def session(reload = false)
|
688
|
+
@session = nil if reload
|
689
|
+
@session ||= Database::KeyValueStores.new(self, persist: false)
|
690
|
+
end
|
691
|
+
|
692
|
+
# Returns the home directory of Origen (i.e., the primary place that Origen operates out of)
|
693
|
+
def home
|
694
|
+
"#{Dir.home}/.origen"
|
695
|
+
end
|
696
|
+
|
686
697
|
private
|
687
698
|
|
688
699
|
def current_command=(val)
|
data/lib/origen/core_ext.rb
CHANGED
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'yaml'
|
2
|
+
class Regexp
|
3
|
+
def to_txt(options = {})
|
4
|
+
options = {
|
5
|
+
no_mods: false
|
6
|
+
}.update(options)
|
7
|
+
expr, mods = '', ''
|
8
|
+
if to_yaml.match(/regexp\s+\/(.*)\/(.*)/).nil?
|
9
|
+
Origen.log.error('Cannot convert the regular expression to text, something changed in the YAML view of the regular expressions')
|
10
|
+
fail
|
11
|
+
else
|
12
|
+
(expr, mods) = to_yaml.match(/regexp\s+\/(.*)\/(.*)/).captures
|
13
|
+
end
|
14
|
+
options[:no_mods] ? "\/#{expr}\/" : "\/#{expr}\/#{mods}"
|
15
|
+
end
|
16
|
+
end
|
@@ -5,10 +5,12 @@ module Origen
|
|
5
5
|
# Returns the parent database (the application's collection of
|
6
6
|
# key-value stores)
|
7
7
|
attr_reader :database
|
8
|
+
attr_accessor :private
|
8
9
|
|
9
10
|
def initialize(database, name)
|
10
11
|
@name = name
|
11
12
|
@database = database
|
13
|
+
@private = false
|
12
14
|
end
|
13
15
|
|
14
16
|
# Read a value from the store
|
@@ -54,6 +56,10 @@ module Origen
|
|
54
56
|
database.persisted?
|
55
57
|
end
|
56
58
|
|
59
|
+
def private?
|
60
|
+
@private
|
61
|
+
end
|
62
|
+
|
57
63
|
private
|
58
64
|
|
59
65
|
def dssc
|
@@ -86,7 +92,6 @@ module Origen
|
|
86
92
|
unless file.dirname.exist?
|
87
93
|
FileUtils.mkdir_p(file.dirname.to_s)
|
88
94
|
end
|
89
|
-
`chmod u+w #{file}` if file.exist?
|
90
95
|
if @uncommitted
|
91
96
|
database.record_new_store(name)
|
92
97
|
@uncommitted = false
|
@@ -94,16 +99,22 @@ module Origen
|
|
94
99
|
File.open(file.to_s, 'w') do |f|
|
95
100
|
Marshal.dump(store, f)
|
96
101
|
end
|
102
|
+
if private?
|
103
|
+
FileUtils.chmod(0600, file)
|
104
|
+
else
|
105
|
+
FileUtils.chmod(0664, file)
|
106
|
+
end
|
97
107
|
if persisted?
|
98
108
|
dssc.check_in file, new: true, keep: true, branch: 'Trunk'
|
99
109
|
end
|
100
110
|
end
|
101
111
|
|
102
112
|
def file
|
113
|
+
file_path = database.app == Origen ? Origen.home : database.app.root
|
103
114
|
if persisted?
|
104
|
-
@file ||= Pathname.new("#{
|
115
|
+
@file ||= Pathname.new("#{file_path}/.db/#{name.to_s.symbolize}")
|
105
116
|
else
|
106
|
-
@file ||= Pathname.new("#{
|
117
|
+
@file ||= Pathname.new("#{file_path}/.session/#{name.to_s.symbolize}")
|
107
118
|
end
|
108
119
|
end
|
109
120
|
end
|
@@ -14,9 +14,9 @@ module Origen
|
|
14
14
|
|
15
15
|
def inspect
|
16
16
|
if persisted?
|
17
|
-
"< #{app.class}'s Database >"
|
17
|
+
app == Origen ? "Origen's Global Database" : "< #{app.class}'s Database >"
|
18
18
|
else
|
19
|
-
"< #{app.class}'s Session >"
|
19
|
+
app == Origen ? "Origen's Global Session" : "< #{app.class}'s Session >"
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
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.
|
4
|
+
version: 0.13.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stephen McGinty
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-06-
|
11
|
+
date: 2017-06-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -447,6 +447,7 @@ files:
|
|
447
447
|
- lib/origen/core_ext/numeric.rb
|
448
448
|
- lib/origen/core_ext/object.rb
|
449
449
|
- lib/origen/core_ext/range.rb
|
450
|
+
- lib/origen/core_ext/regexp.rb
|
450
451
|
- lib/origen/core_ext/string.rb
|
451
452
|
- lib/origen/database.rb
|
452
453
|
- lib/origen/database/key_value_store.rb
|