Skip to content

Instantly share code, notes, and snippets.

/ruby.rb Secret

Created August 10, 2015 22:31
Show Gist options
  • Save anonymous/b4e089bb783ca9a854dd to your computer and use it in GitHub Desktop.
Save anonymous/b4e089bb783ca9a854dd to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require 'pp'
array_one = [{"name" => "gvfs:amd64"}, {"name" => "gvfs-common"}, {"name" => "dogs"}]
array_two = ["dogs", "gvfs:amd64", "gvfs-common"]
pp array_one.sort_by! { |value| value[:name] }
pp array_two.sort_by! { |value| value }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment