Skip to content

Commit

Permalink
Merge pull request #22 from catawiki/fc-remove-arraybuffer
Browse files Browse the repository at this point in the history
Remove arraybuffer
  • Loading branch information
marcio-absmartly authored Jul 16, 2024
2 parents 6dc79c1 + 753a8fa commit 3085d2f
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 222 deletions.
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ source "https://rubygems.org"
gemspec

gem "rake", "~> 13.0"
gem "arraybuffer"
gem "murmurhash3"
gem "faraday"

Expand Down
3 changes: 0 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@ PATH
remote: .
specs:
absmartly-sdk (1.1.0)
arraybuffer (~> 0.0.6)
faraday (~> 2.0)
faraday-retry (~> 2.0)
murmurhash3 (~> 0.1.7)

GEM
remote: https://rubygems.org/
specs:
arraybuffer (0.0.6)
ast (2.4.2)
byebug (11.1.3)
diff-lcs (1.5.0)
Expand Down Expand Up @@ -69,7 +67,6 @@ PLATFORMS

DEPENDENCIES
absmartly-sdk!
arraybuffer
byebug
faraday
irb
Expand Down
1 change: 0 additions & 1 deletion absmartly.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ Gem::Specification.new do |spec|
spec.add_dependency "faraday", "~> 2.0"
spec.add_dependency "faraday-retry", "~> 2.0"
spec.add_dependency "murmurhash3", "~> 0.1.7"
spec.add_dependency "arraybuffer", "~> 0.0.6"

# For more information and examples about making a new gem, check out our
# guide at: https://bundler.io/guides/creating_gem.html
Expand Down
1 change: 0 additions & 1 deletion lib/absmartly.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

require_relative "absmartly/version"
require_relative "absmartly/variant_assigner"
require_relative "absmartly/md5"
require_relative "a_b_smartly"
require_relative "a_b_smartly_config"
require_relative "client"
Expand Down
178 changes: 0 additions & 178 deletions lib/absmartly/md5.rb

This file was deleted.

1 change: 0 additions & 1 deletion lib/absmartly/variant_assigner.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# frozen_string_literal: true

require "arraybuffer"
require "murmurhash3"

module Absmartly
Expand Down
37 changes: 0 additions & 37 deletions spec/helpers.rb
Original file line number Diff line number Diff line change
@@ -1,45 +1,8 @@
# frozen_string_literal: true

require "arraybuffer"
require "json"

module Helpers
def hash_unit(value)
Absmartly::Md5.process(string_to_uint8_array(value))
# base_64_url_no_padding(Absmartly::Md5.process(string_to_uint8_array(value)))
end

def base_64_url_no_padding(value) end

def string_to_uint8_array(value)
n = value.length
array = ArrayBuffer.new(value.length)

k = 0
(0..n - 1).each do |index|
c = value[index].ord

if c < 0x80
array[k] = c
k += 1
elsif c < 0x800
array[k] = (c >> 6) | 192
k += 1
array[k] = (c & 63) | 128
k += 1
else
array[k] = (c >> 12) | 224
k += 1
array[k] = ((c >> 6) & 63) | 128
k += 1
array[k] = (c & 63) | 128
k += 1
end
end

array
end

def resource(file_name)
File.read(File.join("spec", "fixtures", "resources", file_name))
end
Expand Down

0 comments on commit 3085d2f

Please sign in to comment.