trick_bag 0.43.0 → 0.44.0

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: c31a98dc149bcc3e07095aa0dd04a3f65906a699
4
- data.tar.gz: 7882b1eee6ee139d7457adab1ffbc57b2002e9da
3
+ metadata.gz: 3639923641e36b4ccd2a0808d3c8dd12ee4aead0
4
+ data.tar.gz: 970e57c7fd017b5b0874365becffe207510e6b63
5
5
  SHA512:
6
- metadata.gz: 2f51b81080fb07c921588cc7c969978e3af553aba82a665258feeae8c98b58d7fdfd8b9834204131ce33d2b4fd40b2fffdc7b66c47015b6854bff3903c2bbeb4
7
- data.tar.gz: 98298c3991c08e9de73ee5aea69fd305cc2cb044424e26294279297860879cefc40455e0c14edeee356740d855c21486f5f7a0359295055ce5319a485e993975
6
+ metadata.gz: d0f0c5de4061fb0a75d6913d0532aa124c5a05cc41cf794a0937e3aede9f934e9ae5b6021bcf8de27a270541282724a205562cea0fd92a1f7742976d3268be61
7
+ data.tar.gz: 34ce55395d36c3d474e9406b97fddd1598ef957ceb9acfa003ee7f1da05b906dae8e2d51427a2a60e4b99a64df041247e75499a31e0ab5cd62dc0ee379e87bae
data/RELEASE_NOTES.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## v0.44.0
2
+
3
+ * Fix missing require 'ostruct' in erb_renderer.rb.
4
+ * Simplify implementation of determining missing keys.
5
+ * Rename any?, all?, none? to any_with_object?, etc.
6
+
7
+
1
8
  ## v0.43.0
2
9
 
3
10
  * Added any?, all?, none?.
@@ -1,3 +1,5 @@
1
+ require 'ostruct'
2
+
1
3
  module TrickBag
2
4
 
3
5
  # ERB requires a binding from which it gets its values for substituting
@@ -5,21 +5,21 @@ module TrickBag
5
5
 
6
6
  # Returns whether or not none of the condition lambdas return true
7
7
  # when passed the specified object
8
- def none?(conditions, object)
8
+ def none_with_object?(conditions, object)
9
9
  conditions.none? { |condition| condition.(object) }
10
10
  end
11
11
 
12
12
 
13
13
  # Returns whether or not all of the condition lambdas return true
14
14
  # when passed the specified object
15
- def all?(conditions, object)
15
+ def all_with_object?(conditions, object)
16
16
  conditions.all? { |condition| condition.(object) }
17
17
  end
18
18
 
19
19
 
20
20
  # Returns whether or not any of the condition lambdas return true
21
21
  # when passed the specified object
22
- def any?(conditions, object)
22
+ def any_with_object?(conditions, object)
23
23
  conditions.any? { |condition| condition.(object) }
24
24
  end
25
25
  end
@@ -11,7 +11,7 @@ module Validations
11
11
  keys = keys.first
12
12
  end
13
13
 
14
- keys.reject { |key| the_hash.keys.include?(key) }
14
+ keys - the_hash.keys
15
15
  end
16
16
 
17
17
 
@@ -1,3 +1,3 @@
1
1
  module TrickBag
2
- VERSION = "0.43.0"
2
+ VERSION = "0.44.0"
3
3
  end
@@ -17,15 +17,15 @@ module TrickBag
17
17
  context "none?" do
18
18
 
19
19
  specify "returns true when all are false" do
20
- expect(TrickBag.none?(all_false_funcs, 1)).to be_true
20
+ expect(TrickBag.none_with_object?(all_false_funcs, 1)).to be_true
21
21
  end
22
22
 
23
23
  specify "returns false when all are true" do
24
- expect(TrickBag.none?(all_true_funcs, 1)).to be_false
24
+ expect(TrickBag.none_with_object?(all_true_funcs, 1)).to be_false
25
25
  end
26
26
 
27
27
  specify "returns false when some are false and some are true" do
28
- expect(TrickBag.none?(mixed_true_false_funcs, 1)).to be_false
28
+ expect(TrickBag.none_with_object?(mixed_true_false_funcs, 1)).to be_false
29
29
  end
30
30
  end
31
31
 
@@ -33,15 +33,15 @@ module TrickBag
33
33
  context "any?" do
34
34
 
35
35
  specify "returns false when all are false" do
36
- expect(TrickBag.any?(all_false_funcs, 1)).to be_false
36
+ expect(TrickBag.any_with_object?(all_false_funcs, 1)).to be_false
37
37
  end
38
38
 
39
39
  specify "returns true when all are true" do
40
- expect(TrickBag.any?(all_true_funcs, 1)).to be_true
40
+ expect(TrickBag.any_with_object?(all_true_funcs, 1)).to be_true
41
41
  end
42
42
 
43
43
  specify "returns true when some are false and some are true" do
44
- expect(TrickBag.any?(mixed_true_false_funcs, 1)).to be_true
44
+ expect(TrickBag.any_with_object?(mixed_true_false_funcs, 1)).to be_true
45
45
  end
46
46
  end
47
47
 
@@ -49,15 +49,15 @@ module TrickBag
49
49
  context "all?" do
50
50
 
51
51
  specify "returns false when all are false" do
52
- expect(TrickBag.all?(all_false_funcs, 1)).to be_false
52
+ expect(TrickBag.all_with_object?(all_false_funcs, 1)).to be_false
53
53
  end
54
54
 
55
55
  specify "returns true when all are true" do
56
- expect(TrickBag.all?(all_true_funcs, 1)).to be_true
56
+ expect(TrickBag.all_with_object?(all_true_funcs, 1)).to be_true
57
57
  end
58
58
 
59
59
  specify "returns false when some are false and some are true" do
60
- expect(TrickBag.all?(mixed_true_false_funcs, 1)).to be_false
60
+ expect(TrickBag.all_with_object?(mixed_true_false_funcs, 1)).to be_false
61
61
  end
62
62
  end
63
63
 
@@ -22,7 +22,7 @@ module System
22
22
  context ".lsof" do
23
23
  specify "returns ruby lines" do
24
24
  lines = System.lsof
25
- has_ruby_line = lines.any? { |line| /ruby/ === line }
25
+ has_ruby_line = lines.any_with_object? { |line| /ruby/ === line }
26
26
  expect(has_ruby_line).to be_true
27
27
  end
28
28
  end
@@ -49,7 +49,7 @@ describe Validations do
49
49
  missing_keys = [:foo, :bar]
50
50
  begin
51
51
  raise_on_missing_keys(my_hash, missing_keys)
52
- fail "An exception should have been raised."
52
+ fail "An exception should have been raised." # TODO: THis will raise a runtime error.
53
53
  rescue => e
54
54
  message = e.to_s
55
55
  missing_keys.each do |key|
metadata CHANGED
@@ -1,99 +1,99 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trick_bag
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.43.0
4
+ version: 0.44.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Keith Bennett
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-14 00:00:00.000000000 Z
11
+ date: 2014-05-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: os
15
- version_requirements: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ~>
18
- - !ruby/object:Gem::Version
19
- version: '0'
20
15
  requirement: !ruby/object:Gem::Requirement
21
16
  requirements:
22
- - - ~>
17
+ - - "~>"
23
18
  - !ruby/object:Gem::Version
24
19
  version: '0'
25
- prerelease: false
26
20
  type: :runtime
27
- - !ruby/object:Gem::Dependency
28
- name: bundler
21
+ prerelease: false
29
22
  version_requirements: !ruby/object:Gem::Requirement
30
23
  requirements:
31
- - - ~>
24
+ - - "~>"
32
25
  - !ruby/object:Gem::Version
33
- version: '1.3'
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
34
29
  requirement: !ruby/object:Gem::Requirement
35
30
  requirements:
36
- - - ~>
31
+ - - "~>"
37
32
  - !ruby/object:Gem::Version
38
33
  version: '1.3'
39
- prerelease: false
40
34
  type: :development
41
- - !ruby/object:Gem::Dependency
42
- name: rake
35
+ prerelease: false
43
36
  version_requirements: !ruby/object:Gem::Requirement
44
37
  requirements:
45
- - - ~>
38
+ - - "~>"
46
39
  - !ruby/object:Gem::Version
47
- version: '10'
40
+ version: '1.3'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
48
43
  requirement: !ruby/object:Gem::Requirement
49
44
  requirements:
50
- - - ~>
45
+ - - "~>"
51
46
  - !ruby/object:Gem::Version
52
47
  version: '10'
53
- prerelease: false
54
48
  type: :development
55
- - !ruby/object:Gem::Dependency
56
- name: rspec
49
+ prerelease: false
57
50
  version_requirements: !ruby/object:Gem::Requirement
58
51
  requirements:
59
- - - ~>
52
+ - - "~>"
60
53
  - !ruby/object:Gem::Version
61
- version: '2'
54
+ version: '10'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec
62
57
  requirement: !ruby/object:Gem::Requirement
63
58
  requirements:
64
- - - ~>
59
+ - - "~>"
65
60
  - !ruby/object:Gem::Version
66
61
  version: '2'
67
- prerelease: false
68
62
  type: :development
69
- - !ruby/object:Gem::Dependency
70
- name: guard
63
+ prerelease: false
71
64
  version_requirements: !ruby/object:Gem::Requirement
72
65
  requirements:
73
- - - ~>
66
+ - - "~>"
74
67
  - !ruby/object:Gem::Version
75
68
  version: '2'
69
+ - !ruby/object:Gem::Dependency
70
+ name: guard
76
71
  requirement: !ruby/object:Gem::Requirement
77
72
  requirements:
78
- - - ~>
73
+ - - "~>"
79
74
  - !ruby/object:Gem::Version
80
75
  version: '2'
81
- prerelease: false
82
76
  type: :development
83
- - !ruby/object:Gem::Dependency
84
- name: guard-rspec
77
+ prerelease: false
85
78
  version_requirements: !ruby/object:Gem::Requirement
86
79
  requirements:
87
- - - ~>
80
+ - - "~>"
88
81
  - !ruby/object:Gem::Version
89
- version: '4'
82
+ version: '2'
83
+ - !ruby/object:Gem::Dependency
84
+ name: guard-rspec
90
85
  requirement: !ruby/object:Gem::Requirement
91
86
  requirements:
92
- - - ~>
87
+ - - "~>"
93
88
  - !ruby/object:Gem::Version
94
89
  version: '4'
95
- prerelease: false
96
90
  type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '4'
97
97
  description: Miscellaneous general useful tools for general purpose programming.
98
98
  email:
99
99
  - keithrbennett@gmail.com
@@ -101,7 +101,7 @@ executables: []
101
101
  extensions: []
102
102
  extra_rdoc_files: []
103
103
  files:
104
- - .gitignore
104
+ - ".gitignore"
105
105
  - Gemfile
106
106
  - Guardfile
107
107
  - LICENSE.txt
@@ -160,24 +160,24 @@ homepage: https://github.com/keithrbennett/trick_bag
160
160
  licenses:
161
161
  - MIT
162
162
  metadata: {}
163
- post_install_message:
163
+ post_install_message:
164
164
  rdoc_options: []
165
165
  require_paths:
166
166
  - lib
167
167
  required_ruby_version: !ruby/object:Gem::Requirement
168
168
  requirements:
169
- - - '>='
169
+ - - ">="
170
170
  - !ruby/object:Gem::Version
171
171
  version: '0'
172
172
  required_rubygems_version: !ruby/object:Gem::Requirement
173
173
  requirements:
174
- - - '>='
174
+ - - ">="
175
175
  - !ruby/object:Gem::Version
176
176
  version: '0'
177
177
  requirements: []
178
- rubyforge_project:
178
+ rubyforge_project:
179
179
  rubygems_version: 2.2.2
180
- signing_key:
180
+ signing_key:
181
181
  specification_version: 4
182
182
  summary: Miscellaneous general useful tools.
183
183
  test_files: