Skip to content

Commit

Permalink
Shorten command uuid.
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrmurach committed Apr 17, 2016
1 parent 7beae3b commit 5ac1cfb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/tty/command/cmd.rb
Expand Up @@ -52,7 +52,7 @@ def initialize(env_or_cmd, *args)
#
# @api public
def uuid
@uuid ||= "%d-%s" % [$$, SecureRandom.uuid.split('-')[0]]
@uuid ||= SecureRandom.uuid.split('-')[0]
end

# The shell environment variables
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/cmd_spec.rb
Expand Up @@ -111,7 +111,7 @@

it "provides unique identifier" do
cmd = TTY::Command::Cmd.new(:echo, 'hello')
expect(cmd.uuid).to match(/^\d+-\w{8}$/)
expect(cmd.uuid).to match(/^\w{8}$/)
end

it "converts command to hash" do
Expand Down

0 comments on commit 5ac1cfb

Please sign in to comment.