Sha256: 8c32feba854a423def27c850b9141acb803b57edf4e526062de1cb6e4eb2414e
Contents?: true
Size: 1.02 KB
Versions: 4
Compression:
Stored size: 1.02 KB
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 path = File.expand_path("../console_loader", File.dirname(__FILE__)) exec "irb -r '#{path}' --simple-prompt"
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
safety-pin-0.1.5 | bin/safety-pin |
safety-pin-0.1.4 | bin/safety-pin |
safety-pin-0.1.3 | bin/safety-pin |
safety-pin-0.1.2 | bin/safety-pin |