skylight 0.9.4 → 0.10.0

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
  SHA1:
3
- metadata.gz: 3a889a7a09786acddcdf866faaf84ed4862909f4
4
- data.tar.gz: 5e2f48fcfcea4166894f19422b435eb82d809856
3
+ metadata.gz: 46377b71401533410551ea729a2fc51c14c8ab19
4
+ data.tar.gz: 98f06fa6bb8032857b23fce319ad91a397e58d1a
5
5
  SHA512:
6
- metadata.gz: 59381efc987947df3b1a8bff022beb0a61288c02b41124b861ea3923db126a4b38fb74100ad67b8efac86b694843fa7c70545bef02be511c9b1892d265a998fa
7
- data.tar.gz: 7c433c0b9b74b350955aa27641b3ae1ac6d1a2ddd8d018f71f94302078d04e1a000c697b8f339663d8af12d2417df4b973c5f786386cb14a426865eaa9b9ea95
6
+ metadata.gz: 5348784baea5422f5f4361ff7ee7bf56424783c485a5549e998acb60611c8504d691558a8813efbf2d10a44cfca46b04ecc0e2e7d4d9fa94ff3af1d9479c2cbd
7
+ data.tar.gz: 99712c702e5d9bc99baee91408a7fc072f2a4bce9271e9eb0fc94f5648f316e8f736950efa2ad20085c7d43dbb0980274343bbfa17474ddc8dff4d002d064d2d
@@ -1,3 +1,8 @@
1
+ ## 0.10.0 (December 3, 2015)
2
+
3
+ * [FEATURE] ActiveModel::Serializers Instrumentation. Always on in latest HEAD, for previous version add 'active_model_serializers' to probes list.
4
+ * [BUGFIX] Handle multi-byte characters in SQL lexer
5
+
1
6
  ## 0.9.4 (November 23, 2015)
2
7
 
3
8
  * [FEATURE] Added instrumentation for official Mongo Ruby Driver (utilized by Mongoid 5+). Add 'mongo' to probes list to enable.
@@ -1,6 +1,6 @@
1
1
  ---
2
- version: "0.7.0-ffe066b"
2
+ version: "0.7.0-b2a5f4b"
3
3
  checksums:
4
- x86-linux: "311cf34d25383d1a0c7f4611919ac78e49cbd2e227532ea9aa2b308212e9fca9"
5
- x86_64-linux: "9d4969487f16e0f1d2ed6410dc4ea408e28ec4ea157c1a56c93b0bf596600461"
6
- x86_64-darwin: "4e40e9a08efa8953ed1afca07c684385fa374833a057136057bf36ef41cce55e"
4
+ x86-linux: "4ea1f0382dbbba12454d5121a4b400278b2b515b79b676e7d4a2655cdc088bfe"
5
+ x86_64-linux: "42a958e6fe7f5d9b459e10ffc62c336c44f00e46c253b7f466a72f2902e8e130"
6
+ x86_64-darwin: "7958533c605d98f43fbe54cdd7f7a6e39d6c8fee30acd29494465213afd123ef"
@@ -444,6 +444,7 @@ lex_sql(VALUE klass, VALUE rb_sql) {
444
444
 
445
445
  // Set the statement return
446
446
  rb_str_set_len(rb_statement, statement.len);
447
+ rb_enc_associate(rb_statement, rb_utf8_encoding());
447
448
 
448
449
  ret = rb_ary_new2(2);
449
450
 
@@ -131,6 +131,7 @@ module Skylight
131
131
  action_view/render_collection
132
132
  action_view/render_partial
133
133
  action_view/render_template
134
+ active_model_serializers/render
134
135
  active_record/sql
135
136
  active_support/cache
136
137
  grape/endpoint
@@ -0,0 +1,24 @@
1
+ module Skylight
2
+ module Normalizers
3
+ module ActiveModelSerializers
4
+ class Render < Normalizer
5
+ register "render.active_model_serializers"
6
+
7
+ CAT = "view.render.active_model_serializers".freeze
8
+
9
+ def normalize(trace, name, payload)
10
+ serializer_class = payload[:serializer]
11
+
12
+ title = serializer_class.name.sub(/^ActiveModel::(Serializer::)?/, '')
13
+
14
+ if adapter_instance = payload[:adapter]
15
+ adapter_name = adapter_instance.class.name.sub(/^ActiveModel::Serializer::Adapter::/, '')
16
+ desc = "Adapter: #{adapter_name}"
17
+ end
18
+
19
+ [ CAT, title, desc ]
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,55 @@
1
+ module Skylight
2
+ module Probes
3
+ module ActiveModelSerializers
4
+ class Probe
5
+ def install
6
+ version = nil
7
+
8
+ # File moved location between version
9
+ %w(serializer serializers).each do |dir|
10
+ begin
11
+ require "active_model/#{dir}/version"
12
+ rescue LoadError
13
+ end
14
+ end
15
+
16
+ if defined?(::ActiveModel::Serializer::VERSION)
17
+ version = Gem::Version.new(::ActiveModel::Serializer::VERSION)
18
+ end
19
+
20
+ if !version || version < Gem::Version.new("0.5.0")
21
+ # Using $stderr here isn't great, but we don't have a logger accessible
22
+ $stderr.puts "[SKYLIGHT] [#{Skylight::VERSION}] Instrumention is only available for " \
23
+ "ActiveModelSerializers version 0.5.0 and greater."
24
+ return
25
+ end
26
+
27
+ # We don't actually support the RCs correctly, requires
28
+ # a release after 0.10.0.rc3
29
+ if version >= Gem::Version.new("0.10.0.rc1")
30
+ # AS::N is built in to newer versions
31
+ return
32
+ end
33
+
34
+ # End users could override as_json without calling super, but it's likely safer
35
+ # than overriding serializable_array/hash/object.
36
+
37
+ [::ActiveModel::Serializer, ::ActiveModel::ArraySerializer].each do |klass|
38
+ klass.class_eval do
39
+ alias as_json_without_sk as_json
40
+ def as_json(*args)
41
+ payload = { serializer: self.class }
42
+ ActiveSupport::Notifications.instrument('render.active_model_serializers', payload) do
43
+ as_json_without_sk(*args)
44
+ end
45
+ end
46
+ end
47
+ end
48
+
49
+ end
50
+ end
51
+ end
52
+
53
+ register("ActiveModel::Serializer", "active_model/serializer", ActiveModelSerializers::Probe.new)
54
+ end
55
+ end
@@ -1,4 +1,4 @@
1
1
  module Skylight
2
- VERSION = '0.9.4'
2
+ VERSION = '0.10.0'
3
3
  end
4
4
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: skylight
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.4
4
+ version: 0.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tilde, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-23 00:00:00.000000000 Z
11
+ date: 2015-12-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -63,6 +63,7 @@ files:
63
63
  - lib/skylight/normalizers/action_view/render_collection.rb
64
64
  - lib/skylight/normalizers/action_view/render_partial.rb
65
65
  - lib/skylight/normalizers/action_view/render_template.rb
66
+ - lib/skylight/normalizers/active_model_serializers/render.rb
66
67
  - lib/skylight/normalizers/active_record/sql.rb
67
68
  - lib/skylight/normalizers/active_support/cache.rb
68
69
  - lib/skylight/normalizers/active_support/cache_clear.rb
@@ -83,6 +84,7 @@ files:
83
84
  - lib/skylight/normalizers/moped/query.rb
84
85
  - lib/skylight/probes.rb
85
86
  - lib/skylight/probes/action_view.rb
87
+ - lib/skylight/probes/active_model_serializers.rb
86
88
  - lib/skylight/probes/excon.rb
87
89
  - lib/skylight/probes/excon/middleware.rb
88
90
  - lib/skylight/probes/grape.rb