origen 0.7.25 → 0.7.26

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: f00de9cfd35bf3b781f46b122cdba834cc4e463e
4
- data.tar.gz: b7bd2adf089d4ed70c76ed834fbcbf1a2afba6bb
3
+ metadata.gz: c9a41c5ead7ae18b4a7fb8267ffb3681b1fa7cf9
4
+ data.tar.gz: 4ab640fdfc1efa46b57b9d621ecd6ea67bb2cb37
5
5
  SHA512:
6
- metadata.gz: 9714b2e319c3aaef19d537801f97969d2852e7b843a91f88fe7a9cd19786e58a28b79a7a0036defacfe2bb292f522ef13053c90ab14c189dcc8d16ccd36cf6c8
7
- data.tar.gz: ad47dec90e2fa07fe5c9c19840681d715716c8913b1871bca2e30685471240902bff5761ec789a29adcdf06067e5da68b041d1e6a6db3f9edb890939742e8259
6
+ metadata.gz: 990b6fe8c4421b856bf5daf534864cf2b4c4be57283b7eefa0092456559b6519318265af34bdf3a8fb5fa3a4b4285afa877dc2e3d064d3f6d510410e286221b3
7
+ data.tar.gz: 6da8b2276531a6a33254f17ef372ce31879951091ab4c93a858d8e31520efa16cc400b403bd0ef838285be6776c3e4c1e7759b1b2509f51b158d754be900e00f
data/config/version.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  module Origen
2
2
  MAJOR = 0
3
3
  MINOR = 7
4
- BUGFIX = 25
4
+ BUGFIX = 26
5
5
  DEV = nil
6
6
 
7
7
  VERSION = [MAJOR, MINOR, BUGFIX].join(".") + (DEV ? ".pre#{DEV}" : '')
@@ -36,7 +36,10 @@ module Origen
36
36
  app = base.instance
37
37
  app.root = root.to_s
38
38
  if Origen.plugins_loaded? && !Origen.loading_top_level?
39
- Origen.log.warning "The #{app.name} plugin is using a non-standard loading mechanism, upgrade to a newer version of it to get rid of this warning (please report a bug to its owner if this warning persists)"
39
+ # This situation of a plugin being loaded after the top-level app could occur if the app
40
+ # doesn't require the plugin until later, in that case there is nothing the plugin owner
41
+ # can do and we just need to accept that this can happen.
42
+ # Origen.log.warning "The #{app.name} plugin is using a non-standard loading mechanism, upgrade to a newer version of it to get rid of this warning (please report a bug to its owner if this warning persists)"
40
43
  Origen.app.plugins << app
41
44
  else
42
45
  Origen.register_application(app)
data/lib/origen/log.rb CHANGED
@@ -12,11 +12,26 @@ module Origen
12
12
  require 'log4r'
13
13
  require 'log4r/outputter/fileoutputter'
14
14
 
15
+ attr_accessor :msg_hash
16
+ alias_method :messages, :msg_hash
17
+
15
18
  LEVELS = [:normal, :verbose, :silent]
16
19
 
17
20
  def initialize
18
21
  @log_time_0 = @t0 = Time.new
19
22
  self.level = :normal
23
+ @msg_hash = init_msg_hash
24
+ end
25
+
26
+ def init_msg_hash
27
+ msg_types = [:info, :warn, :error, :deprecate, :debug, :success]
28
+ msg_hash = {}
29
+ msg_types.each do |m|
30
+ msg_hash[m] = Hash.new do |h, k|
31
+ h[k] = []
32
+ end
33
+ end
34
+ msg_hash
20
35
  end
21
36
 
22
37
  def console_only?
@@ -74,50 +89,67 @@ module Origen
74
89
  @level
75
90
  end
76
91
 
77
- def debug(string = '')
92
+ def validate_args(string, msg_type)
93
+ return string, msg_type unless string.is_a? Symbol
94
+ ['', string]
95
+ end
96
+
97
+ def debug(string = '', msg_type = nil)
98
+ string, msg_type = validate_args(string, msg_type)
78
99
  msg = format_msg('DEBUG', string)
79
100
  log_files.debug msg unless console_only?
80
101
  console.debug msg
102
+ @msg_hash[:debug][msg_type] << msg
81
103
  nil
82
104
  end
83
105
 
84
- def info(string = '')
106
+ def info(string = '', msg_type = nil)
107
+ string, msg_type = validate_args(string, msg_type)
85
108
  msg = format_msg('INFO', string)
86
109
  log_files.info msg unless console_only?
87
110
  console.info msg
111
+ @msg_hash[:info][msg_type] << msg
88
112
  nil
89
113
  end
90
114
  # Legacy methods
91
115
  alias_method :lputs, :info
92
116
  alias_method :lprint, :info
93
117
 
94
- def success(string = '')
118
+ def success(string = '', msg_type = nil)
119
+ string, msg_type = validate_args(string, msg_type)
95
120
  msg = format_msg('SUCCESS', string)
96
121
  log_files.info msg unless console_only?
97
122
  console.info msg.green
123
+ @msg_hash[:success][msg_type] << msg
98
124
  nil
99
125
  end
100
126
 
101
- def deprecate(string = '')
127
+ def deprecate(string = '', msg_type = nil)
128
+ string, msg_type = validate_args(string, msg_type)
102
129
  msg = format_msg('DEPRECATED', string)
103
130
  log_files.warn msg unless console_only?
104
131
  console.warn msg.yellow
132
+ @msg_hash[:deprecate][msg_type] << msg
105
133
  nil
106
134
  end
107
135
  alias_method :deprecated, :deprecate
108
136
 
109
- def warn(string = '')
137
+ def warn(string = '', msg_type = nil)
138
+ string, msg_type = validate_args(string, msg_type)
110
139
  msg = format_msg('WARNING', string)
111
140
  log_files.warn msg unless console_only?
112
141
  console.warn msg.yellow
142
+ @msg_hash[:warn][msg_type] << msg
113
143
  nil
114
144
  end
115
145
  alias_method :warning, :warn
116
146
 
117
- def error(string = '')
147
+ def error(string = '', msg_type = nil)
148
+ string, msg_type = validate_args(string, msg_type)
118
149
  msg = format_msg('ERROR', string)
119
150
  log_files.error msg unless console_only?
120
151
  console.error msg.red
152
+ @msg_hash[:error][msg_type] << msg
121
153
  nil
122
154
  end
123
155
 
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.7.25
4
+ version: 0.7.26
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen McGinty
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-22 00:00:00.000000000 Z
11
+ date: 2016-08-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -567,7 +567,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
567
567
  version: 1.8.11
568
568
  requirements: []
569
569
  rubyforge_project:
570
- rubygems_version: 2.5.1
570
+ rubygems_version: 2.2.2
571
571
  signing_key:
572
572
  specification_version: 4
573
573
  summary: The Semiconductor Developer's Kit