Sha256: d8e90c01860775cd1dcf10715258d92a78dd1d9b268d52b8b6de6379eee81cdd
Contents?: true
Size: 1.44 KB
Versions: 3
Compression:
Stored size: 1.44 KB
Contents
require 'pathname' require 'skippy' require 'skippy/command' require 'skippy/group' class Skippy::App # @param [String] boot_loader_path # @return [Skippy::App] def self.boot(boot_loader_path) Skippy.app = Skippy::App.new(boot_loader_path) Skippy.app.boot Skippy.app end attr_reader :path # @param [String] boot_loader_path def initialize(boot_loader_path) @boot_loader_path = File.expand_path(boot_loader_path) @path = File.dirname(@boot_loader_path) end def boot boot_commands end def resources(item = nil) resource = Pathname.new(File.join(path, 'resources')) item ? resource.join(item) : resource end # @return [Array<String>] def templates_source_path Pathname.new(File.join(path, 'templates')) end # @return [Array<Pathname>] def templates result = [] templates_source_path.entries.each { |entry| template_path = templates_source_path.join(entry) next unless template_path.directory? next if %w(. ..).include?(entry.basename.to_s) result << entry.expand_path(templates_source_path) } result end private def boot_commands # Load the default skippy commands. path_commands = File.join(path, 'commands') commands_pattern = File.join(path_commands, '*.rb') Dir.glob(commands_pattern) { |filename| # noinspection RubyResolve require filename } end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
skippy-0.4.1.a | lib/skippy/app.rb |
skippy-0.4.0.a | lib/skippy/app.rb |
skippy-0.3.0.a | lib/skippy/app.rb |