Class: Jekyll::Compose::MovementArgParser
- Inherits:
-
Object
- Object
- Jekyll::Compose::MovementArgParser
- Defined in:
- lib/jekyll-compose/movement_arg_parser.rb
Direct Known Subclasses
Jekyll::Commands::PublishArgParser, Jekyll::Commands::UnpublishArgParser
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(args, options) ⇒ MovementArgParser
constructor
A new instance of MovementArgParser.
- #path ⇒ Object
- #source ⇒ Object
- #validate! ⇒ Object
Constructor Details
#initialize(args, options) ⇒ MovementArgParser
Returns a new instance of MovementArgParser.
5 6 7 8 9 |
# File 'lib/jekyll-compose/movement_arg_parser.rb', line 5 def initialize(args, ) @args = args @options = @config = Jekyll.configuration() end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
4 5 6 |
# File 'lib/jekyll-compose/movement_arg_parser.rb', line 4 def args @args end |
#config ⇒ Object (readonly)
Returns the value of attribute config.
4 5 6 |
# File 'lib/jekyll-compose/movement_arg_parser.rb', line 4 def config @config end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
4 5 6 |
# File 'lib/jekyll-compose/movement_arg_parser.rb', line 4 def @options end |
Instance Method Details
#path ⇒ Object
15 16 17 |
# File 'lib/jekyll-compose/movement_arg_parser.rb', line 15 def path args.join " " end |
#source ⇒ Object
19 20 21 |
# File 'lib/jekyll-compose/movement_arg_parser.rb', line 19 def source source = config["source"].gsub(%r!^#{Regexp.quote(Dir.pwd)}!, "") end |
#validate! ⇒ Object
11 12 13 |
# File 'lib/jekyll-compose/movement_arg_parser.rb', line 11 def validate! raise ArgumentError, "You must specify a #{resource_type} path." if args.empty? end |