origen_updater 0.1.1 → 0.2.0
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/shared_commands.rb +1 -1
- data/config/version.rb +2 -2
- data/lib/origen_updater.rb +2 -0
- data/lib/origen_updater/on_updated.rb +1 -0
- data/lib/origen_updater/update.rb +62 -0
- metadata +3 -2
- data/lib/origen_updater/commands/update.rb +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 22a2000f0e9389ed2f408708e5ad0f72cfa6186c
|
4
|
+
data.tar.gz: 6d2f0410c262f3fdfc58f3201b885592b5ad782e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 906ddd63491534139aa3d32349af5d10db238ba4f1ebbaf2a31718bf67a431eed536c872db2ddbd318cffd626aa9ac0337ef38f551776c6a358113c6274da36e
|
7
|
+
data.tar.gz: 321db3e7048916b77ca8fcef3213ff1bbffc5b4dfd96b77f0be8bac2a0da7c7b7d6412dd92b00e8b6e1accc703666907b78d7acd884d07026636787b09a0cdd6
|
data/config/shared_commands.rb
CHANGED
data/config/version.rb
CHANGED
data/lib/origen_updater.rb
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
puts 'Updated!!'
|
@@ -0,0 +1,62 @@
|
|
1
|
+
require 'fileutils'
|
2
|
+
# require 'byebug' # Un-comment to debug this file
|
3
|
+
|
4
|
+
if Origen.site_config.gem_manage_bundler && Origen.site_config.gem_use_from_system
|
5
|
+
Origen.site_config.gem_use_from_system.each do |gem, version|
|
6
|
+
begin
|
7
|
+
spec = Gem::Specification.find_by_name(gem, version)
|
8
|
+
begin
|
9
|
+
(spec.executables || []).each do |bin|
|
10
|
+
unless File.exist?("#{local_gem_dir}/bin/#{bin}")
|
11
|
+
FileUtils.cp("#{spec.bin_dir}/#{bin}", "#{local_gem_dir}/bin")
|
12
|
+
end
|
13
|
+
end
|
14
|
+
p = Pathname.new(spec.cache_file)
|
15
|
+
unless File.exist?("#{local_gem_dir}/cache/#{p.basename}")
|
16
|
+
FileUtils.cp(spec.cache_file, "#{local_gem_dir}/cache")
|
17
|
+
end
|
18
|
+
if spec.extension_dir && File.exist?(spec.extension_dir)
|
19
|
+
spec.extension_dir =~ /.*extensions(.*)/
|
20
|
+
sub_dir = Pathname.new(Regexp.last_match(1)).dirname.to_s
|
21
|
+
local_ext_dir = "#{local_gem_dir}/extensions/#{sub_dir}"
|
22
|
+
FileUtils.mkdir_p(local_ext_dir) unless File.exist?(local_ext_dir)
|
23
|
+
|
24
|
+
# If the file exists in the extensions directory, skip copying it over.
|
25
|
+
p = Pathname.new(spec.extension_dir)
|
26
|
+
unless File.exist?("#{local_ext_dir}/#{p.basename}")
|
27
|
+
FileUtils.cp_r(spec.extension_dir, local_ext_dir)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
# If the file exists in the gem directory, skip copying it over.
|
32
|
+
p = Pathname.new(spec.gem_dir)
|
33
|
+
unless File.exist?("#{local_gem_dir}/gems/#{p.basename}")
|
34
|
+
FileUtils.cp_r(spec.gem_dir, "#{local_gem_dir}/gems")
|
35
|
+
end
|
36
|
+
# If the file exists in the specifications directory, skip copying it over.
|
37
|
+
p = Pathname.new(spec.spec_file)
|
38
|
+
unless File.exist?("#{local_gem_dir}/specifications/#{p.basename}")
|
39
|
+
FileUtils.cp(spec.spec_file, "#{local_gem_dir}/specifications")
|
40
|
+
end
|
41
|
+
rescue
|
42
|
+
puts "Had problems installing #{spec.name} from your system Ruby, proceeding with fingers crossed..."
|
43
|
+
end
|
44
|
+
|
45
|
+
rescue Gem::LoadError
|
46
|
+
# This just means that one of the gems that should be copied from the system
|
47
|
+
# was not actually installed in the system, so nothing we can do about that here
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
if ENV['BUNDLE_BIN']
|
53
|
+
FileUtils.rm_rf(ENV['BUNDLE_BIN'])
|
54
|
+
|
55
|
+
if ARGV.first == 'all'
|
56
|
+
system 'bundle update'
|
57
|
+
elsif ARGV.empty?
|
58
|
+
system 'bundle'
|
59
|
+
else
|
60
|
+
system "bundle update #{ARGV.join(' ')}"
|
61
|
+
end
|
62
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: origen_updater
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stephen McGinty
|
@@ -37,7 +37,8 @@ files:
|
|
37
37
|
- config/shared_commands.rb
|
38
38
|
- config/version.rb
|
39
39
|
- lib/origen_updater.rb
|
40
|
-
- lib/origen_updater/
|
40
|
+
- lib/origen_updater/on_updated.rb
|
41
|
+
- lib/origen_updater/update.rb
|
41
42
|
- lib/tasks/origen_updater.rake
|
42
43
|
- templates/web/index.md.erb
|
43
44
|
- templates/web/layouts/_basic.html.erb
|
@@ -1 +0,0 @@
|
|
1
|
-
puts 'Hello, OrigenUpdater here!'
|