mongo-ejson 0.2.1 → 0.2.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
2
  SHA256:
3
- metadata.gz: 7fe75002ec17489608405072b1cf5e19643bce4732f97fc74c42a7d4c77f331a
4
- data.tar.gz: 9ffd4f54c57599d7c97081f6fdf7ee27bd3075bb7ae95cf659910d9e20f1a8af
3
+ metadata.gz: 3b1a8b0a13a6a23d0d082bbdc5c9c5ba6ed6b642831bd6d4ed06477c43a0dbb9
4
+ data.tar.gz: 9d2cbdd8fd9da0154d34f3cb196438e41edb1dbb1ab5ebc019cacf9b250361b4
5
5
  SHA512:
6
- metadata.gz: 4def483883272fd0938a362fd6edd41131f4b9e633aefca1ab3b2f793f9078730eb0026e0010cc602c4152b68faa52a02edb790bef5a6951a714880d32135c9a
7
- data.tar.gz: 17cf8d185b2dcfa62e654b6752cba2f0ebd4eba6c0e2665b98117b19698c72786f035ed23f950d4b9abe059c2f4d38527587c12276487ddb9e57ca2e8180c38d
6
+ metadata.gz: b3e75374ea2acd4d42e9fda8f87f2f367995d3d314f714d354be6973b99d7479ac5c6d096a3107570e96974f9473f9af09114a98842ed26c9a1633ac90223823
7
+ data.tar.gz: 056d295d55e218c3b9813e59bb1af30e845eda19cf494f8cf5a0451224a622e7a675313958c990b0d3b907c5f9a148c8fc8b9424154f8381674a903007ff1892
data/.rubocop.yml ADDED
@@ -0,0 +1,34 @@
1
+ inherit_from: .rubocop_todo.yml
2
+
3
+ AllCops:
4
+ Exclude:
5
+ - 'src/**/*'
6
+ - 'vendor/bundle/**/*'
7
+
8
+ Metrics/LineLength:
9
+ Max: 120
10
+
11
+ Layout/EndOfLine:
12
+ EnforcedStyle: lf
13
+
14
+ Style/SymbolArray:
15
+ EnforcedStyle: brackets
16
+
17
+ Style/TrailingCommaInHashLiteral:
18
+ EnforcedStyleForMultiline: consistent_comma
19
+
20
+ Style/EmptyMethod:
21
+ EnforcedStyle: expanded
22
+
23
+ Metrics/BlockLength:
24
+ Exclude:
25
+ - '*.gemspec'
26
+ ExcludedMethods:
27
+ - describe
28
+
29
+ Style/FrozenStringLiteralComment:
30
+ EnforcedStyle: when_needed
31
+
32
+ Layout/AlignHash:
33
+ EnforcedHashRocketStyle: table
34
+ EnforcedColonStyle: table
data/.rubocop_todo.yml ADDED
@@ -0,0 +1,13 @@
1
+ # This configuration was generated by
2
+ # `rubocop --auto-gen-config`
3
+ # on 2019-02-07 17:38:30 +0300 using RuboCop version 0.63.1.
4
+ # The point is for the user to remove these configuration records
5
+ # one by one as the offenses are removed from the code base.
6
+ # Note that changes in the inspected code, or installation of new
7
+ # versions of RuboCop, may require this file to be generated again.
8
+
9
+ Style/FrozenStringLiteralComment:
10
+ Enabled: false
11
+
12
+ Style/Documentation:
13
+ Enabled: false
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.6.1
data/.travis.yml CHANGED
@@ -6,4 +6,10 @@ rvm:
6
6
  - 2.6
7
7
  - 2.5
8
8
  - jruby-9.2
9
- before_install: gem install bundler -v 2.0.1
9
+
10
+ before_install:
11
+ - gem install bundler -v 2.0.1
12
+
13
+ script:
14
+ - bundle exec rspec
15
+ - bundle exec rubocop
data/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
- source "https://rubygems.org"
1
+ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in mongo-ejson.gemspec
4
4
  gemspec
data/Gemfile.lock CHANGED
@@ -1,14 +1,21 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- mongo-ejson (0.2.1)
4
+ mongo-ejson (0.2.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
+ ast (2.4.0)
9
10
  bson (4.4.2)
10
11
  bson (4.4.2-java)
11
12
  diff-lcs (1.3)
13
+ jaro_winkler (1.5.2)
14
+ parallel (1.13.0)
15
+ parser (2.6.0.0)
16
+ ast (~> 2.4.0)
17
+ powerpack (0.1.2)
18
+ rainbow (3.0.0)
12
19
  rake (10.5.0)
13
20
  rspec (3.8.0)
14
21
  rspec-core (~> 3.8.0)
@@ -23,6 +30,16 @@ GEM
23
30
  diff-lcs (>= 1.2.0, < 2.0)
24
31
  rspec-support (~> 3.8.0)
25
32
  rspec-support (3.8.0)
33
+ rubocop (0.63.1)
34
+ jaro_winkler (~> 1.5.1)
35
+ parallel (~> 1.10)
36
+ parser (>= 2.5, != 2.5.1.1)
37
+ powerpack (~> 0.1)
38
+ rainbow (>= 2.2.2, < 4.0)
39
+ ruby-progressbar (~> 1.7)
40
+ unicode-display_width (~> 1.4.0)
41
+ ruby-progressbar (1.10.0)
42
+ unicode-display_width (1.4.1)
26
43
 
27
44
  PLATFORMS
28
45
  java
@@ -34,6 +51,7 @@ DEPENDENCIES
34
51
  mongo-ejson!
35
52
  rake (~> 10.0)
36
53
  rspec (~> 3.0)
54
+ rubocop (~> 0.63)
37
55
 
38
56
  BUNDLED WITH
39
57
  2.0.1
data/Rakefile CHANGED
@@ -1,26 +1,26 @@
1
- require "bundler/gem_tasks"
2
- require "rspec/core/rake_task"
1
+ require 'bundler/gem_tasks'
2
+ require 'rspec/core/rake_task'
3
3
  require 'fileutils'
4
4
 
5
5
  CANOPY_BIN = ENV.fetch('CANOPY_BIN') { 'canopy' }
6
6
 
7
7
  RSpec::Core::RakeTask.new(:spec)
8
8
 
9
- task :default => :spec
9
+ task default: :spec
10
10
 
11
11
  task :compile_js do
12
- sh %{ #{CANOPY_BIN} src/ejson.peg --lang javascript }
12
+ sh %( #{CANOPY_BIN} src/ejson.peg --lang javascript )
13
13
  end
14
14
 
15
15
  task :compile_ruby do
16
- sh %{ #{CANOPY_BIN} src/ejson.peg --lang ruby }
16
+ sh %( #{CANOPY_BIN} src/ejson.peg --lang ruby )
17
17
  end
18
18
 
19
- desc "Build and run test suite"
20
- task :test => [:compile_ruby, :spec] do
19
+ desc 'Build and run test suite'
20
+ task test: [:compile_ruby, :spec] do
21
21
  end
22
22
 
23
- desc "Prepare assets"
24
- task :assets => [:test, :compile_js] do
23
+ desc 'Prepare assets'
24
+ task assets: [:test, :compile_js] do
25
25
  mv 'src/ejson.js', 'vendor/assets/javascripts/ejson.js'
26
26
  end
data/bin/console CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require "bundler/setup"
4
- require "ejson"
3
+ require 'bundler/setup'
4
+ require 'ejson'
5
5
 
6
6
  # You can add fixtures and/or initialization code here to make experimenting
7
7
  # with your gem easier. You can also use a different console, if you like.
@@ -10,5 +10,5 @@ require "ejson"
10
10
  # require "pry"
11
11
  # Pry.start
12
12
 
13
- require "irb"
13
+ require 'irb'
14
14
  IRB.start(__FILE__)
data/ejson.gemspec CHANGED
@@ -1,46 +1,47 @@
1
-
2
- lib = File.expand_path("../lib", __FILE__)
1
+ lib = File.expand_path('lib', __dir__)
3
2
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require "ejson/version"
3
+ require 'ejson/version'
5
4
 
6
5
  Gem::Specification.new do |spec|
7
- spec.name = "mongo-ejson"
6
+ spec.name = 'mongo-ejson'
8
7
  spec.version = EJSON::VERSION
9
- spec.authors = ["Alex Bondar"]
10
- spec.email = ["mongo-ejson-gem@db-ai.co"]
8
+ spec.authors = ['Alex Bondar']
9
+ spec.email = ['mongo-ejson-gem@db-ai.co']
11
10
 
12
- spec.summary = %q{MongoDB Extended JS(ON) parser}
13
- spec.description = %q{Parses MongoDB favoured JS(ON) string into objects}
14
- spec.homepage = "https://gibhub.com/db-ai/mongo-ejson"
11
+ spec.summary = 'MongoDB Extended JS(ON) parser'
12
+ spec.description = 'Parses MongoDB favoured JS(ON) string into objects'
13
+ spec.homepage = 'https://gibhub.com/db-ai/mongo-ejson'
15
14
 
16
15
  # Prevent pushing this gem to RubyGems.org. To allow pushes either set the
17
16
  # 'allowed_push_host' to allow pushing to a single host or delete this
18
17
  # section to allow pushing to any host.
19
18
  if spec.respond_to?(:metadata)
20
- spec.metadata["allowed_push_host"] = "https://rubygems.org/"
19
+ spec.metadata['allowed_push_host'] = 'https://rubygems.org/'
21
20
 
22
- spec.metadata["homepage_uri"] = spec.homepage
23
- spec.metadata["source_code_uri"] = "https://gibhub.com/db-ai/mongo-ejson"
24
- spec.metadata["changelog_uri"] = "https://gibhub.com/db-ai/mongo-ejson"
21
+ spec.metadata['homepage_uri'] = spec.homepage
22
+ spec.metadata['source_code_uri'] = 'https://gibhub.com/db-ai/mongo-ejson'
23
+ spec.metadata['changelog_uri'] = 'https://gibhub.com/db-ai/mongo-ejson'
25
24
  else
26
- raise "RubyGems 2.0 or newer is required to protect against " \
27
- "public gem pushes."
25
+ raise 'RubyGems 2.0 or newer is required to protect against ' \
26
+ 'public gem pushes.'
28
27
  end
29
28
 
30
29
  # Specify which files should be added to the gem when it is released.
31
30
  # The `git ls-files -z` loads the files in the RubyGem that have been
32
31
  # added into git.
33
- spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
32
+ spec.files = Dir.chdir(File.expand_path(__dir__)) do
34
33
  `git ls-files -z`
35
34
  .split("\x0")
36
35
  .reject { |f| f.match(%r{^(test|spec|features)/}) }
37
36
  end
38
- spec.bindir = "exe"
37
+ spec.bindir = 'exe'
39
38
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
40
- spec.require_paths = ["lib"]
39
+ spec.require_paths = ['lib']
40
+
41
+ spec.add_development_dependency 'bundler', '~> 2.0'
42
+ spec.add_development_dependency 'rake', '~> 10.0'
43
+ spec.add_development_dependency 'rspec', '~> 3.0'
44
+ spec.add_development_dependency 'rubocop', '~> 0.63'
41
45
 
42
- spec.add_development_dependency "bundler", "~> 2.0"
43
- spec.add_development_dependency "rake", "~> 10.0"
44
- spec.add_development_dependency "rspec", "~> 3.0"
45
- spec.add_development_dependency "bson"
46
+ spec.add_development_dependency 'bson'
46
47
  end
data/lib/ejson.rb CHANGED
@@ -23,14 +23,20 @@ class EJSON
23
23
  end
24
24
 
25
25
  private
26
+
26
27
  def boot_bson
27
28
  return if defined? ::BSON
28
- require 'bson' rescue nil
29
29
 
30
- unless defined? ::BSON
31
- raise "Can't find constant ::BSON. Seems like gem 'bson' is not " \
32
- "loaded. Make sure it's available in your bundle."
30
+ begin
31
+ require 'bson'
32
+ rescue StandardError
33
+ nil
33
34
  end
35
+
36
+ return if defined? ::BSON
37
+
38
+ raise "Can't find constant ::BSON. Seems like gem 'bson' is not " \
39
+ "loaded. Make sure it's available in your bundle."
34
40
  end
35
41
  end
36
42
  end
@@ -1,37 +1,37 @@
1
1
  module ParserAction
2
2
  module AbstractJSON
3
3
  # JSON Entities
4
- def make_root(input, start, _end, elements)
4
+ def make_root(input, starts_at, _ends_at, elements)
5
5
  end
6
6
 
7
- def make_object(input, start, _end, elements)
7
+ def make_object(input, starts_at, _ends_at, elements)
8
8
  end
9
9
 
10
- def make_pair(input, start, _end, elements)
10
+ def make_pair(input, starts_at, _ends_at, elements)
11
11
  end
12
12
 
13
- def make_empty_object(input, start, _end, elements)
13
+ def make_empty_object(input, starts_at, _ends_at, elements)
14
14
  end
15
15
 
16
- def make_string(input, start, _end, elements)
16
+ def make_string(input, starts_at, _ends_at, elements)
17
17
  end
18
18
 
19
- def make_array(input, start, _end, elements)
19
+ def make_array(input, starts_at, _ends_at, elements)
20
20
  end
21
21
 
22
- def make_empty_array(input, start, _end, elements)
22
+ def make_empty_array(input, starts_at, _ends_at, elements)
23
23
  end
24
24
 
25
- def make_number(input, start, _end, elements)
25
+ def make_number(input, starts_at, _ends_at, elements)
26
26
  end
27
27
 
28
- def make_null(input, start, _end)
28
+ def make_null(input, starts_at, _ends_at)
29
29
  end
30
30
 
31
- def make_true(input, start, _end)
31
+ def make_true(input, starts_at, _ends_at)
32
32
  end
33
33
 
34
- def make_false(input, start, _end)
34
+ def make_false(input, starts_at, _ends_at)
35
35
  end
36
36
  end
37
37
  end
@@ -1,36 +1,36 @@
1
1
  module ParserAction
2
2
  module AbstractMongo
3
- def make_object_id(input, start, _end, elements)
3
+ def make_object_id(input, starts_at, _ends_at, elements)
4
4
  end
5
5
 
6
- def make_bin_data(input, start, _end, elements)
6
+ def make_bin_data(input, starts_at, _ends_at, elements)
7
7
  end
8
8
 
9
- def make_timestamp(input, start, _end, elements)
9
+ def make_timestamp(input, starts_at, _ends_at, elements)
10
10
  end
11
11
 
12
- def make_number_long(input, start, _end, elements)
12
+ def make_number_long(input, starts_at, _ends_at, elements)
13
13
  end
14
14
 
15
- def make_number_decimal(input, start, _end, elements)
15
+ def make_number_decimal(input, starts_at, _ends_at, elements)
16
16
  end
17
17
 
18
- def make_date(input, start, _end, elements)
18
+ def make_date(input, starts_at, _ends_at, elements)
19
19
  end
20
20
 
21
- def make_regexp(input, start, _end, elements)
21
+ def make_regexp(input, starts_at, _ends_at, elements)
22
22
  end
23
23
 
24
- def make_db_ref(input, start, _end, elements)
24
+ def make_db_ref(input, starts_at, _ends_at, elements)
25
25
  end
26
26
 
27
- def make_min_key(input, start, _end)
27
+ def make_min_key(input, starts_at, _ends_at)
28
28
  end
29
29
 
30
- def make_max_key(input, start, _end)
30
+ def make_max_key(input, starts_at, _ends_at)
31
31
  end
32
32
 
33
- def make_undefined(input, start, _end)
33
+ def make_undefined(input, starts_at, _ends_at)
34
34
  end
35
35
  end
36
36
  end
@@ -2,59 +2,57 @@ require 'ejson/parser_action/ruby'
2
2
 
3
3
  module ParserAction
4
4
  class BSON < ParserAction::Ruby
5
- def make_object_id(input, start, _end, elements)
5
+ def make_object_id(_input, _starts_at, _ends_at, elements)
6
6
  value = elements.first
7
7
 
8
8
  ::BSON::ObjectId.from_string(value)
9
9
  end
10
10
 
11
11
  NUMBER_TO_TYPE = {
12
- 0 => :generic,
13
- 1 => :function,
14
- 2 => :old,
15
- 3 => :uuid_old,
16
- 4 => :uuid,
17
- 5 => :md5,
18
- 128 => :user,
19
- }
20
-
21
- def make_bin_data(input, start, _end, elements)
12
+ 0 => :generic,
13
+ 1 => :function,
14
+ 2 => :old,
15
+ 3 => :uuid_old,
16
+ 4 => :uuid,
17
+ 5 => :md5,
18
+ 128 => :user,
19
+ }.freeze
20
+
21
+ def make_bin_data(_input, _starts_at, _ends_at, elements)
22
22
  data = elements.last
23
23
  type = elements.first
24
24
 
25
- if type.is_a? Numeric
26
- type = NUMBER_TO_TYPE[type]
27
- end
25
+ type = NUMBER_TO_TYPE[type] if type.is_a? Numeric
28
26
 
29
27
  ::BSON::Binary.new(data, type.to_sym)
30
28
  end
31
29
 
32
- def make_timestamp(input, start, _end, elements)
30
+ def make_timestamp(_input, _starts_at, _ends_at, elements)
33
31
  ::BSON::Timestamp.new(elements.first, elements.last)
34
32
  end
35
33
 
36
- def make_number_decimal(input, start, _end, elements)
34
+ def make_number_decimal(_input, _starts_at, _ends_at, elements)
37
35
  value = elements.first
38
36
 
39
37
  ::BSON::Decimal128.new(value.to_s)
40
38
  end
41
39
 
42
- def make_db_ref(input, start, _end, elements)
40
+ def make_db_ref(_input, _starts_at, _ends_at, elements)
43
41
  {
44
- "$ref": elements.first,
45
- "$id": elements.last,
42
+ "$ref": elements.first,
43
+ "$id": elements.last,
46
44
  }
47
45
  end
48
46
 
49
- def make_min_key(input, start, _end)
47
+ def make_min_key(_input, _starts_at, _ends_at)
50
48
  ::BSON::MinKey
51
49
  end
52
50
 
53
- def make_max_key(input, start, _end)
51
+ def make_max_key(_input, _starts_at, _ends_at)
54
52
  ::BSON::MaxKey
55
53
  end
56
54
 
57
- def make_undefined(input, start, _end)
55
+ def make_undefined(_input, _starts_at, _ends_at)
58
56
  ::BSON::Undefined
59
57
  end
60
58
  end
@@ -3,15 +3,19 @@ require 'date'
3
3
 
4
4
  module ParserAction
5
5
  class Ruby < ParserAction::Abstract
6
- def make_root(input, start, _end, elements)
6
+ UNICODE_ESCAPER = proc { |s|
7
+ format('\u%04X', s.codepoints[0])
8
+ }
9
+
10
+ def make_root(_input, _starts_at, _ends_at, elements)
7
11
  elements.first
8
12
  end
9
13
 
10
- def make_object(input, start, _end, elements)
14
+ def make_object(_input, _starts_at, _ends_at, elements)
11
15
  first_pair = elements.first
12
16
  other_pairs = elements.last
13
17
 
14
- object = {first_pair[0] => first_pair[1]}
18
+ object = { first_pair[0] => first_pair[1] }
15
19
  other_pairs.each do |element|
16
20
  pair = element.pair
17
21
  object[pair.first] = pair.last
@@ -20,60 +24,61 @@ module ParserAction
20
24
  object
21
25
  end
22
26
 
23
- def make_pair(input, start, _end, elements)
27
+ def make_pair(_input, _starts_at, _ends_at, elements)
24
28
  elements
25
29
  end
26
30
 
27
- def make_empty_object(input, start, _end, elements)
31
+ def make_empty_object(_input, _starts_at, _ends_at, _elements)
28
32
  {}
29
33
  end
30
34
 
31
- def make_string(input, start, _end, elements)
32
- %Q|"#{elements.first.text}"|.undump
35
+ def make_string(_input, _starts_at, _ends_at, elements)
36
+ quoted_string = %("#{elements.first.text}")
37
+ quoted_string.encode('ASCII', fallback: UNICODE_ESCAPER).undump
33
38
  end
34
39
 
35
- def make_numeric_string(input, start, _end, elements)
40
+ def make_numeric_string(_input, _starts_at, _ends_at, elements)
36
41
  elements.first
37
42
  end
38
43
 
39
- def make_number_as_string(input, start, _end, elements)
40
- string = input[start..._end]
44
+ def make_number_as_string(input, starts_at, ends_at, _elements)
45
+ string = input[starts_at...ends_at]
41
46
  string.downcase!
42
47
 
43
48
  string
44
49
  end
45
50
 
46
- def make_array(input, start, _end, elements)
51
+ def make_array(_input, _starts_at, _ends_at, elements)
47
52
  list = [elements[0]]
48
53
  elements[1].each { |el| list << el.value }
49
54
  list
50
55
  end
51
56
 
52
- def make_empty_array(input, start, _end, elements)
57
+ def make_empty_array(_input, _starts_at, _ends_at, _elements)
53
58
  []
54
59
  end
55
60
 
56
- def make_number(input, start, _end, elements)
57
- string = input[start..._end]
61
+ def make_number(input, starts_at, ends_at, _elements)
62
+ string = input[starts_at...ends_at]
58
63
  string.downcase!
59
64
 
60
65
  _number_from_string(string)
61
66
  end
62
67
 
63
- def make_null(input, start, _end)
68
+ def make_null(_input, _starts_at, _ends_at)
64
69
  nil
65
70
  end
66
71
 
67
- def make_true(input, start, _end)
72
+ def make_true(_input, _starts_at, _ends_at)
68
73
  true
69
74
  end
70
75
 
71
- def make_false(input, start, _end)
76
+ def make_false(_input, _starts_at, _ends_at)
72
77
  false
73
78
  end
74
79
 
75
80
  # Makes ruby date from mongo Data type
76
- def make_date(input, start, _end, elements)
81
+ def make_date(_input, _starts_at, _ends_at, elements)
77
82
  value = elements.first
78
83
 
79
84
  case value
@@ -87,20 +92,18 @@ module ParserAction
87
92
  end
88
93
  end
89
94
 
90
- def make_regexp(input, start, _end, elements)
95
+ def make_regexp(_input, _starts_at, _ends_at, elements)
91
96
  Regexp.new(elements.first.text, elements.last.text)
92
97
  end
93
98
 
94
- def make_number_long(input, start, _end, elements)
95
- value = elements.first
99
+ def make_number_long(_input, _starts_at, _ends_at, elements)
100
+ elements.first
96
101
  end
97
102
 
98
103
  private
99
104
 
100
105
  def _number_from_string(string)
101
- if string.include? 'e'
102
- return Float(string)
103
- end
106
+ return Float(string) if string.include? 'e'
104
107
 
105
108
  if string.include? '.'
106
109
  string.to_f
@@ -4,40 +4,40 @@ require 'bigdecimal'
4
4
 
5
5
  module ParserAction
6
6
  class Wrap < ParserAction::Ruby
7
- def make_object_id(input, start, _end, elements)
7
+ def make_object_id(_input, _starts_at, _ends_at, elements)
8
8
  value = elements.first
9
9
 
10
10
  ::Wrap::ObjectId.new(value)
11
11
  end
12
12
 
13
- def make_bin_data(input, start, _end, elements)
13
+ def make_bin_data(_input, _starts_at, _ends_at, elements)
14
14
  data = elements.last
15
15
  type = elements.first
16
16
 
17
17
  ::Wrap::BinData.new(type, data)
18
18
  end
19
19
 
20
- def make_timestamp(input, start, _end, elements)
20
+ def make_timestamp(_input, _starts_at, _ends_at, elements)
21
21
  ::Wrap::Timestamp.new(elements.first, elements.last)
22
22
  end
23
23
 
24
- def make_number_decimal(input, start, _end, elements)
24
+ def make_number_decimal(_input, _starts_at, _ends_at, elements)
25
25
  BigDecimal(elements.first)
26
26
  end
27
27
 
28
- def make_db_ref(input, start, _end, elements)
28
+ def make_db_ref(_input, _starts_at, _ends_at, elements)
29
29
  ::Wrap::DBRef.new(elements.first, elements.last)
30
30
  end
31
31
 
32
- def make_min_key(input, start, _end)
32
+ def make_min_key(_input, _starts_at, _ends_at)
33
33
  ::Wrap::MinKey
34
34
  end
35
35
 
36
- def make_max_key(input, start, _end)
36
+ def make_max_key(_input, _starts_at, _ends_at)
37
37
  ::Wrap::MaxKey
38
38
  end
39
39
 
40
- def make_undefined(input, start, _end)
40
+ def make_undefined(_input, _starts_at, _ends_at)
41
41
  ::Wrap::Undefined
42
42
  end
43
43
  end
@@ -3,9 +3,9 @@ module Wrap
3
3
  MaxKey = Class.new
4
4
  Undefined = Class.new
5
5
 
6
- ObjectId = Struct.new("ObjectId", :hex)
7
- BinData = Struct.new("BinData", :type, :data)
8
- Timestamp = Struct.new("Timestamp", :timestamp, :fraction)
6
+ ObjectId = Struct.new('ObjectId', :hex)
7
+ BinData = Struct.new('BinData', :type, :data)
8
+ Timestamp = Struct.new('Timestamp', :timestamp, :fraction)
9
9
 
10
- DBRef = Struct.new("DBRef", :name, :id)
10
+ DBRef = Struct.new('DBRef', :name, :id)
11
11
  end
data/lib/ejson/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class EJSON
2
- VERSION = "0.2.1"
2
+ VERSION = '0.2.2'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongo-ejson
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Bondar
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-02-06 00:00:00.000000000 Z
11
+ date: 2019-06-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '3.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rubocop
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '0.63'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '0.63'
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: bson
57
71
  requirement: !ruby/object:Gem::Requirement
@@ -75,6 +89,9 @@ extra_rdoc_files: []
75
89
  files:
76
90
  - ".gitignore"
77
91
  - ".rspec"
92
+ - ".rubocop.yml"
93
+ - ".rubocop_todo.yml"
94
+ - ".ruby-version"
78
95
  - ".travis.yml"
79
96
  - Gemfile
80
97
  - Gemfile.lock