Sha256: 3a897545e6e513d457d376f0e83247d0c1998a9c52e9bbb93ef8fe8969ce04bb
Contents?: true
Size: 1.23 KB
Versions: 16
Compression:
Stored size: 1.23 KB
Contents
module Pod class Command class Bin < Command class Source < Bin class List < Source SPECIAL_DIRS = %w[. .. .DS_Store].freeze self.summary = '打印二进制对应的源码' self.description = <<-DESC #{self.summary} DESC self.arguments = [ CLAide::Argument.new('NAMES', true ) ] def initialize(argv) @names = argv.shift_argument super end def run entries = Dir.entries(source_dir).reject { |dir| SPECIAL_DIRS.include?(dir) } unless @names.nil? name_arr = @names.split(',').map(&:downcase) entries.select! { |entry| name_arr.include?(entry.downcase) } end if entries.empty? UI.puts "无对应的源码".red return end entries.map do |entry| UI.puts "#{entry}".green sub_dir = "#{source_dir}/#{entry}" sub_entries = Dir.entries(sub_dir).reject { |dir| SPECIAL_DIRS.include?(dir) } sub_entries.map { |sub_entry| UI.puts " - #{sub_entry}".yellow } end end end end end end end
Version data entries
16 entries across 16 versions & 1 rubygems