metricky 0.8.4 → 0.8.5

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: ece31c1fd6f70ab5b10c574070833a82fa1b2a8ea6caeacab0f33dfd9a7960a4
4
- data.tar.gz: f487ba9aae518d8c43dbb6c912e60aca6b5adde25414a86c3f402ddb79adfcc8
3
+ metadata.gz: 72cbcfe379b8654dabeeb81b7fcba95c0bece993a4855fb7661370f0a2cfbb0b
4
+ data.tar.gz: 7d371afad102bc958349c48a972258a39f8b8b6a949958797d1d7953eaffd84c
5
5
  SHA512:
6
- metadata.gz: 43209e2310ba54cad0fe1d268e7932378ed994fba73ee2224e13ad31fb85279c6b482b21fbc304b6d5af66173cc699de91e963deb7e14ce5fe4d06fc6c19d753
7
- data.tar.gz: 647d5d8f5af3285a4c3d3ba4c6e96e8eb1a50c768db9ae250e9c04c8506c9c32892abad2af9d2c0749e82fda641164b110bb753295ad7d53c6e0d834565424d6
6
+ metadata.gz: 3c6d36c3dc61b972d8b7b43ffa8777ba2b95d1d8c78de5e3a55618a8ae3cfac372595d7071e9422fea5133a4a27c11140836774525105f751b54c29c55793f8f
7
+ data.tar.gz: 013543bff0eb26e7f0b2f92f7fcb8ce70ffafad2aef717ba7f628bd9d06384b47c05fec0afe6073758645679f160d678205a0970e7814d78c6212b11e5aeba06
@@ -0,0 +1,11 @@
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
9
+ end
10
+ end
11
+ end
@@ -7,7 +7,7 @@ module Metricky
7
7
  end
8
8
 
9
9
  def metrick_path(metric, options = {})
10
- Metricky::Engine.routes.url_helpers.metric_path(name: metric.name.underscore, query: request.query_parameters, options: options)
10
+ metricky.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 = {})
@@ -1,3 +1,3 @@
1
1
  module Metricky
2
- VERSION = '0.8.4'
2
+ VERSION = '0.8.5'
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.4
4
+ version: 0.8.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh Brody
@@ -118,7 +118,7 @@ files:
118
118
  - MIT-LICENSE
119
119
  - README.md
120
120
  - Rakefile
121
- - app/controllers/metrics_controller.rb
121
+ - app/controllers/metricky/metrics_controller.rb
122
122
  - app/metrics/application_metric.rb
123
123
  - app/views/metricky/_metric.html.erb
124
124
  - config/routes.rb
@@ -1,9 +0,0 @@
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"
6
- end
7
- render json: metric.to_json
8
- end
9
- end