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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 72cbcfe379b8654dabeeb81b7fcba95c0bece993a4855fb7661370f0a2cfbb0b
|
4
|
+
data.tar.gz: 7d371afad102bc958349c48a972258a39f8b8b6a949958797d1d7953eaffd84c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
data/lib/metricky/helper.rb
CHANGED
@@ -7,7 +7,7 @@ module Metricky
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def metrick_path(metric, options = {})
|
10
|
-
|
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 = {})
|
data/lib/metricky/version.rb
CHANGED
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
|
+
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
|