array_include_methods 1.0.2 → 1.0.3

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
  SHA256:
3
- metadata.gz: 1c2ea9883b39246baae032b965a82ae5d6cec5f15393ffa3e8c68e698a0cb6d3
4
- data.tar.gz: a8e2cfeef8241433ad043c358d285d349ee4ba8ea2b40b73dcb4863e30f0fd7c
3
+ metadata.gz: 5603fedac664220b84ce316fe3e737e15379c84a94c924d4f257b73c89964823
4
+ data.tar.gz: 5fa5f34ae91a0a3a3c12d475a28a857b02975aa69224bd710ae9887cf1108df5
5
5
  SHA512:
6
- metadata.gz: 2ad14e48a3d730fef05fad287cd3232b052462961ec91a4094713b2dc80803806e99bc3b52e1e80ce0638b6f8e833fb757132c2646037d791a8faefb78c2802a
7
- data.tar.gz: 15f9bac604634a862cf1d582c26523ef375659371fb3151a8b69c2158b4e75c58b17d202753b85b1c4060016274813d4e2f1b68a75fbc805b616efbd211b9f4a
6
+ metadata.gz: 6205f364915b17f92e06dc3d78f76a3c829355f18ee2620879ceb2315c2e611082ada3ffaedd0ebc877781c3b37991d61addc078ce9ea419d2ed219169c5fb23
7
+ data.tar.gz: a66add1a0b81a5bce966c7b1cf3fde24dde7a93f08f1152d1bccae3ff48d3b012a9eb91421ebe446f1609d4d094922d4aa62d14c0cdcbd02575772cb513207ca
@@ -0,0 +1,17 @@
1
+ # Change Log
2
+
3
+ ## 1.0.3
4
+
5
+ - Opal compatibility through monkey-patching and providing a `using` method shim so that existing gems that used the refinement in Ruby work
6
+
7
+ ## 1.0.2
8
+
9
+ - Handled case of two arrays with elements of unsortable object types (e.g. Hash)
10
+
11
+ ## 1.0.1
12
+
13
+ - Handled case of two arrays with different ordering of common elements
14
+
15
+ ## 1.0.0
16
+
17
+ - Initial implementation of Array#include_all? & Array#include_any?
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
- # ArrayIncludeMethods 1.0.2 - Ruby Refinement
1
+ # ArrayIncludeMethods 1.0.3 - Ruby Refinement
2
2
  [![Gem Version](https://badge.fury.io/rb/array_include_methods.svg)](http://badge.fury.io/rb/array_include_methods)
3
+ [![Build Status](https://travis-ci.com/AndyObtiva/array_include_methods.svg?branch=master)](https://travis-ci.com/AndyObtiva/array_include_methods)
4
+ [![Coverage Status](https://coveralls.io/repos/github/AndyObtiva/array_include_methods/badge.svg?branch=master)](https://coveralls.io/github/AndyObtiva/array_include_methods?branch=master)
3
5
 
4
6
  `Array#include_all?` & `Array#include_any?` methods missing from basic Ruby `Array` API.
5
7
 
@@ -10,7 +12,7 @@
10
12
  Include the following in Gemfile:
11
13
 
12
14
  ```ruby
13
- gem 'array_include_methods', '~> 1.0.2'
15
+ gem 'array_include_methods', '~> 1.0.3'
14
16
  ```
15
17
 
16
18
  Run:
@@ -24,7 +26,7 @@ bundle
24
26
  Run:
25
27
 
26
28
  ```
27
- gem install array_include_methods -v1.0.2
29
+ gem install array_include_methods -v1.0.3
28
30
  ```
29
31
 
30
32
  ## Usage
@@ -63,19 +65,17 @@ Now, you have `#include_all?` and `#include_any?` methods on `Array` objects.
63
65
  [1, 2, 3, 4].include_any?(nil) # returns false
64
66
  ```
65
67
 
66
- ## Change Log
67
-
68
- ### 1.0.2
68
+ ## Opal Compatibility
69
69
 
70
- - Handled case of two arrays with elements of unsortable object types (e.g. Hash)
70
+ This gem degrades gracefully to monkey-patching in Opal Ruby and provides a `using` method shim so consumer code does not have to change if it used gems that rely on the Ruby refinement
71
71
 
72
- ### 1.0.1
72
+ ## TODO
73
73
 
74
- - Handled case of two arrays with different ordering of common elements
74
+ [TODO.md](TODO.md)
75
75
 
76
- ### 1.0.0
76
+ ## Change Log
77
77
 
78
- - Initial implementation of Array#include_all? & Array#include_any?
78
+ [CHANGELOG.md](CHANGELOG.md)
79
79
 
80
80
  ## Contributing to array_include_methods
81
81
 
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 1.0.3
@@ -0,0 +1,55 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
+ # -*- encoding: utf-8 -*-
5
+ # stub: array_include_methods 1.0.3 ruby lib
6
+
7
+ Gem::Specification.new do |s|
8
+ s.name = "array_include_methods".freeze
9
+ s.version = "1.0.3"
10
+
11
+ s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
12
+ s.require_paths = ["lib".freeze]
13
+ s.authors = ["Andy Maleh".freeze]
14
+ s.date = "2020-09-29"
15
+ s.description = "Array#include_all? & Array#include_any? methods missing from basic Ruby Array API".freeze
16
+ s.email = "andy.am@gmail.com".freeze
17
+ s.extra_rdoc_files = [
18
+ "CHANGELOG.md",
19
+ "LICENSE.txt",
20
+ "README.md"
21
+ ]
22
+ s.files = [
23
+ "CHANGELOG.md",
24
+ "LICENSE.txt",
25
+ "README.md",
26
+ "VERSION",
27
+ "array_include_methods.gemspec",
28
+ "lib/array_include_methods.rb"
29
+ ]
30
+ s.homepage = "http://github.com/AndyObtiva/array_include_methods".freeze
31
+ s.licenses = ["MIT".freeze]
32
+ s.rubygems_version = "3.1.4".freeze
33
+ s.summary = "Array#include_all? & Array#include_any? methods missing from basic Ruby Array API".freeze
34
+
35
+ if s.respond_to? :specification_version then
36
+ s.specification_version = 4
37
+ end
38
+
39
+ if s.respond_to? :add_runtime_dependency then
40
+ s.add_development_dependency(%q<rspec>.freeze, ["~> 3.5.0"])
41
+ s.add_development_dependency(%q<rdoc>.freeze, ["~> 3.12"])
42
+ s.add_development_dependency(%q<jeweler>.freeze, ["~> 2.3.9"])
43
+ s.add_development_dependency(%q<coveralls>.freeze, ["= 0.8.23"])
44
+ s.add_development_dependency(%q<simplecov>.freeze, ["~> 0.16.1"])
45
+ s.add_development_dependency(%q<simplecov-lcov>.freeze, ["~> 0.7.0"])
46
+ else
47
+ s.add_dependency(%q<rspec>.freeze, ["~> 3.5.0"])
48
+ s.add_dependency(%q<rdoc>.freeze, ["~> 3.12"])
49
+ s.add_dependency(%q<jeweler>.freeze, ["~> 2.3.9"])
50
+ s.add_dependency(%q<coveralls>.freeze, ["= 0.8.23"])
51
+ s.add_dependency(%q<simplecov>.freeze, ["~> 0.16.1"])
52
+ s.add_dependency(%q<simplecov-lcov>.freeze, ["~> 0.7.0"])
53
+ end
54
+ end
55
+
@@ -1,4 +1,9 @@
1
1
  module ArrayIncludeMethods
2
+ if RUBY_PLATFORM == 'opal'
3
+ def self.refine(class_or_module, &refinement)
4
+ class_or_module.class_eval(&refinement)
5
+ end
6
+ end
2
7
  refine Array do
3
8
  # Returns `true` if all of the given `array` elements are present in `self`,
4
9
  # otherwise returns `false`
@@ -30,6 +35,12 @@ module ArrayIncludeMethods
30
35
  # Always returns `false` if the given `array` is nil
31
36
  def include_any?(array)
32
37
  !array.nil? && (array.empty? || !(self & array).empty?)
33
- end
38
+ end
39
+ end
40
+ end
41
+ if RUBY_PLATFORM == 'opal'
42
+ # Create a shim using method that does nothing since we monkey-patch in Opal earlier in `refine` method
43
+ def self.using(refinement)
44
+ # NO OP
34
45
  end
35
46
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: array_include_methods
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Maleh
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-02 00:00:00.000000000 Z
11
+ date: 2020-09-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -52,37 +52,69 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: 2.3.9
55
+ - !ruby/object:Gem::Dependency
56
+ name: coveralls
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - '='
60
+ - !ruby/object:Gem::Version
61
+ version: 0.8.23
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '='
67
+ - !ruby/object:Gem::Version
68
+ version: 0.8.23
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: simplecov
57
71
  requirement: !ruby/object:Gem::Requirement
58
72
  requirements:
59
- - - ">="
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: 0.16.1
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: 0.16.1
83
+ - !ruby/object:Gem::Dependency
84
+ name: simplecov-lcov
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
60
88
  - !ruby/object:Gem::Version
61
- version: '0'
89
+ version: 0.7.0
62
90
  type: :development
63
91
  prerelease: false
64
92
  version_requirements: !ruby/object:Gem::Requirement
65
93
  requirements:
66
- - - ">="
94
+ - - "~>"
67
95
  - !ruby/object:Gem::Version
68
- version: '0'
96
+ version: 0.7.0
69
97
  description: Array#include_all? & Array#include_any? methods missing from basic Ruby
70
98
  Array API
71
99
  email: andy.am@gmail.com
72
100
  executables: []
73
101
  extensions: []
74
102
  extra_rdoc_files:
103
+ - CHANGELOG.md
75
104
  - LICENSE.txt
76
105
  - README.md
77
106
  files:
107
+ - CHANGELOG.md
78
108
  - LICENSE.txt
79
109
  - README.md
110
+ - VERSION
111
+ - array_include_methods.gemspec
80
112
  - lib/array_include_methods.rb
81
113
  homepage: http://github.com/AndyObtiva/array_include_methods
82
114
  licenses:
83
115
  - MIT
84
116
  metadata: {}
85
- post_install_message:
117
+ post_install_message:
86
118
  rdoc_options: []
87
119
  require_paths:
88
120
  - lib
@@ -97,8 +129,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
97
129
  - !ruby/object:Gem::Version
98
130
  version: '0'
99
131
  requirements: []
100
- rubygems_version: 3.1.2
101
- signing_key:
132
+ rubygems_version: 3.1.4
133
+ signing_key:
102
134
  specification_version: 4
103
135
  summary: Array#include_all? & Array#include_any? methods missing from basic Ruby Array
104
136
  API