Sha256: 37937bf2db76d61f7ddfc5bc0ffa1e7ec2792859bb8cda06e84da3074a3c7bfb

Contents?: true

Size: 567 Bytes

Versions: 1

Compression:

Stored size: 567 Bytes

Contents

module ArgsSanitizer
  # Series

  def sanitize_series_args(args)
    if args.count != 2
      Media::Printer.output ['Wrong number of arguments.',
                             'Correct usage: media-runner series SERIES_FOLDER_NAME EPISODE_NUMBER']
      exit 1
    else
      { series: args[0], title: args[1] }
    end
  end

  # Movies

  def sanitize_movie_args(args)
    if args.count != 1
      Media::Printer.output ['Wrong number of arguments.', 'Correct usage: media-runner movie MOVIE_NAME']
      exit 1
    else
      { title: args[0] }
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
media-runner-1.0.3 lib/media/runner/app/args_sanitizer.rb