Sha256: bce746ec8c627dbd966639d44e52d20d3356e9857bf1814f0e629e69b3d9980a
Contents?: true
Size: 654 Bytes
Versions: 4
Compression:
Stored size: 654 Bytes
Contents
# frozen_string_literal: true require "yaml" module RailsInteractive class CLI # Commands class for the interactive CLI module class Command def initialize @commands = YAML.load_file("#{__dir__}/config/commands.yml").uniq end def all @commands end def find_by_identifier(identifier) @commands.find { |command| command["identifier"] == identifier } end def dependencies(identifier) identifier = identifier.is_a?(Array) ? identifier.join("") : identifier command ||= find_by_identifier(identifier) command["dependencies"] end end end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
rails-interactive-2.1.3 | lib/cli/command.rb |
rails-interactive-2.1.2 | lib/cli/command.rb |
rails-interactive-2.1.1 | lib/cli/command.rb |
rails-interactive-2.1.0 | lib/cli/command.rb |