Sha256: 6175a460aad831b9fa64691a371563f96d43101ac275c5a1c445c258d6f099a8

Contents?: true

Size: 983 Bytes

Versions: 4

Compression:

Stored size: 983 Bytes

Contents

#!/usr/bin/env ruby
require 'optparse'

options = {}
option_parser = OptionParser.new do |opts|
  opts.banner = "Usage: #{File.basename(__FILE__)} [-h HOST | -d]"

  opts.on("-h", "--host HOST", "JCR host (e.g., http://localhost:4502)") do |host|
    options[:host] = host
  end

  opts.on("-d", "Developer mode -- connects to http://admin:admin@localhost:4502") do |developer_mode|
    options[:developer_mode] = !!developer_mode
  end

  opts.on_tail("--help", "Show this message") do
    puts opts
    exit
  end
end

option_parser.parse!

unless options[:host] || options[:developer_mode]
  puts option_parser
  exit 1
end

if options[:developer_mode]
  host = "http://localhost:4502"
  username = "admin"
  password = "cq4me"
else
  host = options.fetch(:host)
  print "Username: "
  username = gets.chomp
  print "Password: "
  password = gets.chomp
end

ENV["HOST"] = host
ENV["USERNAME"] = username
ENV["PASSWORD"] = password

exec "irb -r './console_loader' --simple-prompt"

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
safety-pin-0.1.1 bin/safety-pin
safety-pin-0.1.0 bin/safety-pin
safety-pin-0.0.9 bin/safety-pin
safety_pin-0.0.8 bin/safety-pin