origen 0.25.0 → 0.25.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 57352a8b9560ae28fd11789e2338de6d77691e46
4
- data.tar.gz: 41ad98388361e0e274e3d113b179e8a707f83ecb
3
+ metadata.gz: 164ff1785465c05f948cea646a845c30d9501318
4
+ data.tar.gz: 572cfdfd8d006b70e8b447789530284d99a1d391
5
5
  SHA512:
6
- metadata.gz: dd1086933ce68c4e4218d260efda5d612c7c0a4372d4dc6a6325310e8941522d6e70b51c4f31a5a22ffbeeaceb1fdde0f450b5f1d9fceea3eb8aeac24430470c
7
- data.tar.gz: 787cff0c13841c02c7f846005fb29bd08510bd8ddc38a49942120713494aa463542b451afade21922ff1a5e936e20346bb087fa1be82b5e8788cc4f29c8c178e
6
+ metadata.gz: c5bb8de8859693e4ba457f555709dca46200ddccccbde5ea382b6099ba2ee22e8e90d72c9ddc7aaa1fb5dd2e54bb535925df9455017c7ad5dc889eacbfd40afe
7
+ data.tar.gz: 6a96a68b9d08642282b489d0f6d08596fcee33fed04c41264b66bdaa836ad21130b370213b564fac1fe3db842feb8985b3f82c421417d28114a351602f0beb9d
data/config/version.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  module Origen
2
2
  MAJOR = 0
3
3
  MINOR = 25
4
- BUGFIX = 0
4
+ BUGFIX = 1
5
5
  DEV = nil
6
6
 
7
7
  VERSION = [MAJOR, MINOR, BUGFIX].join(".") + (DEV ? ".pre#{DEV}" : '')
data/lib/origen.rb CHANGED
@@ -159,10 +159,6 @@ unless defined? RGen::ORIGENTRANSITION
159
159
  end
160
160
  alias_method :application!, :app!
161
161
 
162
- def has_plugin?(plugin)
163
- _applications_lookup[:name][plugin.to_sym].nil? ? false : true
164
- end
165
-
166
162
  # @api private
167
163
  def with_source_file(file)
168
164
  @current_source_dir = Pathname.new(file).dirname
@@ -228,7 +228,7 @@ end.compact
228
228
 
229
229
  case @command
230
230
  when 'generate', 'program', 'compile', 'merge', 'interactive', 'target', 'environment',
231
- 'save', 'lsf', 'web', 'time', 'dispatch', 'rc', 'lint', 'plugin', 'fetch', 'mode', 'gem' # , 'add'
231
+ 'save', 'lsf', 'web', 'time', 'dispatch', 'rc', 'lint', 'plugin', 'fetch', 'mode' # , 'add'
232
232
 
233
233
  require "origen/commands/#{@command}"
234
234
  exit 0 unless @command == 'interactive'
@@ -43,4 +43,14 @@ class Fixnum
43
43
  return nil
44
44
  end
45
45
  end
46
+
47
+ def to_spreadsheet_column
48
+ index_hash = Hash.new { |hash, key| hash[key] = hash[key - 1].next }.merge(0 => 'A')
49
+ index_hash[self]
50
+ end
51
+ alias_method :to_xls_column, :to_spreadsheet_column
52
+ alias_method :to_xlsx_column, :to_spreadsheet_column
53
+ alias_method :to_xls_col, :to_spreadsheet_column
54
+ alias_method :to_xlsx_col, :to_spreadsheet_column
55
+ alias_method :to_spreadsheet_col, :to_spreadsheet_column
46
56
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: origen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.25.0
4
+ version: 0.25.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen McGinty
@@ -421,7 +421,6 @@ files:
421
421
  - lib/origen/commands/compile.rb
422
422
  - lib/origen/commands/environment.rb
423
423
  - lib/origen/commands/fetch.rb
424
- - lib/origen/commands/gem.rb
425
424
  - lib/origen/commands/generate.rb
426
425
  - lib/origen/commands/helpers.rb
427
426
  - lib/origen/commands/interactive.rb
@@ -1,270 +0,0 @@
1
- require 'optparse'
2
- require 'fileutils'
3
- require 'rubygems'
4
- require 'origen/version_string'
5
-
6
- include Origen::Utility::InputCapture
7
-
8
- options = {}
9
-
10
- opt_parser = OptionParser.new do |opts|
11
- opts.banner = <<-END
12
- Usage: origen gem
13
- origen gem gem_name [option]
14
- origen gem fetch gem_name
15
- origen gem clean (gem_name|all)
16
-
17
- Quickstart Examples:
18
- origen gem # Displays the list of currently used gems
19
- origen gem gem_name # Displays details of specified gem
20
- origen gem fetch gem name # Poluates/copies gem source to a local repo (<application_top_level_path>/tmp/gems)
21
- # and updates Gemfile to use local copy
22
- origen gem clean (gem_name|all) # Removes/deletes the local copy of the gem source and updated Gemfile to
23
- # use originally specified version/path
24
-
25
- The following options are available:
26
- END
27
- opts.on('--location', 'Display the location of the specified gem') { options[:gem_location] = true }
28
- opts.on('--version', 'Display the version of the specified gem') { options[:gem_version] = true }
29
- opts.on('-h', '--help', 'Show this message') { puts opts; exit }
30
- end
31
-
32
- opt_parser.parse! ARGV
33
-
34
- QUIET_ATTRS = %w(
35
- files test_files signing_key licenses rdoc_options
36
- autorequire cert_chain post_install_message
37
- )
38
-
39
- def self._local_gems
40
- gems = {}
41
- Gem::Specification.sort_by { |g| [g.name.downcase, g.version] }.group_by(&:name).map do |name, specs|
42
- gems[name.to_sym] = {
43
- name: name,
44
- version: specs.map(&:version).join(','),
45
- location: specs.map(&:full_gem_path).join(','),
46
- authors: specs.map(&:authors).join(',')
47
- }
48
- end
49
- gems
50
- end
51
-
52
- def self._local_gems_orig
53
- Gem::Specification.sort_by { |g| [g.name.downcase, g.version] }.group_by(&:name)
54
- end
55
-
56
- def self._session_gem_path
57
- "#{Origen.app.root}/tmp/gems"
58
- end
59
-
60
- def self._application_gemfile
61
- "#{Origen.app.root}/Gemfile"
62
- end
63
-
64
- def self._local_path_to_gem(gem)
65
- "#{_session_gem_path}/#{Pathname(gem[:location]).basename}"
66
- end
67
-
68
- def self._gem_basename(gem)
69
- "#{Pathname(gem[:location]).basename}"
70
- end
71
-
72
- def self._gem_rc_version(gem)
73
- gem[:version]
74
- end
75
-
76
- def self._update_gemfile
77
- content = File.read(_application_gemfile)
78
-
79
- search_regexp = "# ORIGEN GEM AUTO-GENERATED.*# /ORIGEN GEM AUTO-GENERATED.*?\n"
80
-
81
- if Origen.app.session.gems.keys.empty?
82
- new_contents = content.gsub(/#{search_regexp}/m, '')
83
- else
84
- replacement_string = "# ORIGEN GEM AUTO-GENERATED---------------DO NOT REMOVE THIS LINE-------------\n"
85
- replacement_string += "# -- DO NOT CHECK IN WITH THIS SECTION!\n"
86
- replacement_string += "# -- DO NOT HAND MODIFY!\n"
87
- replacement_string += "# -- USE 'origen gem clean all' to reset\n"
88
- replacement_string += "\n"
89
-
90
- Origen.app.session.gems.keys.sort.each do |g|
91
- replacement_string += "gem '#{g}', path: '#{Origen.app.session.gems[g.to_sym]}'\n"
92
- replacement_string += "puts \"\\e[1;93;40mWARNING: Using session gem for '#{g}'\\e[0m\"\n"
93
- end
94
-
95
- replacement_string += "def gem(*args)\n"
96
- replacement_string += " return if [#{Origen.app.session.gems.keys.sort.map { |e| "'" + e.to_s + "'" }.join(',')}].include? args[0]\n"
97
- replacement_string += " super(*args)\n"
98
- replacement_string += "end\n"
99
- replacement_string += "#\n"
100
- replacement_string += "# /ORIGEN GEM AUTO-GENERATED---------------DO NOT REMOVE THIS LINE------------\n"
101
-
102
- if content =~ /#{search_regexp}/m
103
- new_contents = content.gsub(/#{search_regexp}/m, replacement_string)
104
- else
105
- new_contents = replacement_string + content
106
- end
107
- end
108
- File.open(_application_gemfile, 'w') { |file| file.puts new_contents }
109
- end
110
-
111
- gems = _local_gems
112
-
113
- if !ARGV[0]
114
- longest_key = gems.keys.max_by(&:length)
115
- puts ''
116
- printf "%-#{longest_key.length}s %-15s %s\n", 'Gem', 'Version', 'Location'
117
- puts '--------------------------------------------------------------------------------------------------------------'
118
- gems.each do |k, v|
119
- printf "%-#{longest_key.length}s %-15s %s\n", k, v[:version], v[:location]
120
- end
121
- puts ''
122
- else
123
- case input = ARGV.shift
124
- when 'clean'
125
- gem = ARGV[0]
126
- if gem
127
- if gem == 'all'
128
- if Dir.exist? _session_gem_path
129
- puts ''
130
- puts 'You are about to delete all local gems (tmp/gems/). IS THAT CORRECT?'
131
- puts ''
132
- get_text confirm: true
133
- Origen::Log.console_only do
134
- Dir.chdir Origen.root do
135
- system("rm -fr #{_session_gem_path}")
136
- end
137
- end
138
- unless Origen.app.session.gems.keys.empty?
139
- Origen.app.session.gems.keys.sort.each do |g|
140
- Origen.app.session.gems.delete_key(g)
141
- end
142
- _update_gemfile
143
- end
144
- else
145
- puts 'There are no local gems present, nothing to clean.'
146
- end
147
- elsif gems.key?(gem.to_sym)
148
- if Dir.exist? _local_path_to_gem(gems[gem.to_sym])
149
- # check if already exists, ask for permission to blow away
150
- puts ''
151
- puts "You are about to delete the local copy of '#{gem}' (tmp/gems/#{_gem_basename(gems[gem.to_sym])}). IS THAT CORRECT?"
152
- puts ''
153
- get_text confirm: true
154
- Origen::Log.console_only do
155
- Dir.chdir Origen.root do
156
- system("rm -fr #{_local_path_to_gem(gems[gem.to_sym])}")
157
- end
158
- end
159
- Origen.app.session.gems.delete_key(gem.to_sym)
160
- _update_gemfile
161
- else
162
- puts "Gem '#{gem}' is not locally present, nothing to clean."
163
- end
164
- end
165
- else
166
- puts "Error: Must specify gem to be cleaned or 'all'. Use 'origen gem -h' for usage"
167
- end
168
- when 'fetch'
169
- gem = ARGV[0]
170
- if gem
171
- if gems.key?(gem.to_sym)
172
- # Initialize ./tmp/gems/
173
- FileUtils.mkdir_p(_session_gem_path) unless Dir.exist? _session_gem_path
174
-
175
- if Dir.exist? _local_path_to_gem(gems[gem.to_sym])
176
- # check if already exists, ask for permission to blow away
177
- puts ''
178
- puts "Gem '#{_gem_basename(gems[gem.to_sym])}' already exists locally, would you like to replace?"
179
- puts "(This will delete and replace the exising copy at #{_local_path_to_gem(gems[gem.to_sym])})"
180
- puts ''
181
- get_text confirm: true
182
- Origen::Log.console_only do
183
- Dir.chdir Origen.root do
184
- # Blow away these temporary files
185
- system("rm -fr #{_local_path_to_gem(gems[gem.to_sym])}")
186
- end
187
- end
188
- end
189
-
190
- if Origen.has_plugin?(gem)
191
- # Set up the requested plugin workspace
192
- rc_url = Origen.app(gem.to_sym).config.rc_url || Origen.app(gem.to_sym).config.vault
193
- if rc_url =~ /git/
194
- Origen::RevisionControl::Git.git("clone #{rc_url} #{_gem_basename(gems[gem.to_sym])}", local: _session_gem_path, verbose: true)
195
- else
196
- # Use Origen::RevisionControl for DesignSync
197
- rc = Origen::RevisionControl.new remote: rc_url, local: _local_path_to_gem(gems[gem.to_sym])
198
- tag = Origen::VersionString.new(_gem_rc_version(gems[gem.to_sym]))
199
- tag = tag.prefixed if tag.semantic?
200
- rc.build version: tag
201
- end
202
- else
203
- puts 'Not an Origen plugin gem, only COPYING source.'
204
- FileUtils.cp_r(gems[gem.to_sym][:location], _session_gem_path)
205
- end
206
-
207
- # FileUtils.cp_r(gems[gem.to_sym][:location], _session_gem_path)
208
- unless options[:dont_use]
209
- Origen.app.session.gems[gem.to_sym] = "#{_local_path_to_gem(gems[gem.to_sym])}"
210
- end
211
-
212
- _update_gemfile
213
-
214
- puts "Fetched #{gem} to tmp/gems/#{_gem_basename(gems[gem.to_sym])}"
215
- puts ''
216
- # puts 'Please add the following to your Gemfile:'
217
- # puts ''
218
- # puts "gem '#{gem}', path: '#{_local_path_to_gem(gems[gem.to_sym])}'"
219
- # puts ''
220
- else
221
- puts "Error: '#{gem}' is not a currently used gem. Use 'origen gem' for gem list."
222
- end
223
- else
224
- puts "Error: Must specify gem to be fetched. Use 'origen gem -h' for usage"
225
- end
226
- # when 'reset'
227
- # gem = ARGV[0]
228
- # if gem
229
- # puts "Resetting #{gem} to Gemfile/gemspec"
230
- # else
231
- # puts "Error: Must specify gem to be cleaned or 'all'"
232
- # end
233
- else
234
- gem = input
235
- if gems.key?(gem.to_sym)
236
- a = _local_gems_orig[gem].to_yaml.split(/\n+/)
237
- skip = true
238
-
239
- if options[:gem_location] || options[:gem_version]
240
- puts '================================================================================='
241
- puts "Gem Name: #{gems[gem.to_sym][:name]}"
242
- puts "Version: #{gems[gem.to_sym][:version]}" if options[:gem_version]
243
- puts "Location: #{gems[gem.to_sym][:location]}" if options[:gem_location]
244
- puts '================================================================================='
245
- else
246
- puts '================================================================================='
247
- puts "Gem Name: #{gems[gem.to_sym][:name]}"
248
- puts "Version: #{gems[gem.to_sym][:version]}"
249
- puts "Location: #{gems[gem.to_sym][:location]}"
250
- puts '---------------------------------------------------------------------------------'
251
- puts 'Details:'
252
- a.each do |line|
253
- if line =~ /^ (\w+):(.*)$/
254
- topic = Regexp.last_match(1)
255
- if QUIET_ATTRS.include? topic
256
- skip = true
257
- else
258
- skip = false
259
- end
260
- end
261
- puts " #{line}" unless skip
262
- end
263
- puts '---------------------------------------------------------------------------------'
264
- puts '================================================================================='
265
- end
266
- else
267
- puts "Error: '#{gem}' not a valid command or gem. Use 'origen gem -h' for usage or 'origen gem' for gem list."
268
- end
269
- end
270
- end