Sha256: 8725fecb66f0917e59f1929fab5893ced530b937859441a916a310470fdd06a9

Contents?: true

Size: 884 Bytes

Versions: 3

Compression:

Stored size: 884 Bytes

Contents

require "colorize"
require "fileutils"

module Fling
  # Central utilities for Tahoe-LAFS setup
  module Setup
    module_function

    TAHOE_VERSION = "1.10.1a1"
    TAHOE_DIR     = "allmydata-tahoe-#{TAHOE_VERSION}"
    TAHOE_ZIP     = "#{TAHOE_DIR}.zip"
    TAHOE_SRC     = "https://tahoe-lafs.org/source/tahoe-lafs/tarballs/#{TAHOE_ZIP}"

    # Note something important just happened
    def ohai(msg)
      STDOUT.puts "#{'***'.blue} #{msg.light_white}"
    end

    def run
      zip = "/tmp/#{TAHOE_ZIP}"
      dir = File.join(Dir.home, TAHOE_DIR)

      ohai "Downloading #{TAHOE_ZIP}"
      system "curl -o #{zip} #{TAHOE_SRC}"

      ohai "Extracting #{TAHOE_ZIP} into #{dir}"
      system "cd #{Dir.home} && unzip -q #{zip}"

      ohai "Configuring Tahoe-LAFS"
      system "cd #{dir} && python setup.py build"

      ohai "Tahoe-LAFS is ready to roll."
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
fling-0.0.5 lib/fling/setup.rb
fling-0.0.4 lib/fling/setup.rb
fling-0.0.3 lib/fling/setup.rb