rambling-trie-opal 2.1.1 → 2.1.1.1

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: 24fddca452c0fe9c0738992d1e04fb2586e4b39a44b64f28cac72f18ae067f2f
4
- data.tar.gz: 72b6d08b8a028c934d7c28f5a4c3a5f4f3bf56eb650b3900caf0a4e30b183379
3
+ metadata.gz: ac5ccedda6019e5a941b12ac2e130ee6239ab5903c4ab98ba2bf2e5bf6ed98cf
4
+ data.tar.gz: 13008e8a98897b470788b4d7aaa45d42774fc2dc633b9b49604c2fcd52652b0f
5
5
  SHA512:
6
- metadata.gz: 84a491cab68d7d407ae8ab7609d1fddfcf67775d8fcdcc967df1fab0ba9d4b8a0ae3d23d7c39ee72f5c469fd1d447493006e0bd65e9f25fb833edac9999d8d25
7
- data.tar.gz: 22624b059608407a4066645c4917d82820f5c399ec09063503acc69c28afbc8fd2c495f5b7c2f9a508b7f526e56d5729a2e186b992a99fbc319cec85d0c854ba
6
+ metadata.gz: 022d379f95a38a8ec29374309fcf7c6306202867d74ef67fee377d648c0543675463847fc43134b8668a4f33547000d56690dae4cf41a16af37c83a2a0c01c36
7
+ data.tar.gz: 5e832cf45b8c946d840fab912b2ca4b2c34e550935104175facd968c848b263f0976bc632c919f9ac736b171472b168af931d2be31ea1bb0275c6b56b3f13fb1
@@ -1,25 +1,28 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # %w(
4
- # comparable compressible compressor configuration container enumerable
5
- # inspectable invalid_operation readers serializers stringifyable nodes
6
- # version
7
- # ).each do |file|
8
- # require File.join('rambling', 'trie', file)
9
- # end
10
- require 'rambling/trie/configuration'
11
- require 'rambling/trie/comparable'
12
- require 'rambling/trie/compressible'
13
- require 'rambling/trie/compressor'
14
- require 'rambling/trie/container'
15
- require 'rambling/trie/enumerable'
16
- require 'rambling/trie/inspectable'
17
- require 'rambling/trie/invalid_operation'
18
- require 'rambling/trie/readers'
19
- require 'rambling/trie/serializers'
20
- require 'rambling/trie/stringifyable'
21
- require 'rambling/trie/nodes'
22
- require 'rambling/trie/version'
3
+ if RUBY_ENGINE == 'opal'
4
+ require 'rambling/trie/configuration'
5
+ require 'rambling/trie/comparable'
6
+ require 'rambling/trie/compressible'
7
+ require 'rambling/trie/compressor'
8
+ require 'rambling/trie/container'
9
+ require 'rambling/trie/enumerable'
10
+ require 'rambling/trie/inspectable'
11
+ require 'rambling/trie/invalid_operation'
12
+ require 'rambling/trie/readers'
13
+ require 'rambling/trie/serializers'
14
+ require 'rambling/trie/stringifyable'
15
+ require 'rambling/trie/nodes'
16
+ require 'rambling/trie/version'
17
+ else
18
+ %w(
19
+ comparable compressible compressor configuration container enumerable
20
+ inspectable invalid_operation readers serializers stringifyable nodes
21
+ version
22
+ ).each do |file|
23
+ require File.join('rambling', 'trie', file)
24
+ end
25
+ end
23
26
 
24
27
  # General namespace for all Rambling gems.
25
28
  module Rambling
@@ -1,11 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # %w(properties provider_collection).each do |file|
4
- # require File.join('rambling', 'trie', 'configuration', file)
5
- # end
6
-
7
- require 'rambling/trie/configuration/properties'
8
- require 'rambling/trie/configuration/provider_collection'
3
+ if RUBY_ENGINE == 'opal'
4
+ require 'rambling/trie/configuration/properties'
5
+ require 'rambling/trie/configuration/provider_collection'
6
+ else
7
+ %w(properties provider_collection).each do |file|
8
+ require File.join('rambling', 'trie', 'configuration', file)
9
+ end
10
+ end
9
11
 
10
12
  module Rambling
11
13
  module Trie
@@ -59,15 +59,24 @@ module Rambling
59
59
  def reset_serializers
60
60
  marshal_serializer = Rambling::Trie::Serializers::Marshal.new
61
61
  yaml_serializer = Rambling::Trie::Serializers::Yaml.new
62
- # zip_serializer = Rambling::Trie::Serializers::Zip.new self
62
+ zip_serializer = Rambling::Trie::Serializers::Zip.new self unless RUBY_ENGINE == 'opal'
63
63
 
64
- @serializers = Rambling::Trie::Configuration::ProviderCollection.new(
65
- :serializer,
66
- marshal: marshal_serializer,
67
- yml: yaml_serializer,
68
- yaml: yaml_serializer,
69
- # zip: zip_serializer,
70
- )
64
+ if RUBY_ENGINE == 'opal'
65
+ @serializers = Rambling::Trie::Configuration::ProviderCollection.new(
66
+ :serializer,
67
+ marshal: marshal_serializer,
68
+ yml: yaml_serializer,
69
+ yaml: yaml_serializer,
70
+ )
71
+ else
72
+ @serializers = Rambling::Trie::Configuration::ProviderCollection.new(
73
+ :serializer,
74
+ marshal: marshal_serializer,
75
+ yml: yaml_serializer,
76
+ yaml: yaml_serializer,
77
+ zip: zip_serializer,
78
+ )
79
+ end
71
80
  end
72
81
  end
73
82
  end
@@ -1,13 +1,15 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # %w(node missing compressed raw).each do |file|
4
- # require File.join('rambling', 'trie', 'nodes', file)
5
- # end
6
-
7
- require 'rambling/trie/nodes/node'
8
- require 'rambling/trie/nodes/compressed'
9
- require 'rambling/trie/nodes/missing'
10
- require 'rambling/trie/nodes/raw'
3
+ if RUBY_ENGINE == 'opal'
4
+ require 'rambling/trie/nodes/node'
5
+ require 'rambling/trie/nodes/compressed'
6
+ require 'rambling/trie/nodes/missing'
7
+ require 'rambling/trie/nodes/raw'
8
+ else
9
+ %w(node missing compressed raw).each do |file|
10
+ require File.join('rambling', 'trie', 'nodes', file)
11
+ end
12
+ end
11
13
 
12
14
  module Rambling
13
15
  module Trie
@@ -1,10 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # %w(plain_text).each do |file|
4
- # require File.join('rambling', 'trie', 'readers', file)
5
- # end
6
-
7
- require 'rambling/trie/readers/plain_text'
3
+ if RUBY_ENGINE == 'opal'
4
+ require 'rambling/trie/readers/plain_text'
5
+ else
6
+ %w(plain_text).each do |file|
7
+ require File.join('rambling', 'trie', 'readers', file)
8
+ end
9
+ end
8
10
 
9
11
  module Rambling
10
12
  module Trie
@@ -1,13 +1,14 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # %w(file marshal yaml zip).each do |file|
4
- # require File.join('rambling', 'trie', 'serializers', file)
5
- # end
6
-
7
- require 'rambling/trie/serializers/file'
8
- require 'rambling/trie/serializers/marshal'
9
- require 'rambling/trie/serializers/yaml'
10
- # require 'rambling/trie/serializers/zip'
3
+ if RUBY_ENGINE == 'opal'
4
+ require 'rambling/trie/serializers/file'
5
+ require 'rambling/trie/serializers/marshal'
6
+ require 'rambling/trie/serializers/yaml'
7
+ else
8
+ %w(file marshal yaml zip).each do |file|
9
+ require File.join('rambling', 'trie', 'serializers', file)
10
+ end
11
+ end
11
12
 
12
13
  module Rambling
13
14
  module Trie
@@ -3,6 +3,6 @@
3
3
  module Rambling
4
4
  module Trie
5
5
  # Current version of the rambling-trie.
6
- VERSION = '2.1.1'
6
+ VERSION = '2.1.1.1'
7
7
  end
8
8
  end
@@ -4,11 +4,10 @@ $LOAD_PATH.push File.expand_path('../lib', __FILE__)
4
4
  require 'rambling/trie/version'
5
5
 
6
6
  Gem::Specification.new do |gem|
7
- gem.authors = ['Ribose Inc.']
8
- gem.email = ['open.source@ribose.com']
7
+ gem.authors = ['Ribose Open']
9
8
 
10
9
  gem.description = <<~DESCRIPTION.gsub(%r{\s+}, ' ')
11
- The original Rambling Trie gem but Opal-compatible.
10
+ The Rambling Trie Opal is an opal compatible version of rambling-trie gem.
12
11
  DESCRIPTION
13
12
 
14
13
  gem.summary = 'A Ruby implementation (Opal Compatible) of the trie data structure.'
@@ -65,23 +65,23 @@ describe Rambling::Trie do
65
65
  end
66
66
  end
67
67
 
68
- # context 'when serialized with zipped Ruby marshal format' do
69
- # before do
70
- # @original_on_exists_proc = ::Zip.on_exists_proc
71
- # @original_continue_on_exists_proc = ::Zip.continue_on_exists_proc
72
- # ::Zip.on_exists_proc = true
73
- # ::Zip.continue_on_exists_proc = true
74
- # end
68
+ context 'when serialized with zipped Ruby marshal format' do
69
+ before do
70
+ @original_on_exists_proc = ::Zip.on_exists_proc
71
+ @original_continue_on_exists_proc = ::Zip.continue_on_exists_proc
72
+ ::Zip.on_exists_proc = true
73
+ ::Zip.continue_on_exists_proc = true
74
+ end
75
75
 
76
- # after do
77
- # ::Zip.on_exists_proc = @original_on_exists_proc
78
- # ::Zip.continue_on_exists_proc = @original_continue_on_exists_proc
79
- # end
76
+ after do
77
+ ::Zip.on_exists_proc = @original_on_exists_proc
78
+ ::Zip.continue_on_exists_proc = @original_continue_on_exists_proc
79
+ end
80
80
 
81
- # it_behaves_like 'a serializable trie' do
82
- # let(:trie_to_serialize) { Rambling::Trie.create words_filepath }
83
- # let(:format) { 'marshal.zip' }
84
- # end
85
- # end
81
+ it_behaves_like 'a serializable trie' do
82
+ let(:trie_to_serialize) { Rambling::Trie.create words_filepath }
83
+ let(:format) { 'marshal.zip' }
84
+ end
85
+ end unless RUBY_ENGINE == 'opal'
86
86
  end
87
87
  end
@@ -8,14 +8,13 @@ describe Rambling::Trie::Configuration::Properties do
8
8
  describe '.new' do
9
9
  it 'configures the serializers' do
10
10
  serializers = properties.serializers
11
-
12
- expect(serializers.formats).to match_array %i(marshal yaml yml)
11
+ expect(serializers.formats).to match_array %i(marshal yaml yml zip) unless RUBY_ENGINE == 'opal'
13
12
  expect(serializers.providers.to_a).to match_array [
14
13
  [:marshal, Rambling::Trie::Serializers::Marshal],
15
14
  [:yaml, Rambling::Trie::Serializers::Yaml],
16
15
  [:yml, Rambling::Trie::Serializers::Yaml],
17
- # [:zip, Rambling::Trie::Serializers::Zip],
18
- ]
16
+ [:zip, Rambling::Trie::Serializers::Zip],
17
+ ] unless RUBY_ENGINE == 'opal'
19
18
  end
20
19
 
21
20
  it 'configures the readers' do
@@ -2,27 +2,27 @@
2
2
 
3
3
  require 'spec_helper'
4
4
 
5
- # describe Rambling::Trie::Serializers::Zip do
6
- # it_behaves_like 'a serializer' do
7
- # let(:properties) { Rambling::Trie::Configuration::Properties.new }
8
- # let(:serializer) { Rambling::Trie::Serializers::Zip.new properties }
9
- # let(:format) { 'marshal.zip' }
5
+ describe Rambling::Trie::Serializers::Zip do
6
+ it_behaves_like 'a serializer' do
7
+ let(:properties) { Rambling::Trie::Configuration::Properties.new }
8
+ let(:serializer) { Rambling::Trie::Serializers::Zip.new properties }
9
+ let(:format) { 'marshal.zip' }
10
10
 
11
- # before do
12
- # properties.tmp_path = tmp_path
13
- # end
11
+ before do
12
+ properties.tmp_path = tmp_path
13
+ end
14
14
 
15
- # let(:filename) { File.basename(filepath).gsub %r{\.zip}, '' }
16
- # let(:formatted_content) { zip Marshal.dump content }
15
+ let(:filename) { File.basename(filepath).gsub %r{\.zip}, '' }
16
+ let(:formatted_content) { zip Marshal.dump content }
17
17
 
18
- # def zip content
19
- # cursor = Zip::OutputStream.write_buffer do |io|
20
- # io.put_next_entry filename
21
- # io.write content
22
- # end
18
+ def zip content
19
+ cursor = Zip::OutputStream.write_buffer do |io|
20
+ io.put_next_entry filename
21
+ io.write content
22
+ end
23
23
 
24
- # cursor.rewind
25
- # cursor.read
26
- # end
27
- # end
28
- # end
24
+ cursor.rewind
25
+ cursor.read
26
+ end
27
+ end
28
+ end unless RUBY_ENGINE == 'opal'
metadata CHANGED
@@ -1,10 +1,10 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rambling-trie-opal
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1
4
+ version: 2.1.1.1
5
5
  platform: ruby
6
6
  authors:
7
- - Ribose Inc.
7
+ - Ribose Open
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
@@ -52,9 +52,9 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: 0.9.25
55
- description: 'The original Rambling Trie gem but Opal-compatible. '
56
- email:
57
- - open.source@ribose.com
55
+ description: 'The Rambling Trie Opal is an opal compatible version of rambling-trie
56
+ gem. '
57
+ email:
58
58
  executables: []
59
59
  extensions: []
60
60
  extra_rdoc_files: []