Permalink
Browse files

Require tmpdir

  • Loading branch information...
1 parent eaba877 commit 46c7b01a146c195cdc4924abddf9b2d7dfc42a43 @assaf committed Feb 18, 2013
Showing with 14 additions and 52 deletions.
  1. +1 −1 Gemfile.lock
  2. +12 −51 bin/uuid
  3. +1 −0 lib/uuid.rb
View
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
- uuid (2.3.5)
+ uuid (2.3.6)
macaddr (~> 1.0)
GEM
View
@@ -1,55 +1,16 @@
#!/usr/bin/env ruby
-require "uuid"
-require "optparse"
+#
+# This file was generated by Bundler.
+#
+# The application 'uuid' is installed as part of a gem, and
+# this file is here to facilitate running it.
+#
-address = nil
-count = 1
-format = :default
-server = false
+require 'pathname'
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
+ Pathname.new(__FILE__).realpath)
-opts = OptionParser.new("", 24, ' ') do |opts|
- opts.banner = "Usage: #{File.basename($0)} [options]"
+require 'rubygems'
+require 'bundler/setup'
- opts.separator "\nOptions:"
- opts.on("-s", "--socket {HOST:PORT|PATH}",
- "communicate on HOST:PORT or PATH (default: #{UUID::SOCKET_NAME})") do |value|
- address = value
- end
-
- opts.on("-S", "--server", "run as a server") do |value|
- server = value ? true : false
- end
-
- opts.on("-F", "--format {FORMAT}", "UUID format (client only)") do |value|
- format = value.to_sym
- end
-
- opts.on("-C", "--count {COUNT}", "returns give number of UUIDs") do |value|
- count = value.to_i
- end
-
- opts.on("-h", "--help", "Show this message") do
- puts opts.to_s.gsub(/^.*DEPRECATED.*$/s, '')
- exit
- end
-
- opts.on("-v", "--version", "Show version") do
- puts "UUID v#{UUID::VERSION}"
- exit
- end
-
- opts.parse! ARGV
-end
-
-
-if server
- $stdout << "Starting UUID server on #{address}\n"
- UUID::Server.new.listen(address || UUID::SOCKET_NAME)
-else
- UUID.server = address if address
- $stdout << UUID.generate(format)
- (count - 1).times do
- $stdout.putc "\n"
- $stdout << UUID.generate(format)
- end
-end
+load Gem.bin_path('uuid', 'uuid')
View
@@ -13,6 +13,7 @@
require 'socket'
require 'macaddr'
require 'digest/sha1'
+require 'tmpdir'
##

0 comments on commit 46c7b01

Please sign in to comment.