contracts-gen 0.1.0 → 0.1.1
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/contracts-gen.gemspec +1 -0
- data/lib/contracts/builtin_ext.rb +1 -1
- data/lib/contracts/gen.rb +3 -8
- data/lib/contracts/gen/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 93ad2b2ed24190ae6cb767954dcab7e7220df0ca8af2ef15480e7e0b3dd380b6
|
4
|
+
data.tar.gz: d30906671b202b6551d6e57cb5fd67614b4f25a214d3fe60936f86f04faf73ee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bb650893b8f7309a7cd10b983dd4aeaa9e919bec616f67bf7827ceb905e65188f672ce69c408f69c03038fbe7400fa9e76e066991e35b6e4a2842e5235309bfe
|
7
|
+
data.tar.gz: 5e524432246e0f0dd7317eb2187d729e306bd6b84d4c8756f48ac1298e48ff994d5701a1ec158210b142ca045c153525235e2c68ec35a160ffa1e1352cd12978
|
data/contracts-gen.gemspec
CHANGED
@@ -18,6 +18,7 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.metadata["homepage_uri"] = spec.homepage
|
19
19
|
spec.metadata["source_code_uri"] = spec.homepage
|
20
20
|
spec.metadata["changelog_uri"] = "#{spec.homepage}#changelog"
|
21
|
+
spec.metadata["documentation_uri"] = "https://www.rubydoc.info/gems/contracts-gen"
|
21
22
|
|
22
23
|
# Specify which files should be added to the gem when it is released.
|
23
24
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
data/lib/contracts/gen.rb
CHANGED
@@ -6,15 +6,10 @@ require 'faker'
|
|
6
6
|
module Contracts
|
7
7
|
class Keys
|
8
8
|
def self.[](spec)
|
9
|
-
if spec
|
10
|
-
|
11
|
-
elsif spec[:required]
|
12
|
-
new(spec[:required], nil)
|
13
|
-
elsif spec[:optional]
|
14
|
-
new(nil, spec[:optional])
|
15
|
-
else
|
16
|
-
raise "Invalid hash spec: #{spec.inspect}"
|
9
|
+
if !spec.key?(:required) and !spec.key?(:optional)
|
10
|
+
raise ':required or :optional keys must be specified'
|
17
11
|
end
|
12
|
+
new(spec[:required], spec[:optional])
|
18
13
|
end
|
19
14
|
|
20
15
|
def initialize(required, optional)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: contracts-gen
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Delon Newman
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-01-
|
11
|
+
date: 2020-01-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faker
|
@@ -120,6 +120,7 @@ metadata:
|
|
120
120
|
homepage_uri: https://github.com/delonnewman/contracts-gen
|
121
121
|
source_code_uri: https://github.com/delonnewman/contracts-gen
|
122
122
|
changelog_uri: https://github.com/delonnewman/contracts-gen#changelog
|
123
|
+
documentation_uri: https://www.rubydoc.info/gems/contracts-gen
|
123
124
|
post_install_message:
|
124
125
|
rdoc_options: []
|
125
126
|
require_paths:
|