Sha256: 92a214af65b278ef194d1dac3bd39d5d2e53fb4c44a9ab742dbfdfa641714842

Contents?: true

Size: 1.63 KB

Versions: 10

Compression:

Stored size: 1.63 KB

Contents

namespace :newrelic do
  desc "Lists information on supported versions of frameworks for this agent"

  require File.join(File.dirname(__FILE__), '..', 'new_relic', 'agent', 'supported_versions')

  task :supported_versions, [:format] => [] do |t, args|

    def version_list(list)
      return "-" if list.nil? || list.empty?
      list.join(", ")
    end

    def versions_for_type(type)
      NewRelic::Agent::SUPPORTED_VERSIONS.
        select {|_,v| v[:type] == type}.
        map    do |key,values|
          VersionStruct.new(
            values[:name] || key,
            values[:supported],
            values[:deprecated],
            values[:experimental],
            values[:notes])
        end
    end

    def build_erb(format)
      require 'erb'
      path = File.join(File.dirname(__FILE__), "versions.#{format}.erb")
      template = File.read(File.expand_path(path))
      ERB.new(template)
    end

    def write_versions(title, type, erb, suppress_versions = false)
      anchor = title.downcase.gsub(" ", "_")
      versions = versions_for_type(type)
      puts erb.result(binding).gsub(/^ *$/, '')
    end

    VersionStruct = Struct.new(:name, :supported, :deprecated, :experimental, :notes)

    format = args[:format] || "txt"
    erb = build_erb(format)

    write_versions("Ruby Versions",   :ruby, erb)
    write_versions("Web Servers",     :app_server, erb)
    write_versions("Web Frameworks",  :web, erb)
    write_versions("Database",        :database, erb)
    write_versions("Background Jobs", :background, erb)
    write_versions("HTTP Clients",    :http, erb)
    write_versions("Other",           :other, erb, true)
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
newrelic_rpm-3.8.1.221 lib/tasks/versions.rake
newrelic_rpm-3.8.0.218 lib/tasks/versions.rake
newrelic_rpm-3.7.3.204 lib/tasks/versions.rake
newrelic_rpm-3.7.3.199 lib/tasks/versions.rake
newrelic_rpm-3.7.2.195 lib/tasks/versions.rake
newrelic_rpm-3.7.2.192 lib/tasks/versions.rake
newrelic_rpm-3.7.2.190.beta lib/tasks/versions.rake
newrelic_rpm-3.7.1.188 lib/tasks/versions.rake
newrelic_rpm-3.7.1.182 lib/tasks/versions.rake
newrelic_rpm-3.7.1.180 lib/tasks/versions.rake