typespec 0.1.0.6 → 0.1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/typespec.rb +6 -3
- data/lib/typespec/gem.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 119a78d55a6883427d8a309f492bf5b0b4a0ec27
|
4
|
+
data.tar.gz: 2d93ed4b2b71ef92a392788b240737790bae613f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bd6c90fe94c6dcc5fc45189badfe3aa996032bc29acdf8b54ece851e1467ad1593fac1dc7c01b215415f2b26020d746f28f5d3982de3fe5f82cf858ca37b6154
|
7
|
+
data.tar.gz: 65dc8ed51f8dfd2b0288018ee5cdeaede4075ed0cb5b2ba0d52cf4c68f6e73fb4ae0d055540e80c8e01550621ef236266f638481207ebaabdcf84690cce506d8
|
data/lib/typespec.rb
CHANGED
@@ -7,7 +7,10 @@ module Typespec
|
|
7
7
|
# TODO(mtwilliams): Document this monstrosity.
|
8
8
|
|
9
9
|
# ...
|
10
|
-
def self.
|
10
|
+
def self.nothing; Typespec.nil; end
|
11
|
+
|
12
|
+
# ...
|
13
|
+
def self.anything; Typespec::Any; end
|
11
14
|
|
12
15
|
# ...
|
13
16
|
class Any
|
@@ -97,7 +100,7 @@ module Typespec
|
|
97
100
|
class Hash
|
98
101
|
def initialize(pairs={})
|
99
102
|
@pairs = pairs
|
100
|
-
@pairs = {Typespec.
|
103
|
+
@pairs = {Typespec.anything => Typespec.anything} if @pairs.nil? or @pairs.empty?
|
101
104
|
end
|
102
105
|
|
103
106
|
def self.[](pairs={})
|
@@ -124,7 +127,7 @@ module Typespec
|
|
124
127
|
class Struct
|
125
128
|
def initialize(*properties, **properties_with_spec)
|
126
129
|
if !properties.empty?
|
127
|
-
@properties = Hash[properties.map{|name| [name, Typespec.
|
130
|
+
@properties = Hash[properties.map{|name| [name, Typespec.anything]}]
|
128
131
|
elsif properties_with_spec
|
129
132
|
@properties = properties_with_spec
|
130
133
|
else
|
data/lib/typespec/gem.rb
CHANGED