Pry: my media, your media.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.bundle
doc
lib
playlists
spec
.gitignore
.travis.yml
Gemfile
LICENSE.txt
README.md
Rakefile.rb
pry-media.gemspec

README.md

Build Status

Mirrors:

pry-media

pry-media is a plugin for the Pry repl. The plugin adds the option to play media items through Pry with an external media player. The media player chosen by default varies from platform to platform, although it is configurable and it can be changed to what is optimal for your personal preferences.

Despite the title and all descriptions up until this point making reference to "media" in the same sense as a music video or film, the plugin is also suitable for audio books.

The default playlist

pry-media ships with a large default playlist with topics ranging from music to religion. It is not intended to cause offense, but offer food for the brain and soul. It might not be your cup of tea. It covers Islam, which in todays climate is a touch-y topic given how widespread Islamophobia has become.

For this reason and because Pry always offers choice, there is an --import option which can import a custom playlist instead, effectively replacing the default until you choose a new playlist or revert to the default. Keep the doors of your mind open, please.

The default list is maintained as a gist and distributed through pastebin that will come into use when pry-media reaches v1.0.0 and used henceforth to add new media.

Usage

Note: "hey-dj" command is also aliased as recall-memory, hey-tiesto, hey-armin-van-buuren, and hey-piano-man.

  1. Start with a summary of the help menu:

     [1] pry(main)> hey-dj --help
    
  2. Play media items in sequence, repeating the sequence when the end is reached:

     [1] pry(main)> hey-dj-seq
    
     # Alternative to the above:
     [1] pry(main)> hey-dj --sequential
    
  3. Play a random media item:

     [1] pry(main)> hey-dj
    
  4. Find and play a media item through a pattern match:

     [1] pry(main)> hey-dj --match "Gift Of Love"
    
  5. Find and print all media items that match a pattern:

     [1] pry(main)> hey-dj --find "Love"
     ....
    
  6. The --import option can be used to fetch the latest changes to the default playlist.

     [1] pry(main)> hey-dj --import default
     Please wait while playlist is fetched across the wire …
     [2] pry(main)>
    
  7. It can also be used to import your own playlist.

     [1] pry(main)> hey-dj --import "https://www.mydomain.com/myplaylist.yml"
     Please wait while playlist is fetched across the wire …
     [2] pry(main)>
    
  8. Local disk playlists are supported through the file: scheme, too.

     [1] pry(main)> hey-dj --import "file:/home/myname/myplaylist.yml"
     Please wait while playlist is fetched across the wire …
     [2] pry(main)>
    

For more information on the --import option, see the doc/ directory. For more information while using Pry, refer to step 1.

Alternative playlists

pry-media ships with its own alternative playlists, but you can add your own in the format described here to "~/.pry/media/user-playlists/" and they will be picked by the "hey-dj --alternative" (or "hey-dj -a" for short) command.

0. Africa And Carribean

recall-memory --import 0

1. Americas

recall-memory --import 1

2. Barack Hussein Obama

recall-memory --import 2

3. Christianity

recall-memory --import 3

4. Europe

recall-memory --import 4

5. Iran

recall-memory --import 5

6. Islam

recall-memory --import 6

7. Islamic Ayatollah

recall-memory --import 7

8. John Fitzgerald Kennedy (JFK)

recall-memory --import 8

9. Judaism

recall-memory --import 9

10. Poems (Rumi)

recall-memory --import 10

11. Trap Nation

recall-memory --import 11

12. Tupac Amaru Shakur

recall-memory --import 12

13. USA

recall-memory --import 13

System Install (Recommended, Easiest method)

If you're using Windows, please install Ruby before going further. Then open powershell.exe (MS Windows) and enter the following:

gem install pry pry-media --no-rdoc --no-ri
pry

Or open Terminal.app(Mac OS X), and enter the following:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install ruby
PATH=/usr/local/bin:$PATH gem install pry pry-media --no-rdoc --no-ri
pry

Local Install (Optional, Experience Required)

As long as you have a local install of 'rake', & 'bundler', at a shell:

git clone https://github.com/pry/pry-media.git
cd pry-media
ruby -S rake start

License

MIT.