File: movement_arg_parser.rb

package info (click to toggle)
ruby-jekyll-compose 0.12.0-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 108 kB
  • sloc: ruby: 712; makefile: 3
file content (15 lines) | stat: -rw-r--r-- 323 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# frozen_string_literal: true

module Jekyll
  module Compose
    class MovementArgParser < ArgParser
      def validate!
        raise ArgumentError, "You must specify a #{resource_type} path." if args.empty?
      end

      def path
        File.join(source, args.join(" ")).sub(%r!\A/!, "")
      end
    end
  end
end