sequel-honeycomb 0.0.1 → 0.0.2

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
- SHA1:
3
- metadata.gz: 563059aeb0bcc2c53d36bc14456ac6346bdacda5
4
- data.tar.gz: 841c083196afe773b21876ad7d264c46850ef0c9
2
+ SHA256:
3
+ metadata.gz: 80b4b58cc0b669df320f3d0ed02002b65df1456a956845de5985894a1e35903c
4
+ data.tar.gz: 3ef61613425170120459d6d37f2bcf76a16140388cfb6ab3819e1d2b098cb66f
5
5
  SHA512:
6
- metadata.gz: 50c72255601b002aa62efb5642a6d95dc1550a4d3c07a3f5daf839a42cb1ea153b74d08b75c071aef44159784f7199e3293bd399e9c2fe85e491085e72234ac8
7
- data.tar.gz: 4d95721e25438a29577250a473714cc97d6bda6f845219eaa1027331b1d39c199023e4daf44c9fc6b2507900957476a00332b46dfd08f452e6314c014c2a79f6
6
+ metadata.gz: 8e44054feb8392fc11b889387da001de855cb2a7bfd0cbc231fb7c6432dfde2caef51a780b97db1c83f1381a173230d53c4018a2ac3b97854255123e761e84b8
7
+ data.tar.gz: 0e8a9d092b3961b58facdffcae89406e9b0e0e8099e86b7bd30353bb5f66b6f3a299ac031c448ff66305db3882492d4d6f4c61affc2a5313d4c271f4ae942196
@@ -1,7 +1,7 @@
1
1
  begin
2
2
  gem 'sequel'
3
3
 
4
- require 'sequel/extensions/honeycomb'
4
+ require 'sequel/honeycomb'
5
5
  rescue Gem::LoadError
6
6
  warn 'sequel not detected, not enabling sequel-honeycomb'
7
7
  end
@@ -10,12 +10,9 @@ module Sequel
10
10
  end
11
11
 
12
12
  def auto_install!(honeycomb_client:, logger: nil)
13
- require 'sequel'
14
- require 'sequel/extensions/honeycomb'
13
+ require 'sequel/honeycomb'
15
14
 
16
- # TODO is this the right way?
17
- # TODO inject client
18
- Sequel::Database.extension :honeycomb
15
+ Sequel::Honeycomb.register!(honeycomb_client: honeycomb_client)
19
16
  end
20
17
  end
21
18
  end
@@ -1,21 +1,21 @@
1
1
  module Sequel
2
2
  module Extensions
3
3
  module Honeycomb
4
- def self.included(mod)
5
- # TODO ugh clean this up
6
- puts "included"
7
- @_honeycomb ||= begin
8
- puts "HONEYCOMBING"
9
- if defined?(::Honeycomb.client)
10
- ::Honeycomb.client.tap do |klient|
11
- puts "client is #{klient.nil? ? :nil : :lin}"
4
+ class << self
5
+ attr_accessor :client
6
+
7
+ def included(mod)
8
+ # TODO ugh clean this up
9
+ @client ||= begin
10
+ if defined?(::Honeycomb.client)
11
+ ::Honeycomb.client
12
+ else
13
+ raise "Can't work without magic global Honeycomb.client at the moment"
12
14
  end
13
- else
14
- raise "Can't work without magic global Honeycomb.client at the moment"
15
15
  end
16
- end
17
- mod.class_exec(@_honeycomb) do |honeycomb_|
18
- define_method(:honeycomb) { honeycomb_ }
16
+ mod.class_exec(@client) do |honeycomb_|
17
+ define_method(:honeycomb) { honeycomb_ }
18
+ end
19
19
  end
20
20
  end
21
21
 
@@ -0,0 +1,16 @@
1
+ require 'sequel'
2
+ require 'sequel/extensions/honeycomb'
3
+
4
+ module Sequel
5
+ module Honeycomb
6
+ class << self
7
+ def register!(honeycomb_client: nil)
8
+ if honeycomb_client
9
+ Sequel::Extensions::Honeycomb.client = honeycomb_client
10
+ end
11
+
12
+ Sequel::Database.extension :honeycomb
13
+ end
14
+ end
15
+ end
16
+ end
@@ -1,6 +1,6 @@
1
1
  module Sequel
2
2
  module Honeycomb
3
3
  GEM_NAME = 'sequel-honeycomb'
4
- VERSION = '0.0.1'
4
+ VERSION = '0.0.2'
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sequel-honeycomb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Stokes
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-07 00:00:00.000000000 Z
11
+ date: 2018-05-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sequel
@@ -80,7 +80,8 @@ dependencies:
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
- description: " TO DO *is* a description\n"
83
+ description: |2
84
+ TO DO *is* a description
84
85
  email:
85
86
  - sam@honeycomb.io
86
87
  executables: []
@@ -91,6 +92,7 @@ files:
91
92
  - lib/sequel-honeycomb.rb
92
93
  - lib/sequel-honeycomb/auto_install.rb
93
94
  - lib/sequel/extensions/honeycomb.rb
95
+ - lib/sequel/honeycomb.rb
94
96
  - lib/sequel/honeycomb/version.rb
95
97
  homepage: https://github.com/honeycombio/sequel-honeycomb
96
98
  licenses:
@@ -112,7 +114,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
112
114
  version: '0'
113
115
  requirements: []
114
116
  rubyforge_project:
115
- rubygems_version: 2.6.11
117
+ rubygems_version: 2.7.7
116
118
  signing_key:
117
119
  specification_version: 4
118
120
  summary: Instrument your Sequel queries with Honeycomb