dohutil 0.2.23 → 0.2.24

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: 918b2aecbcda649a901f0adb7abd3760c6dcae86
4
- data.tar.gz: c89ad4ae8fd1baa1ef97d336ed8d3f6e9d034bd6
3
+ metadata.gz: 8073d378dc766aa32dc4f531b73291fcf4a8c548
4
+ data.tar.gz: 9ab30fa59a185da238b175463485453b4df8c163
5
5
  SHA512:
6
- metadata.gz: b5ce1e3175b00e54f2a4ba26e869fdd76ad759a382962057976ab1d84455970b8d5c3f2e1806b298c28af6858e13a475b55b4c9dfb29d1355349e8f401d9d874
7
- data.tar.gz: 8b8e3e219a39b0a74153a441748d88227668a6d615af86dc77a60c82db62a0d869806864cedd020a1d2afe46772d9f70c4c55079db92e39790a3894e7c04daaa
6
+ metadata.gz: 738e5836c9c4f36fd138a0ac5919d4ef90425451dba12afccb7674c7a2779681e51d82bb8544fb87d1fd7c556e91b7d9a9f298e701710ffcb767e82a993330d0
7
+ data.tar.gz: 03cfb8772430db2e84718b0e2b4f4e545aabdc533f968a954ba4930f8d0ae0151a4c4d420173604de4bd54386b3aee6dd2b51f6310f48b5a02104728e013d21e
@@ -0,0 +1,11 @@
1
+ require 'set'
2
+
3
+ class Array
4
+ def include_any?(ary)
5
+ !self.to_set.intersection(ary.to_set).empty?
6
+ end
7
+
8
+ def include_all?(ary)
9
+ self.to_set.superset?(ary.to_set)
10
+ end
11
+ end
@@ -0,0 +1,17 @@
1
+ require 'dohutil/core_ext/array'
2
+
3
+ module Doh
4
+
5
+ class Test_core_ext_array < DohTest::TestGroup
6
+ def test_include_any
7
+ assert([1, 2, 3].include_any?([1,4,5]))
8
+ assert(![1, 2, 3].include_any?([4,5,6]))
9
+ end
10
+
11
+ def test_include_all
12
+ assert([1, 2, 3].include_all?([1,2]))
13
+ assert(![1, 2, 3].include_all?([1,2,4]))
14
+ end
15
+ end
16
+
17
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dohutil
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.23
4
+ version: 0.2.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - Makani Mason
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-02-13 00:00:00.000000000 Z
12
+ date: 2015-07-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: dohroot
@@ -61,7 +61,6 @@ extensions: []
61
61
  extra_rdoc_files:
62
62
  - MIT-LICENSE
63
63
  files:
64
- - MIT-LICENSE
65
64
  - lib/dohutil/app/cli.rb
66
65
  - lib/dohutil/app/init_from_prog.rb
67
66
  - lib/dohutil/app/init_from_pwd.rb
@@ -71,6 +70,7 @@ files:
71
70
  - lib/dohutil/array_to_hash.rb
72
71
  - lib/dohutil/class_basename.rb
73
72
  - lib/dohutil/config.rb
73
+ - lib/dohutil/core_ext/array.rb
74
74
  - lib/dohutil/core_ext/bigdecimal.rb
75
75
  - lib/dohutil/core_ext/boolean.rb
76
76
  - lib/dohutil/core_ext/date.rb
@@ -80,7 +80,6 @@ files:
80
80
  - lib/dohutil/core_ext/force_deep_copy.rb
81
81
  - lib/dohutil/core_ext/hash.rb
82
82
  - lib/dohutil/core_ext/inspect.rb
83
- - lib/dohutil/core_ext/random.rb
84
83
  - lib/dohutil/core_ext/string.rb
85
84
  - lib/dohutil/current_date.rb
86
85
  - lib/dohutil/disable_verbose.rb
@@ -89,6 +88,7 @@ files:
89
88
  - lib/dohutil/move_weekday.rb
90
89
  - lib/dohutil/password_helper.rb
91
90
  - lib/dohutil/to_display.rb
91
+ - test/core_ext/array.dt.rb
92
92
  - test/core_ext/bigdecimal.dt.rb
93
93
  - test/core_ext/date.dt.rb
94
94
  - test/core_ext/datewithtime.dt.rb
@@ -96,6 +96,7 @@ files:
96
96
  - test/core_ext/string.dt.rb
97
97
  - test/exception.dt.rb
98
98
  - test/move_weekday.dt.rb
99
+ - MIT-LICENSE
99
100
  homepage: https://github.com/atpsoft/dohutil
100
101
  licenses:
101
102
  - MIT
@@ -116,11 +117,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
116
117
  version: '0'
117
118
  requirements: []
118
119
  rubyforge_project:
119
- rubygems_version: 2.4.1
120
+ rubygems_version: 2.0.6
120
121
  signing_key:
121
122
  specification_version: 4
122
123
  summary: assorted tiny utilities
123
124
  test_files:
125
+ - test/core_ext/array.dt.rb
124
126
  - test/core_ext/bigdecimal.dt.rb
125
127
  - test/core_ext/date.dt.rb
126
128
  - test/core_ext/datewithtime.dt.rb
@@ -1,8 +0,0 @@
1
- class Random
2
- def self.current_seed
3
- curseed = Random.srand(0)
4
- Random.srand(curseed)
5
- curseed
6
- end
7
- end
8
-