typical 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
  SHA1:
3
- metadata.gz: d39962302fd2b80a007d4c6212e8251144e7817f
4
- data.tar.gz: 595b2bc1838b0b136f4e34b4cd99eb912727e5b5
3
+ metadata.gz: cb05176839c8513b4234f98ff421ae047fd046e3
4
+ data.tar.gz: f5758f4801b2995bd4556c15d000f16f734edeea
5
5
  SHA512:
6
- metadata.gz: 146cd162336ae7042a4d32019cdbaf7c616f4daf2f8d80989cd271f9d17fecdbe64a34633ee1e038d3ede8f55fe3ea25594a386191c01f5c8d92b4af766bebb5
7
- data.tar.gz: 1db4dc5f3078c55e609a67591831e81f3397bd6fa62e8d5141cab24dc05d4c3e69e787370e4191c678cac006be371f48d3cadccf8af15ee5018ccc3f9de4dd69
6
+ metadata.gz: 3b2d8c2f47c4b2cda1437ea1db8e42202994c6b9b348757871681459559d3cc40eb7e42faac49e473d0446a8c2dffe37e74436f2843c8e7506892f06d5ad733c
7
+ data.tar.gz: d3de8660f195d962fa0db053c80fcf31d231590f70429800ec9a7c3b6b253c883165e6074fa68c5ca4215881d87536391fbbb5826c3125e106920dae899469f2
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- typical (0.1.0)
4
+ typical (0.1.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -9,8 +9,6 @@ GEM
9
9
  ansi (1.5.0)
10
10
  builder (3.2.3)
11
11
  minitest (5.10.2)
12
- minitest-around (0.4.0)
13
- minitest (~> 5.0)
14
12
  minitest-focus (1.1.2)
15
13
  minitest (>= 4, < 6)
16
14
  minitest-reporters (1.1.14)
@@ -30,7 +28,6 @@ PLATFORMS
30
28
  DEPENDENCIES
31
29
  bundler (~> 1.14)
32
30
  minitest (~> 5.0)
33
- minitest-around (~> 0.4)
34
31
  minitest-focus
35
32
  minitest-reporters
36
33
  minitest-sprint
@@ -2,10 +2,12 @@ require "typical/type"
2
2
 
3
3
  module Typical
4
4
  module DSL
5
- def self.define_scalar_type(mod, name = nil)
6
- name ||= mod.name
7
- define_method("#{name}!") { Type.new(mod) }
8
- define_method("#{name}?") { Type.new(mod) | null }
5
+ module Define
6
+ private def define_scalar_type(mod, name = nil)
7
+ name ||= mod.name.split("::").last
8
+ define_method("#{name}!") { Type.new(mod) }
9
+ define_method("#{name}?") { Type.new(mod) | null }
10
+ end
9
11
  end
10
12
 
11
13
  BUILTIN_SCALAR_TYPES = [
@@ -19,6 +21,7 @@ module Typical
19
21
  Time,
20
22
  ].freeze
21
23
 
24
+ extend Define
22
25
  BUILTIN_SCALAR_TYPES.each do |klass|
23
26
  define_scalar_type(klass)
24
27
  end
@@ -1,4 +1,3 @@
1
- require "typical/type"
2
1
  require "typical/type/union"
3
2
 
4
3
  module Typical
@@ -1,5 +1,3 @@
1
- require "typical/type"
2
-
3
1
  module Typical
4
2
  class Type
5
3
  class Reference < Type
@@ -1,5 +1,3 @@
1
- require "typical/type"
2
-
3
1
  module Typical
4
2
  class Type
5
3
  class Union < Type
@@ -1,3 +1,3 @@
1
1
  module Typical
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -21,7 +21,6 @@ Gem::Specification.new do |spec|
21
21
  spec.add_development_dependency "bundler", "~> 1.14"
22
22
  spec.add_development_dependency "rake", "~> 10.0"
23
23
  spec.add_development_dependency "minitest", "~> 5.0"
24
- spec.add_development_dependency "minitest-around", "~> 0.4"
25
24
  spec.add_development_dependency "minitest-reporters"
26
25
  spec.add_development_dependency "minitest-sprint"
27
26
  spec.add_development_dependency "minitest-focus"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: typical
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
  - Eloy Durán
@@ -52,20 +52,6 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '5.0'
55
- - !ruby/object:Gem::Dependency
56
- name: minitest-around
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - "~>"
60
- - !ruby/object:Gem::Version
61
- version: '0.4'
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - "~>"
67
- - !ruby/object:Gem::Version
68
- version: '0.4'
69
55
  - !ruby/object:Gem::Dependency
70
56
  name: minitest-reporters
71
57
  requirement: !ruby/object:Gem::Requirement