Sha256: 8be6d27c8110d5a2fd323665892ca68dbed9d4cf89a733a169de49e6b6810e58

Contents?: true

Size: 1.19 KB

Versions: 18

Compression:

Stored size: 1.19 KB

Contents

module OrigenSim
  module Commands
    module Pack
      # Note, making this a module instead of straight code so it can be called
      # programatically to auto-unpack a snapshot.

      def self.pack(options = {})
        testbench = "#{Origen.app.root}/simulation"
        unless Dir.exist?(testbench)
          fail "Could not find path #{testbench}/#{ARGV[0]}"
        end

        FileUtils.mkdir("#{Origen.app.root}/simulation/static") unless Dir.exist?("#{Origen.app.root}/simulation/static")

        output = "#{Origen.app.root}/simulation/static/#{ARGV[0]}.tar.gz"
        puts "Packing #{testbench} into #{output}..."
        system "tar vczf #{output} -C #{testbench} #{Origen.target.name}"
      end

      def self.unpack(options = {})
        testbench = "#{Origen.app.root}/simulation/static/#{ARGV[0]}.tar.gz"
        unless File.exist?(testbench)
          fail "Could not find #{testbench}"
        end

        output = "#{Origen.app.root}/simulation"
        FileUtils.mkdir(output) unless Dir.exist?(output)

        puts "Unpakcing Testbench into #{output}"
        system "tar vxzf #{testbench} -C #{output} #{ARGV[0]}"
      end

      def self.list(options = {})
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
origen_sim-0.20.7 lib/origen_sim/commands/pack.rb
origen_sim-0.20.6 lib/origen_sim/commands/pack.rb
origen_sim-0.20.5 lib/origen_sim/commands/pack.rb
origen_sim-0.20.4 lib/origen_sim/commands/pack.rb
origen_sim-0.20.3 lib/origen_sim/commands/pack.rb
origen_sim-0.20.2 lib/origen_sim/commands/pack.rb
origen_sim-0.20.1 lib/origen_sim/commands/pack.rb
origen_sim-0.20.0 lib/origen_sim/commands/pack.rb
origen_sim-0.16.1 lib/origen_sim/commands/pack.rb
origen_sim-0.16.0 lib/origen_sim/commands/pack.rb
origen_sim-0.15.0 lib/origen_sim/commands/pack.rb
origen_sim-0.14.0 lib/origen_sim/commands/pack.rb
origen_sim-0.13.0 lib/origen_sim/commands/pack.rb
origen_sim-0.12.0 lib/origen_sim/commands/pack.rb
origen_sim-0.11.1 lib/origen_sim/commands/pack.rb
origen_sim-0.11.0 lib/origen_sim/commands/pack.rb
origen_sim-0.10.0 lib/origen_sim/commands/pack.rb
origen_sim-0.9.0 lib/origen_sim/commands/pack.rb