diff options
author | robert <r@newton.osaka> | 2017-10-12 22:59:12 +0200 |
---|---|---|
committer | robert <r@newton.osaka> | 2017-10-12 22:59:12 +0200 |
commit | aef72e8fe6457ab155647854a93a1559bf9da14e (patch) | |
tree | 1959f039b8dd861ea132825585c6be0d762185ca | |
parent | c4089526ace9eca7e2d8e77b8b1d7c4275ca1af7 (diff) | |
parent | 8858ded6a8c6e4e8e1b0babdf347588cd5a6f06e (diff) | |
download | pryfork-deprecate.tar.gz |
Merge branch 'pry/master' into pryfork-deprecatepryfork-deprecate
-rw-r--r-- | lib/pry/commands/easter_eggs.rb | 1 | ||||
-rw-r--r-- | lib/pry/commands/play_motion_picture.rb | 27 |
2 files changed, 28 insertions, 0 deletions
diff --git a/lib/pry/commands/easter_eggs.rb b/lib/pry/commands/easter_eggs.rb index fafc6d21..e59e28c1 100644 --- a/lib/pry/commands/easter_eggs.rb +++ b/lib/pry/commands/easter_eggs.rb @@ -1,3 +1,4 @@ +# coding: utf-8 class Pry Pry::Commands.instance_eval do command "nyan-cat", "", :requires_gem => ["nyancat"] do diff --git a/lib/pry/commands/play_motion_picture.rb b/lib/pry/commands/play_motion_picture.rb new file mode 100644 index 00000000..06e5d477 --- /dev/null +++ b/lib/pry/commands/play_motion_picture.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true +class Pry::Command::PlayMotionPicture < Pry::ClassCommand + MOTION_PICTURES = [ + 'https://www.youtube.com/watch?v=nOSuObRNBUA', + 'https://www.youtube.com/watch?v=svJvT6ruolA', + 'https://www.youtube.com/watch?v=l-L3zeCNzH8', + 'https://www.youtube.com/watch?v=QrY9eHkXTa4', + 'https://www.youtube.com/watch?v=VhdHwphvhxU', + 'https://www.youtube.com/watch?v=mcTKcMzembk', + 'https://www.youtube.com/watch?v=PGYAAsHT4QE' + ].freeze + + match 'play-motion-picture' + group 'Misc' + description 'Bored? Play a motion picture.' + + def process + if _pry_.h.windows? + else + syscall = _pry_.config.system + syscall.call _pry_.output, "%s %s" % [_pry_.config.media_player, MOTION_PICTURES.sample].map{|input| + Shellwords.shellescape(input) + } + end + end + Pry::Commands.add_command(self) +end |