Sha256: 5aa97fdf896287564aa15f379d3fa91f623cf5a7d43046eca0cabeaccf4805cd

Contents?: true

Size: 586 Bytes

Versions: 6

Compression:

Stored size: 586 Bytes

Contents

module TerraspaceBundler
  class Info < TB::CLI::Base
    def run
      name = @options[:mod]
      found = lockfile.mods.find { |m| m.name == @options[:mod] }
      if found
        show(found)
      else
        logger.info "Could not find module in #{TB.config.lockfile}: #{name}".color(:red)
      end
    end

    def show(mod)
      props = mod.props.reject { |k,v| k == :name }.stringify_keys # for sort
      puts "#{mod.name}:"
      props.keys.sort.each do |k|
        puts "    #{k}: #{props[k]}"
      end
    end

    def lockfile
      Lockfile.instance
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
terraspace-bundler-0.3.4 lib/terraspace_bundler/info.rb
terraspace-bundler-0.3.3 lib/terraspace_bundler/info.rb
terraspace-bundler-0.3.2 lib/terraspace_bundler/info.rb
terraspace-bundler-0.3.1 lib/terraspace_bundler/info.rb
terraspace-bundler-0.3.0 lib/terraspace_bundler/info.rb
terraspace-bundler-0.2.0 lib/terraspace_bundler/info.rb