Sha256: d8b0177d28fe4f42ab907ea6445d6efa5deec4dd4286a80d25b03c2b8ee07c04

Contents?: true

Size: 939 Bytes

Versions: 93

Compression:

Stored size: 939 Bytes

Contents

@metrics          = []
def add_shipped_metrics(args)
  @metrics << {
    :type         => 'shipped',
    :package      => (args[:package]             || Pkg::Config.project),
    :version      => (args[:version]             || Pkg::Config.version),
    :pe_version   => (args[:pe_version]          || Pkg::Config.pe_version),
    :is_rc        => (args[:is_rc]               || false),
  }
end

def post_shipped_metrics
  require 'net/http'
  @metrics.each do |metric|
    type         = metric[:type]
    package      = metric[:package]
    version      = metric[:version]
    pe_version   = metric[:pe_version]
    is_rc        = metric[:is_rc]

    uri = URI(Pkg::Config.metrics_url)
    res = Net::HTTP.post_form(
      uri,
      {
        'type'          => type,
        'package'       => package,
        'version'       => version,
        'pe_version'    => pe_version,
        'is_rc'         => is_rc,
      }
    )
  end
end

Version data entries

93 entries across 93 versions & 1 rubygems

Version Path
packaging-0.99.10.2.gfa4c366 tasks/30_metrics.rake
packaging-0.99.10 tasks/30_metrics.rake
packaging-0.99.9.5.g5811fb8 tasks/30_metrics.rake
packaging-0.99.9 tasks/30_metrics.rake
packaging-0.99.8 tasks/30_metrics.rake
packaging-0.99.7 tasks/30_metrics.rake
packaging-0.99.6 tasks/30_metrics.rake
packaging-0.99.5 tasks/30_metrics.rake
packaging-0.99.4 tasks/30_metrics.rake
packaging-0.99.3 tasks/30_metrics.rake
packaging-0.99.2 tasks/30_metrics.rake
packaging-0.99.1 tasks/30_metrics.rake
packaging-0.99.0 tasks/30_metrics.rake