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

Version Path
cocoapods-meitu-bin-2.0.0 lib/cocoapods-meitu-bin/command/bin/source/list.rb
cocoapods-meitu-bin-1.4.1 lib/cocoapods-meitu-bin/command/bin/source/list.rb
cocoapods-meitu-bin-1.4.0 lib/cocoapods-meitu-bin/command/bin/source/list.rb
cocoapods-meitu-bin-1.3.2 lib/cocoapods-meitu-bin/command/bin/source/list.rb
cocoapods-meitu-bin-1.3.1 lib/cocoapods-meitu-bin/command/bin/source/list.rb
cocoapods-meitu-bin-1.3.0 lib/cocoapods-meitu-bin/command/bin/source/list.rb
cocoapods-meitu-bin-1.2.3 lib/cocoapods-meitu-bin/command/bin/source/list.rb
cocoapods-meitu-bin-1.2.2 lib/cocoapods-meitu-bin/command/bin/source/list.rb
cocoapods-meitu-bin-1.2.1 lib/cocoapods-meitu-bin/command/bin/source/list.rb
cocoapods-meitu-bin-1.2.0 lib/cocoapods-meitu-bin/command/bin/source/list.rb
cocoapods-meitu-bin-1.1.5 lib/cocoapods-meitu-bin/command/bin/source/list.rb
cocoapods-meitu-bin-1.1.4 lib/cocoapods-meitu-bin/command/bin/source/list.rb
cocoapods-meitu-bin-1.1.3 lib/cocoapods-meitu-bin/command/bin/source/list.rb
cocoapods-meitu-bin-1.1.2 lib/cocoapods-meitu-bin/command/bin/source/list.rb
cocoapods-meitu-bin-1.1.1 lib/cocoapods-meitu-bin/command/bin/source/list.rb
cocoapods-meitu-bin-1.0.0 lib/cocoapods-meitu-bin/command/bin/source/list.rb