origen_updater 0.1.1 → 0.2.0

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: 4f0f3e5ca86e2580b8ca388dcd5edbee39570301
4
- data.tar.gz: 9f86c2064281cacdfcb7fff28361d2d306cdd996
3
+ metadata.gz: 22a2000f0e9389ed2f408708e5ad0f72cfa6186c
4
+ data.tar.gz: 6d2f0410c262f3fdfc58f3201b885592b5ad782e
5
5
  SHA512:
6
- metadata.gz: 10f938db03bc45bd07ea6ed29ab9e7d8fba70d7c8afab5ea807f8f250633a5a42ce4a7c7a4e570ff7becb36d5bf869f7a945bea97b70e000e3c7bf1904fd35bb
7
- data.tar.gz: 53cd587cd1c4592709e1d3b53e064a33b309fb4931191ad209d91f5698b98a4134621f6dc8e0adc1df0cfce03dcf6bf216fa9432c7df7cf166aed3de723d8556
6
+ metadata.gz: 906ddd63491534139aa3d32349af5d10db238ba4f1ebbaf2a31718bf67a431eed536c872db2ddbd318cffd626aa9ac0337ef38f551776c6a358113c6274da36e
7
+ data.tar.gz: 321db3e7048916b77ca8fcef3213ff1bbffc5b4dfd96b77f0be8bac2a0da7c7b7d6412dd92b00e8b6e1accc703666907b78d7acd884d07026636787b09a0cdd6
@@ -2,7 +2,7 @@
2
2
  case @command
3
3
 
4
4
  when "update"
5
- require "#{Origen.root!}/lib/origen_updater/commands/update"
5
+ require "#{Origen.root!}/lib/origen_updater/update"
6
6
  # Important to exit when a command has been fulfilled or else Origen core will try and execute it
7
7
  exit 0
8
8
 
data/config/version.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  module OrigenUpdater
2
2
  MAJOR = 0
3
- MINOR = 1
4
- BUGFIX = 1
3
+ MINOR = 2
4
+ BUGFIX = 0
5
5
  DEV = nil
6
6
 
7
7
  VERSION = [MAJOR, MINOR, BUGFIX].join(".") + (DEV ? ".pre#{DEV}" : '')
@@ -1,4 +1,6 @@
1
1
  require 'origen'
2
2
  require_relative '../config/application.rb'
3
3
  module OrigenUpdater
4
+ # Don't load anything from here, everything must load from the update command and with
5
+ # no dependencies
4
6
  end
@@ -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.1.1
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/commands/update.rb
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!'