kdict 0.1.1 → 0.1.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 495fd2e9c4e09c817dde4723b7f6aa49ebfb16827514fa5a644b1ef55aae7473
4
- data.tar.gz: b256e6b5abf92224ebac083ac5e68a3eab341f521666c9c240ee679364436fac
3
+ metadata.gz: '08f77aac21c890e2fd0acaeddd38c3f87126f99865893c8188da67501c1093e7'
4
+ data.tar.gz: 6fda813fd3f05f78a27e73a506860644975d0a31c181e91b19a9986a79690556
5
5
  SHA512:
6
- metadata.gz: bab14be49b5d1c74a372e66c79af2aeaf70e4269590fb2cc26d1948f5b18f7d4930b6df4579a1c7ae22a9f9731c7acda5e469549fb588b37bd145307afd37b34
7
- data.tar.gz: 7f01a700d43f2593b05997519cfa2ae9b0112fbc90b8a88bfc9fe3c8db2b7e7fc9ed1dc409161498b00427a3d8e8ca698b38faefa75c7f5196d060779f2ebd59
6
+ metadata.gz: 79ca787e4671e909b4d3e2bcbab30f5f7032033d4f31d1b22be6fe0c463701aac721c93c1a4de00e307bf17c9f226dfdd07004db9b0a667996e2d0cea509e552
7
+ data.tar.gz: 493a2f0f6daeb48be8b038c399dca41ad987d583381d518c54145c9ff08383259e333656692788ea5481e9b6e20dfd0014d93613f048c48318652bd4ed0a447e
data/README.md CHANGED
@@ -16,9 +16,6 @@ View source code at: https://github.com/stkterry/KDict/
16
16
 
17
17
  {file:doc/Example1.md}
18
18
 
19
- *Note: I'm very new to Ruby, less than a month in, as it were. I suspect this thing might change quite a bit
20
- as I better familiarize myself with everything.*
21
-
22
19
  ***
23
20
 
24
21
  ### KwargDict
@@ -38,7 +35,7 @@ allowed to modify a label, it's fontsize, it's color, and x_data for a graph.
38
35
  ```ruby
39
36
  kdict[:label] = :typeof, String
40
37
  kdict[:fontsize] = :typeof, Integer
41
- kdict[:rgb] = :formof, [Integer]*3, Proc.new { |n| n.ibetween?(0, 255) }
38
+ kdict[:rgb] = :formof, [Integer]*3, Proc.new { |n| 0 <= n && n <= 255 }
42
39
  kdict[:x_data] = :arrayof, Float
43
40
 
44
41
  # Or if you prefer a single command
@@ -193,7 +190,7 @@ my_dict.check(:example, [false, 3.1, "Holly Dolly"]) # => true
193
190
  my_dict.check(:example, [false, 3.1]) # => false
194
191
  my_dict.check(:example, ["Holly Dolly", 3.1, false]) # => false
195
192
 
196
- my_dict[:proc_example] = :formof, [Integer, Float, Float], Proc.new { |n| n.between?(1, 3) }
193
+ my_dict[:proc_example] = :formof, [Integer, Float, Float], Proc.new { |n| 1 < n && n < 3 }
197
194
  my_dict.check(:proc_example, [2, 1.1, 1.2]) # => true
198
195
  my_dict.check(:proc_example, [1.1, 2, 1.4]) # => false
199
196
  ```
@@ -237,7 +234,7 @@ my_dict.check(:example, [3.1, [1, 2, 3, 4, 5]]) # => true
237
234
  my_dict.check(:example, [3.1, ['1', '2', '3']]) # => false
238
235
 
239
236
  my_dict[:proc_example] = :adv_formof, [[:typeof, String, Proc.new { |s| s.length > 5 }],
240
- [:formof, [Float]*3 , Proc.new { |n| n.ibetween?(0,1) }]]
237
+ [:formof, [Float]*3 , Proc.new { |n| 0 <= n && n <= 1 }]]
241
238
  my_dict.check(:proc_example, ["Longer", [0.25, 0.5, 1.0]]) # => true
242
239
  my_dict.check(:proc_example, ["Longer", [-0.25, 0.5, -1.0]]) # => false
243
240
  my_dict.check(:proc_example, ["Short", [0.25, 0.5, 1.0]]) # => false
@@ -95,7 +95,7 @@ module KwargTypes
95
95
  # * Can accept a Proc that must return true for ALL values in the array.
96
96
  # @example (Called From a KwargDict instance)
97
97
  # my_dict[:example] = :formof, [Bool, Float, String]
98
- # my_dict[:proc_example] = :formof, [Integer, Float, Float], Proc.new { |n| n.between?(1, 3) }
98
+ # my_dict[:proc_example] = :formof, [Integer, Float, Float], Proc.new { |n| 1 < n && n < 3 }
99
99
  # my_dict.check(:example, [false, 3.1, "Holly Dolly"]) # => true
100
100
  # my_dict.check(:example, [false, 3.1]) # => false
101
101
  # my_dict.check(:example, ["Holly Dolly", 3.1, false]) # => false
@@ -137,7 +137,7 @@ module KwargTypes
137
137
  # @example (Called From a KwargDict instance)
138
138
  # my_dict[:example] = :adv_formof, [[:typeof, Float], [:arrayof, Integer]]
139
139
  # my_dict[:proc_example] = :adv_formof, [[:typeof, String, Proc.new { |s| s.length > 5 }],
140
- # [:formof, [Float]*3 , Proc.new { |n| n.ibetween?(0,1) }]]
140
+ # [:formof, [Float]*3 , Proc.new { |n| 0 <= n && n <= 1 }]]
141
141
  # my_dict.check(:example, [3.1, [1, 2, 3, 4, 5]]) # => true
142
142
  # my_dict.check(:example, [3.1, ['1', '2', '3']]) # => false
143
143
  # my_dict.check(:proc_example, ["Longer", [0.25, 0.5, 1.0]]) # => true
@@ -56,7 +56,7 @@ class KwargDict < Hash
56
56
  # @return [Boolean]
57
57
  # @example Adding a KwargModel and Checking User Input Against It:
58
58
  # my_dict[:label] = :typeof, String
59
- # my_dict[:rgba] = :formof, [Numeric]*4, Proc.new { |n| n.ibetween(0, 1) }
59
+ # my_dict[:rgba] = :formof, [Numeric]*4, Proc.new { |n| 0 <= n && n <= 1 }
60
60
  # my_dict.check(:label, 'Labels Are Fun!') #=> true
61
61
  # my_dict.check(:label, 45) #=> false
62
62
  # my_dict.check(:rgba, [0.5, 1, 0.25, 1]) #=> true
data/lib/kdict/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  #Version module.
2
2
  module Kdict
3
3
  # Version number
4
- VERSION = "0.1.1"
4
+ VERSION = "0.1.2"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kdict
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steven K Terry