strict_options 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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/strict_options.rb +9 -1
  3. metadata +2 -16
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 849eff2ed6014a40a64f6987d4e8fcf002f401d4
4
- data.tar.gz: 0729bbb1f779ebf0966cfb04ea430899b44a28be
3
+ metadata.gz: bd48360a5944716f242f2c5cc9f260262cad9c16
4
+ data.tar.gz: 8244ea83be1f05bf434c302ff9b569302f691bbc
5
5
  SHA512:
6
- metadata.gz: 1731830bef65f8046b45322f2c9088059ab156f5e0dd0cee65d2fccb6fe4e53d57100d658731b34c966a93f2804e8f75549e3032a019453f88255ed426946977
7
- data.tar.gz: 3912660f45d0ef60e4e6f9996c8232c7a4849c8ea027da6ae9b9816600e31af5ec0140289e06742bc2e29bd69af4891a8c267fff049f8122719f7f3983ce4232
6
+ metadata.gz: d59a551d0682b058f236e00074300d70f9246c078cbd561fbfb55dba18c11159be4ec51f183ac443d3f8776d72da9fa9f23bf9ca1116594d45db6d4b75619a1a
7
+ data.tar.gz: 6c998326ab88f07711277e10e639f976073cc8e20be3bb02bceb852c8f88caa4f94e3fe057af161547d9303007639298907ebbeb74ca7ebdebc451effb77780b
@@ -3,12 +3,20 @@ module StrictOptions
3
3
  @missings = []
4
4
  opts.each { |opt| @missings << ":#{opt}" unless @options[opt] }
5
5
 
6
- raise ArgumentError, "options #{@missings.join(', ')} #{is_or_are} missing" if @missings.size > 0
6
+ raise ArgumentError, "option#{s} #{@missings.join(', ')} #{is_or_are} missing" if @missings.size > 0
7
7
  end
8
8
 
9
+ private
10
+
9
11
  def is_or_are
10
12
  return if @missings.empty?
11
13
 
12
14
  @missings.size > 1 ? 'are' : 'is'
13
15
  end
16
+
17
+ def s
18
+ return if @missings.empty?
19
+
20
+ @missings.size > 1 ? 's' : ''
21
+ end
14
22
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: strict_options
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
  - Volodya Sveredyuk
@@ -30,20 +30,6 @@ dependencies:
30
30
  - - ">="
31
31
  - !ruby/object:Gem::Version
32
32
  version: 3.4.0
33
- - !ruby/object:Gem::Dependency
34
- name: pry-rails
35
- requirement: !ruby/object:Gem::Requirement
36
- requirements:
37
- - - ">="
38
- - !ruby/object:Gem::Version
39
- version: '0'
40
- type: :development
41
- prerelease: false
42
- version_requirements: !ruby/object:Gem::Requirement
43
- requirements:
44
- - - ">="
45
- - !ruby/object:Gem::Version
46
- version: '0'
47
33
  description: Define strict attributes for options hash
48
34
  email: sveredyuk@gmail.com
49
35
  executables: []
@@ -74,5 +60,5 @@ rubyforge_project:
74
60
  rubygems_version: 2.4.5.1
75
61
  signing_key:
76
62
  specification_version: 4
77
- summary: Define strict attributes for options hash
63
+ summary: Strict for options hash
78
64
  test_files: []