hyper_iterator 0.3.0 → 0.3.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.
- checksums.yaml +4 -4
- data/README.md +6 -2
- data/UPDATE.md +14 -0
- data/lib/hyper_iterator.rb +5 -3
- data/lib/hyper_iterator/version.rb +1 -1
- data/lib/iterators/each_bang.rb +6 -4
- data/lib/iterators/each_slice_bang.rb +4 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3742ad06c0d10f57af4080becde3800e545981b9
|
4
|
+
data.tar.gz: 53a02e9053ed8dba9b1555c8ad4c5b9029e1ebeb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 63e39b455f06fda5a51eaf3ff80ad5eff903b457f8f513550a4f343dc8f36936bc90bba270b3cadf67c9106396955bb4d8ddb2f537a05021ed39417d651130ea
|
7
|
+
data.tar.gz: 5205e90cd34744e8f3d8d214e5ec47566fa8acc09b99ba119ea28471dd7cc57f7a16333b6f864fc3bd0ff757662e9ce4cd2a11eca149111e05912c3a1ead978e
|
data/README.md
CHANGED
@@ -23,6 +23,12 @@ Add this line to your application's Gemfile:
|
|
23
23
|
gem 'hyper_iterator'
|
24
24
|
```
|
25
25
|
|
26
|
+
Or use it with Rails
|
27
|
+
|
28
|
+
```ruby
|
29
|
+
gem 'hyper_iterator-rails'
|
30
|
+
```
|
31
|
+
|
26
32
|
And then execute:
|
27
33
|
|
28
34
|
$ bundle
|
@@ -169,8 +175,6 @@ you can get a lot more iterations!
|
|
169
175
|
|
170
176
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
171
177
|
|
172
|
-
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
173
|
-
|
174
178
|
## Contributing
|
175
179
|
|
176
180
|
Bug reports and pull requests are welcome on GitHub at https://github.com/edmundleex/hyper_iterator. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
data/UPDATE.md
CHANGED
@@ -1,3 +1,17 @@
|
|
1
|
+
### 3/23/17
|
2
|
+
|
3
|
+
- Adding `Hash#each!` See the branch each-bang-hash
|
4
|
+
- It seems to be significantly slower than the native `each`. hmmm why?
|
5
|
+
|
6
|
+
### 3/18/17
|
7
|
+
|
8
|
+
- Created [hyper_iterator-rails](https://github.com/EdmundLeex/hyper_iterator-rails) as
|
9
|
+
the adapter to Rails, since ActiveRecord implements its own `each` method
|
10
|
+
- Added `HyperIterator.each!(array)` as a backup method. `each` is a widely implemented
|
11
|
+
method in many gems (e.g. the one we need to deal with is the pg gem). Because of that
|
12
|
+
adding this method that takes an array as argument can be more versatile without monkey
|
13
|
+
patching for each individual library.
|
14
|
+
|
1
15
|
### 3/16/17
|
2
16
|
|
3
17
|
- Tweak the two benchmark file and made it work
|
data/lib/hyper_iterator.rb
CHANGED
@@ -8,9 +8,11 @@ module HyperIterator
|
|
8
8
|
:each!
|
9
9
|
].freeze
|
10
10
|
|
11
|
-
def self.each!(
|
12
|
-
|
11
|
+
def self.each!(iterable)
|
12
|
+
iterable.each! { |el| yield el }
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
16
|
-
Array.include HyperIterator
|
16
|
+
Array.include HyperIterator::EachBang
|
17
|
+
Hash.include HyperIterator::EachBang
|
18
|
+
Array.include HyperIterator
|
data/lib/iterators/each_bang.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hyper_iterator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Edmund Li
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-03-
|
11
|
+
date: 2017-03-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|