Sha256: fb171ccfb9f6a63526c98fd68b3319175a34a1e1e7506a0f1ff57bdfa78dd124

Contents?: true

Size: 783 Bytes

Versions: 6

Compression:

Stored size: 783 Bytes

Contents

module TerraspaceBundler
  class Info < TB::CLI::Base
    def run
      file = TB.config.lockfile
      unless File.exist?(file)
        logger.info "No #{file} found".color(:red)
        logger.info "Maybe run: terraspace bundle"
        return
      end
      
      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.5.0 lib/terraspace_bundler/info.rb
terraspace-bundler-0.4.4 lib/terraspace_bundler/info.rb
terraspace-bundler-0.4.3 lib/terraspace_bundler/info.rb
terraspace-bundler-0.4.2 lib/terraspace_bundler/info.rb
terraspace-bundler-0.4.1 lib/terraspace_bundler/info.rb
terraspace-bundler-0.4.0 lib/terraspace_bundler/info.rb