Sha256: 243f1b33505e7029a9d62fa96a5e7e1e2911becb5f4b011c23fe39f7a3c23212

Contents?: true

Size: 741 Bytes

Versions: 1

Compression:

Stored size: 741 Bytes

Contents

require 'media/runner/app/file_check'
require 'media/runner/app/media_paths'
require 'media/runner/app/vlc_check'

module Media
  class Movie
    include FileCheck, VlcCheck, MediaPaths

    def initialize(title, format = nil)
      @title = title
      @format = format
    end

    attr_accessor :title, :format

    def run
      vlc_installed?

      unless movie_exists?(self)
        Media::Printer.output ["#{movie_path(self)} doesn't exist. Did you type the movie name correctly?"]
        exit 1
      end

      Media::Printer.output ["Playing movie #{title}. ENJOY!"]
      `zsh -c "#{Dir.home}/Applications/VLC.app/Contents/MacOS/VLC --fullscreen #{movie_path(self)} > /dev/null \
       2>&1 &!"`
      exit 0
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
media-runner-1.0.3 lib/media/runner/movie.rb