litl 0.1.0 → 0.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: 91ca010a8e051e74550f0c7a97a213b506c4af4ab8e074109b5038f1ca12e604
4
- data.tar.gz: e3b43943c7eed36b0b620bb6e5fefcb30061c524c444682d07e47743139ae4f5
3
+ metadata.gz: 68bb57bc7df0262dfadaab96a834ae23fb7dd48c0e5131a693f31029cfbb5ccf
4
+ data.tar.gz: 7b45dc299cf2f13f66811be2afda5eb87f843e59c2aeecd5a0ca6b8507a276fc
5
5
  SHA512:
6
- metadata.gz: e46d9e27b544ff868ddb0745c7fa86a6af2f1d099556ecebf2d5706843074391ccbb8378fb72d1ce63af0a8f1e87e95fd5897403a0ef10b61551f31a3c353ea0
7
- data.tar.gz: 9795fbb6dad81644375ae5b6fa15c8ad890fc8e28e476dd309b8791587a3059a2ff3a2910e297dc9757c5abb64cf09ebcba718fd5636fb8c445a0b15fb01ae27
6
+ metadata.gz: fb70eb5b2e4f071ed19366c795ad5e5ae124336353b8b32ac17543aa30282f582ff08c81b598b98b9beff5876fb21885c09eef4ab8d5695eca0bafe5b8f9c6c7
7
+ data.tar.gz: 869ccbdca4f870c66f94eb763aa35114d88259e7f1e55986e39a6465738d2bf8d083e82ff0a8a981775782232cbb076c99e82293bfc597e966259c08b794f38e
@@ -1,8 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- litl (0.1.0)
5
- litl-parser (= 0.1.0)
4
+ litl (0.1.1)
5
+ litl-parser (= 0.1.1)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
@@ -19,7 +19,7 @@ GEM
19
19
  docile (1.3.2)
20
20
  jaro_winkler (1.5.4)
21
21
  json (2.3.0)
22
- litl-parser (0.1.0)
22
+ litl-parser (0.1.1)
23
23
  method_source (0.9.2)
24
24
  parallel (1.19.1)
25
25
  parser (2.7.0.4)
@@ -143,7 +143,8 @@ module LIT
143
143
  elsif type == AST::Type::Primitive::String ||
144
144
  type == AST::Type::Primitive::Integer ||
145
145
  type == AST::Type::Primitive::Float ||
146
- type == AST::Type::Primitive::Boolean
146
+ type == AST::Type::Primitive::Boolean ||
147
+ type == AST::Type::Primitive::Unit
147
148
  Module.new
148
149
  elsif type.is_a?(AST::Type::Alias)
149
150
  target_module = @target_module
@@ -36,7 +36,8 @@ module LIT
36
36
  elsif type == AST::Type::Primitive::String ||
37
37
  type == AST::Type::Primitive::Integer ||
38
38
  type == AST::Type::Primitive::Float ||
39
- type == AST::Type::Primitive::Boolean
39
+ type == AST::Type::Primitive::Boolean ||
40
+ type == AST::Type::Primitive::Unit
40
41
  payload
41
42
  else
42
43
  deserialize(type::TYPE, payload)
@@ -34,7 +34,8 @@ module LIT
34
34
  object.is_a?(Integer) ||
35
35
  object.is_a?(Float) ||
36
36
  object == true ||
37
- object == false
37
+ object == false ||
38
+ object.nil?
38
39
  object
39
40
  else
40
41
  raise InvalidObjectError, "invalid object: #{object}"
@@ -48,6 +48,10 @@ module LIT
48
48
  unless value == true || value == false
49
49
  raise TypeError, "expected #{value} to be a Boolean"
50
50
  end
51
+ elsif type == AST::Type::Primitive::Unit
52
+ unless value.nil?
53
+ raise TypeError, "expected #{value} to be a Unit (nil)"
54
+ end
51
55
  elsif type.is_a?(AST::Type::Primitive::Option)
52
56
  if value.is_a?(::LIT::Object::Option::Some)
53
57
  check_primitive_type!(type.type, value.value)
@@ -5,5 +5,5 @@ module LIT
5
5
  #
6
6
  # @api public
7
7
  # @since 0.1.0
8
- VERSION = "0.1.0"
8
+ VERSION = "0.1.1"
9
9
  end
@@ -26,7 +26,7 @@ Gem::Specification.new do |spec|
26
26
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
27
27
  spec.require_paths = %w[lib]
28
28
 
29
- spec.add_dependency "litl-parser", "0.1.0"
29
+ spec.add_dependency "litl-parser", LIT::VERSION
30
30
 
31
31
  spec.add_development_dependency "bundler", "~> 2.1"
32
32
  spec.add_development_dependency "rake", "~> 13.0"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: litl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2020-07-28 00:00:00.000000000 Z
12
+ date: 2020-07-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: litl-parser
@@ -17,14 +17,14 @@ dependencies:
17
17
  requirements:
18
18
  - - '='
19
19
  - !ruby/object:Gem::Version
20
- version: 0.1.0
20
+ version: 0.1.1
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - '='
26
26
  - !ruby/object:Gem::Version
27
- version: 0.1.0
27
+ version: 0.1.1
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: bundler
30
30
  requirement: !ruby/object:Gem::Requirement