ascii-image 0.1.2 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/ascii-image.rb +11 -8
  3. metadata +46 -69
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 20e9c6bd0f23903a1a8583d73b1220d72d93979fd174de4c077b67ab06fa1a99
4
+ data.tar.gz: 38a3cc6fcacc0b7a789bcd591f45b1e4f854be70369c3039e19673fac6bd388d
5
+ SHA512:
6
+ metadata.gz: 59d030f538b5ff5907edafcd593a6b37bd7e9829f31ce3a470325c648111ff4c45bd15254e87d630cc3ad2995f74f57b13c9931ce99464bd745111591d791218
7
+ data.tar.gz: ba33bbf4187e2dd3a076468e33e5d9dbd249757fc3e8375221376d8cd8853ebde579ed9054df7fceb90c944c8d1fc21cdf2a477c48ad6f8092ec734ee7b01f9b
@@ -1,8 +1,9 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  require 'rubygems'
4
- require 'RMagick'
4
+ require 'rmagick'
5
5
  require 'rainbow'
6
+ require 'open-uri'
6
7
 
7
8
  # == Summary
8
9
  #
@@ -25,15 +26,15 @@ class ASCII_Image
25
26
  # An Error is raised if your ImageMagick quantum depth is higher than 8.
26
27
  #
27
28
  # Arguments:
28
- # file: (String)
29
+ # uri: (String)
29
30
  # console_width: (Integer)
30
31
 
31
- def initialize(file, console_width = 80)
32
- @file = file
32
+ def initialize(uri, console_width = 80)
33
+ @uri = uri
33
34
  @console_width = console_width
34
35
 
35
- if Magick::QuantumDepth > 8
36
- raise "Your ImageMagick quantum depth is set to #{Magick::QuantumDepth}. You need to have it set to 8 in order for this app to work."
36
+ if Magick::MAGICKCORE_QUANTUM_DEPTH > 8
37
+ raise "Your ImageMagick quantum depth is set to #{Magick::MAGICKCORE_QUANTUM_DEPTH}. You need to have it set to 8 in order for this app to work."
37
38
  end
38
39
  end
39
40
 
@@ -45,8 +46,10 @@ class ASCII_Image
45
46
  # width: (Integer)
46
47
 
47
48
  def build(width)
48
- # Open the image file
49
- image = Magick::Image.read(@file)[0]
49
+ # Open the resource
50
+ resource = open(@uri)
51
+ image = Magick::ImageList.new
52
+ image.from_blob resource.read
50
53
 
51
54
  # Resize to the desired "text-pixel" size
52
55
  if width > @console_width
metadata CHANGED
@@ -1,96 +1,73 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: ascii-image
3
- version: !ruby/object:Gem::Version
4
- hash: 31
5
- prerelease:
6
- segments:
7
- - 0
8
- - 1
9
- - 2
10
- version: 0.1.2
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.4
11
5
  platform: ruby
12
- authors:
6
+ authors:
13
7
  - Nathan Campos
14
8
  autorequire:
15
9
  bindir: bin
16
10
  cert_chain: []
17
-
18
- date: 2012-11-04 00:00:00 Z
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
11
+ date: 2018-09-20 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
21
14
  name: rainbow
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
24
- none: false
25
- requirements:
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
26
17
  - - ">="
27
- - !ruby/object:Gem::Version
28
- hash: 27
29
- segments:
30
- - 1
31
- - 1
32
- - 4
33
- version: 1.1.4
18
+ - !ruby/object:Gem::Version
19
+ version: 3.0.0
34
20
  type: :runtime
35
- version_requirements: *id001
36
- - !ruby/object:Gem::Dependency
37
- name: rmagick
38
21
  prerelease: false
39
- requirement: &id002 !ruby/object:Gem::Requirement
40
- none: false
41
- requirements:
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 3.0.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: rmagick
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
42
31
  - - ">="
43
- - !ruby/object:Gem::Version
44
- hash: 57
45
- segments:
46
- - 2
47
- - 13
48
- - 1
49
- version: 2.13.1
32
+ - !ruby/object:Gem::Version
33
+ version: 2.16.0
50
34
  type: :runtime
51
- version_requirements: *id002
52
- description: A Ruby gem to convert images into ASCII for your awesome command-line applications
53
- email: nathanpc@dreamintech.net
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: 2.16.0
41
+ description: A Ruby gem to convert images into ASCII for your awesome command-line
42
+ applications
43
+ email: nathan@innoveworkshop.com
54
44
  executables: []
55
-
56
45
  extensions: []
57
-
58
46
  extra_rdoc_files: []
59
-
60
- files:
47
+ files:
61
48
  - lib/ascii-image.rb
62
49
  homepage: https://github.com/nathanpc/ascii-image
63
- licenses: []
64
-
50
+ licenses:
51
+ - GPL-3.0
52
+ metadata: {}
65
53
  post_install_message:
66
54
  rdoc_options: []
67
-
68
- require_paths:
55
+ require_paths:
69
56
  - lib
70
- required_ruby_version: !ruby/object:Gem::Requirement
71
- none: false
72
- requirements:
57
+ required_ruby_version: !ruby/object:Gem::Requirement
58
+ requirements:
73
59
  - - ">="
74
- - !ruby/object:Gem::Version
75
- hash: 3
76
- segments:
77
- - 0
78
- version: "0"
79
- required_rubygems_version: !ruby/object:Gem::Requirement
80
- none: false
81
- requirements:
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ required_rubygems_version: !ruby/object:Gem::Requirement
63
+ requirements:
82
64
  - - ">="
83
- - !ruby/object:Gem::Version
84
- hash: 3
85
- segments:
86
- - 0
87
- version: "0"
65
+ - !ruby/object:Gem::Version
66
+ version: '0'
88
67
  requirements: []
89
-
90
68
  rubyforge_project:
91
- rubygems_version: 1.8.24
69
+ rubygems_version: 2.7.7
92
70
  signing_key:
93
- specification_version: 3
71
+ specification_version: 4
94
72
  summary: Convert images into ASCII
95
73
  test_files: []
96
-