metricky 0.8.2 → 0.8.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ba9f360352ce74897a0d14441895c362c20f030d660f3a3317cc1499c8889938
4
- data.tar.gz: 33a086fc39c12b532b607ab8a5a087655a6a62c01a673d3da5f8e1b99724f152
3
+ metadata.gz: ece31c1fd6f70ab5b10c574070833a82fa1b2a8ea6caeacab0f33dfd9a7960a4
4
+ data.tar.gz: f487ba9aae518d8c43dbb6c912e60aca6b5adde25414a86c3f402ddb79adfcc8
5
5
  SHA512:
6
- metadata.gz: 5aa3e090e3e978c9ab99aff4beb8c0037d03829ef78e4bc02c4136ab5a8a599779265b8c90079c13c70299569819afd2e8218e39943d095d635293acc741bc05
7
- data.tar.gz: 7942700ad381ac944c887ecadea0f91f945a9c8b19f196a1594a8eb3f92e3cb81320c86a5f7c096369229931c82aed1669e24c7001378b5d233fecb1bfed696e
6
+ metadata.gz: 43209e2310ba54cad0fe1d268e7932378ed994fba73ee2224e13ad31fb85279c6b482b21fbc304b6d5af66173cc699de91e963deb7e14ce5fe4d06fc6c19d753
7
+ data.tar.gz: 647d5d8f5af3285a4c3d3ba4c6e96e8eb1a50c768db9ae250e9c04c8506c9c32892abad2af9d2c0749e82fda641164b110bb753295ad7d53c6e0d834565424d6
@@ -1,11 +1,9 @@
1
- module Metricky
2
- class MetricsController < ActionController::Base
3
- def show
4
- metric = "#{params[:name].classify}Metric".constantize.new(params[:query] || {}, params[:options] || {})
5
- unless metric.results.is_a?(Hash) || metric.results.is_a?(Array)
6
- raise RenderError, "results must be a hash or array"
7
- end
8
- render json: metric.to_json
1
+ class Metricky::MetricsController < ActionController::Base
2
+ def show
3
+ metric = "#{params[:name].classify}Metric".constantize.new(params[:query] || {}, params[:options] || {})
4
+ unless metric.results.is_a?(Hash) || metric.results.is_a?(Array)
5
+ raise RenderError, "results must be a hash or array"
9
6
  end
7
+ render json: metric.to_json
10
8
  end
11
9
  end
@@ -6,8 +6,8 @@ module Metricky
6
6
  end
7
7
  end
8
8
 
9
- def metricky_metric_path(metric, options = {})
10
- metricky.metric_path(name: metric.name.underscore, query: request.query_parameters, options: options)
9
+ def metrick_path(metric, options = {})
10
+ Metricky::Engine.routes.url_helpers.metric_path(name: metric.name.underscore, query: request.query_parameters, options: options)
11
11
  end
12
12
 
13
13
  def render_metric(metric_name, options = {})
@@ -29,7 +29,7 @@ module Metricky
29
29
 
30
30
  def metricky_chart(metric, options = {})
31
31
  if metric.json?
32
- send(metric.chart, metricky_metric_path(metric, options))
32
+ send(metric.chart, metrick_path(metric, options))
33
33
  else
34
34
  send(metric.chart, metric.results, options)
35
35
  end
@@ -1,3 +1,3 @@
1
1
  module Metricky
2
- VERSION = '0.8.2'
2
+ VERSION = '0.8.4'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metricky
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.2
4
+ version: 0.8.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh Brody