Sha256: f4a6c53a2960efcb906e69e8b8ff9e01c10cd41a2755c37d50b36b6940a97675

Contents?: true

Size: 619 Bytes

Versions: 7

Compression:

Stored size: 619 Bytes

Contents

#!/usr/bin/env ruby
require "redis"
require "trifle"

if ARGV.count < 2
  puts "Syntax: `trifle redis filenames --key=your_key"
  puts "e.g. `trifle redis://127.0.0.1:6379/6 filename1 filename2 --key=my_key"
  exit(1)
end

redis = Redis.new(url: ARGV[0])
ARGV.shift

filenames = []
options = {}

ARGV.each do |arg|
  if arg.match(/^--/)
    option = arg.split("=")
    key = option[0].gsub("--")
    option.shift
    value = option.join("=")
    options[key] = value
  else
    filenames << arg
  end
end

puts "Loading #{filenames.join(", ")}"
Trifle.new(redis, options).load(filenames: filenames)
puts "Trifle loaded"

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
trifle-0.1.0 bin/trifle
trifle-0.0.9 bin/trifle
trifle-0.0.8 bin/trifle
trifle-0.0.7 bin/trifle
trifle-0.0.6 bin/trifle
trifle-0.0.5 bin/trifle
trifle-0.0.4 bin/trifle