barf 1.0.0 → 1.0.1

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: 55081eb4528651032a7ed560be6886ae3492373054f0d8482ffa7044671a3ddc
4
- data.tar.gz: ded67bbf6670bd22c9bd653d1fd890741c8fb2cb146fc4d79c30a8137af01e09
3
+ metadata.gz: f7c208a39e1e1cbd5be435c9cd3ba3e3df1dea3d1e2957ebad7be33040575226
4
+ data.tar.gz: 57c6ae8ab04aa8554f9b8aac7795c9c651237a73c6c980dabf16d50dfd0a12a0
5
5
  SHA512:
6
- metadata.gz: 02a3900ab92c40b8fc68e9fcceee6a4afb74dcb25f97084fb349e09b1de7e59e002d90220627bababba86725124b251d505895be27ee7a91351bd6b79efa2ad1
7
- data.tar.gz: 0a1431cb7fddfea311733ef8f4717513aecf49fdadc31a4ec2c9311a7f371c60ea9ea16c9b66a2dbbae76011d4f5291420b65444ec26a98a3e203fe1e11dea2c
6
+ metadata.gz: f90f7241a8e99c168c180e437191ee68047ca76253704308833fd67c1ea9dcc8d033c1fba520ed967c9c64ee82f9888dd653a2c97806bfc4538a3ff3ca0a84c3
7
+ data.tar.gz: f50c1452bbdf4cf8440a23a656c120b85a7519813889706e9bb6b57abba29292b596536649d31a86979f93b16d49aa0d648b592fe686e55793ab2ae244f011f3
data/barf.gemspec CHANGED
@@ -24,6 +24,7 @@ Gem::Specification.new do |spec|
24
24
 
25
25
  # Read and process images
26
26
  spec.add_dependency "mini_magick"
27
+ spec.add_dependency "parallel"
27
28
 
28
29
  # Easier terminal color setting
29
30
  spec.add_dependency "tco"
data/lib/barf.rb CHANGED
@@ -2,6 +2,7 @@ require_relative "./barf/version"
2
2
 
3
3
  require "mini_magick"
4
4
  require "tco"
5
+ require "parallel"
5
6
 
6
7
  module Barf
7
8
 
@@ -23,10 +24,9 @@ module Barf
23
24
 
24
25
  # Two dimensional array of pixels:
25
26
  image.get_pixels.each_slice(2) do |top, bottom|
26
- out = ""
27
- top.each_with_index do |pixel, index|
28
- out << "\u2584".bg(pixel).fg(bottom[index])
29
- end
27
+ out = Parallel.map_with_index(top) do |pixel, index|
28
+ "\u2584".bg(pixel).fg(bottom[index])
29
+ end.join
30
30
  puts out
31
31
  end
32
32
  return nil
data/lib/barf/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Barf
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: barf
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jacob Duffy
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: parallel
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: tco
29
43
  requirement: !ruby/object:Gem::Requirement