tty-font 0.4.0 → 0.5.0

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: 9399079eb7b180c98d44d0b76b44848de06fdda5394ba02d1727002c4708d458
4
- data.tar.gz: e1f6b9cf102c8a30d04fa8cbc6ca6e24481579a8d35db238d75bf05e1f99dcbd
3
+ metadata.gz: 3157916631edf8c4afa89d03764d9606dac391f171fd64fb3b37dbb8c1547367
4
+ data.tar.gz: 1adb4db69c7f23612f91139c90fa0e2dd62ff84b1e6b05307648cf5a0e91c9f6
5
5
  SHA512:
6
- metadata.gz: e676019cb0759ddb039ef91d94e44aa7ede229cb9fbe475bce4695c46089db1b45f20ca64c50ac88b35249ec16f4dc3bcecdb30f9b8f41bcb4e84700fb799df2
7
- data.tar.gz: eccca94ebd205de6d07804b21ca7cbdaf9f733c8a6967f3a05b2ddcbdc26ca98bc6c211c0912d9e0879586d0a1c43dabbe1728573e5cb5b769871ab5258dbf77
6
+ metadata.gz: 8c0329a194eded2bc260463f5f565d0cd8f2f42f88c9eef05988b821a82e53d22c7de3e9399fd03f33549ace5a68f9ded830dfd387e30452bd1dda3cc87167a2
7
+ data.tar.gz: 841ddfb37d677b0f240815e950d5642b12eb47f0dba39574f53c9340f674c947eb7498bfbee7652e402b4d3c8e5dfe1b46e3272ae69a16879a46217ef6842013
@@ -1,5 +1,10 @@
1
1
  # Change log
2
2
 
3
+ ## [v0.5.0] - 2020-01-16
4
+
5
+ ### Changed
6
+ * Change gemspec to add metadata and remove test artifacts
7
+
3
8
  ## [v0.4.0] - 2019-06-26
4
9
 
5
10
  ### Added
@@ -30,6 +35,7 @@
30
35
 
31
36
  * Initial implementation and release
32
37
 
38
+ [v0.5.0]: https://github.com/piotrmurach/tty-font/compare/v0.4.0...v0.5.0
33
39
  [v0.4.0]: https://github.com/piotrmurach/tty-font/compare/v0.3.0...v0.4.0
34
40
  [v0.3.0]: https://github.com/piotrmurach/tty-font/compare/v0.2.0...v0.3.0
35
41
  [v0.2.0]: https://github.com/piotrmurach/tty-font/compare/v0.1.0...v0.2.0
data/README.md CHANGED
@@ -110,7 +110,7 @@ The gem is available as open source under the terms of the [MIT License](https:/
110
110
 
111
111
  ## Code of Conduct
112
112
 
113
- Everyone interacting in the TTY::Font project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/tty-font/blob/master/CODE_OF_CONDUCT.md).
113
+ Everyone interacting in the TTY::Font project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/piotrmurach/tty-font/blob/master/CODE_OF_CONDUCT.md).
114
114
 
115
115
  ## Copyright
116
116
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module TTY
4
4
  class Font
5
- VERSION = "0.4.0"
5
+ VERSION = "0.5.0"
6
6
  end # Font
7
7
  end # TTY
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tty-font
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Piotr Murach
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-06-26 00:00:00.000000000 Z
11
+ date: 2020-01-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -55,24 +55,21 @@ dependencies:
55
55
  description: Write text in large stylized characters using a variety of terminal friendly
56
56
  fonts.
57
57
  email:
58
- - me@piotrmurach.com
58
+ - piotr@piotrmurach.com
59
59
  executables: []
60
60
  extensions: []
61
- extra_rdoc_files: []
61
+ extra_rdoc_files:
62
+ - README.md
63
+ - fonts/3d.md
64
+ - fonts/block.md
65
+ - fonts/doom.md
66
+ - fonts/standard.md
67
+ - fonts/starwars.md
68
+ - fonts/straight.md
62
69
  files:
63
70
  - CHANGELOG.md
64
71
  - LICENSE.txt
65
72
  - README.md
66
- - Rakefile
67
- - bin/console
68
- - bin/setup
69
- - examples/3d.rb
70
- - examples/block.rb
71
- - examples/doom.rb
72
- - examples/standard.rb
73
- - examples/star_wars_logo.rb
74
- - examples/starwars.rb
75
- - examples/straight.rb
76
73
  - fonts/3d.md
77
74
  - fonts/block.md
78
75
  - fonts/doom.md
@@ -89,12 +86,6 @@ files:
89
86
  - lib/tty/fonts/standard.yml
90
87
  - lib/tty/fonts/starwars.yml
91
88
  - lib/tty/fonts/straight.yml
92
- - spec/spec_helper.rb
93
- - spec/unit/write_spec.rb
94
- - tasks/console.rake
95
- - tasks/coverage.rake
96
- - tasks/spec.rake
97
- - tty-font.gemspec
98
89
  homepage: https://piotrmurach.github.io/tty
99
90
  licenses:
100
91
  - MIT
@@ -120,7 +111,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
120
111
  - !ruby/object:Gem::Version
121
112
  version: '0'
122
113
  requirements: []
123
- rubygems_version: 3.0.3
114
+ rubygems_version: 3.1.2
124
115
  signing_key:
125
116
  specification_version: 4
126
117
  summary: Terminal fonts
data/Rakefile DELETED
@@ -1,8 +0,0 @@
1
- require 'bundler/gem_tasks'
2
-
3
- FileList['tasks/**/*.rake'].each(&method(:import))
4
-
5
- desc 'Run all specs'
6
- task ci: %w[ spec ]
7
-
8
- task default: :spec
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "bundler/setup"
4
- require "tty/font"
5
-
6
- # You can add fixtures and/or initialization code here to make experimenting
7
- # with your gem easier. You can also use a different console, if you like.
8
-
9
- # (If you use this, don't forget to add pry to your Gemfile!)
10
- # require "pry"
11
- # Pry.start
12
-
13
- require "irb"
14
- IRB.start(__FILE__)
data/bin/setup DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
7
-
8
- # Do any other automated setup that you need to do here
@@ -1,19 +0,0 @@
1
- require 'pastel'
2
- require_relative '../lib/tty-font'
3
-
4
- pastel = Pastel.new
5
- font = TTY::Font.new("3d")
6
-
7
- puts pastel.green(font.write('3d'))
8
-
9
- puts font.write("ABCDEFGHIJKLMN")
10
- puts font.write("OPQRSTUVWXYZ")
11
-
12
- puts font.write("abcdefghijklmn")
13
- puts font.write("opqrstuvwxyz")
14
-
15
- puts font.write("0123456789")
16
-
17
- puts font.write("!#\$%^&*()-_+=")
18
-
19
- puts font.write("\"',.:;><?@][\\/}{|")
@@ -1,19 +0,0 @@
1
- require 'pastel'
2
- require_relative '../lib/tty-font'
3
-
4
- pastel = Pastel.new
5
- font = TTY::Font.new(:block)
6
-
7
- puts pastel.yellow(font.write("block"))
8
-
9
- puts font.write("ABCDEFGHIJKLMN")
10
- puts font.write("OPQRSTUVWXYZ")
11
-
12
- puts font.write("abcdefghijklmn")
13
- puts font.write("opqrstuvwxyz")
14
-
15
- puts font.write("0123456789")
16
-
17
- puts font.write("!#\$%^&*()-_+=")
18
-
19
- puts font.write("\"',.:;><?@][\\/")
@@ -1,19 +0,0 @@
1
- require 'pastel'
2
- require_relative '../lib/tty-font'
3
-
4
- pastel = Pastel.new
5
- font = TTY::Font.new(:doom)
6
-
7
- puts pastel.yellow(font.write("DOOM"))
8
-
9
- puts font.write("ABCDEFGHIJKLMN")
10
- puts font.write("OPQRSTUVWXYZ")
11
-
12
- puts font.write("abcdefghijklmn")
13
- puts font.write("opqrstuvwxyz")
14
-
15
- puts font.write("0123456789")
16
-
17
- puts font.write("!#\$%^&*()-_+=")
18
-
19
- puts font.write("\"',.:;><?@][\\/")
@@ -1,18 +0,0 @@
1
- require 'pastel'
2
- require_relative '../lib/tty-font'
3
-
4
- pastel = Pastel.new
5
- font = TTY::Font.new(:standard)
6
-
7
- puts pastel.green(font.write('standard'))
8
-
9
- puts font.write("ABCDEFGHIJKLMN")
10
- puts font.write("OPQRSTUVWXYZ")
11
-
12
- puts font.write("abcdefghijklmnopqrstuvwxyz")
13
-
14
- puts font.write("0123456789")
15
-
16
- puts font.write("!#\$%^&*()-_+=")
17
-
18
- puts font.write("\"',.:;><?@][\\/}{|")
@@ -1,52 +0,0 @@
1
- require 'pastel'
2
- require 'tty-cursor'
3
- require 'tty-screen'
4
-
5
- require_relative '../lib/tty-font'
6
-
7
- @pastel = Pastel.new
8
- @cursor = TTY::Cursor
9
- @font = TTY::Font.new(:starwars)
10
- @reg_font = TTY::Font.new(:straight)
11
-
12
- def lines_at(lines, x, y)
13
- lines.each_with_index.reduce([]) do |acc, (line, i)|
14
- acc << @cursor.move_to(x - line.size/2, y - lines.size/2 + i) + line
15
- acc
16
- end
17
- end
18
-
19
- def paint_logo
20
- @size = TTY::Screen.size
21
-
22
- print @cursor.save
23
- print @cursor.clear_screen
24
- print @cursor.hide
25
-
26
- # ["2606".to_i(16)].pack("U*")
27
- stars = ['.', '*']
28
-
29
- (@size[1] + @size[0]).times do |i|
30
- print @cursor.move_to(rand(@size[1]), rand(@size[0])) + stars[rand(2)]
31
- end
32
-
33
- center_x = @size[1]/2
34
- center_y = @size[0]/2
35
-
36
- lines = @font.write('STAR').split("\n")
37
- print @pastel.red(lines_at(lines, center_x, center_y - 5).join)
38
- lines = @reg_font.write("THE LAST JEDI", letter_spacing: 1).split("\n")
39
- print lines_at(lines, center_x, center_y).join
40
- lines = @font.write('WARS').split("\n")
41
- print @pastel.red(lines_at(lines, center_x, center_y + 4).join)
42
- end
43
-
44
- begin
45
- Signal.trap('SIGWINCH') { paint_logo }
46
- paint_logo
47
- $stdin.getc
48
- ensure
49
- print @cursor.show
50
- print @cursor.clear_screen
51
- print @cursor.restore
52
- end
@@ -1,19 +0,0 @@
1
- require 'pastel'
2
- require_relative '../lib/tty-font'
3
-
4
- pastel = Pastel.new
5
- font = TTY::Font.new(:starwars)
6
-
7
- puts pastel.red(font.write('starwars'))
8
-
9
- puts font.write("ABCDEFGHIJKLMN")
10
- puts font.write("OPQRSTUVWXYZ")
11
-
12
- puts font.write("abcdefghijklmn")
13
- puts font.write("opqrstuvwxyz")
14
-
15
- puts font.write("0123456789")
16
-
17
- puts font.write("!#\$%^&*()-_+=")
18
-
19
- puts font.write("\"',.:;><?@][\\/}{|")
@@ -1,17 +0,0 @@
1
- require 'pastel'
2
- require_relative '../lib/tty-font'
3
-
4
- pastel = Pastel.new
5
- font = TTY::Font.new(:straight)
6
-
7
- puts pastel.green(font.write('straight'))
8
-
9
- puts font.write("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
10
-
11
- puts font.write("abcdefghijklmnopqrstuvwxyz")
12
-
13
- puts font.write("0123456789")
14
-
15
- puts font.write("!#\$%^&*()-_+=")
16
-
17
- puts font.write("\"',.:;><?][\\/}{|")
@@ -1,29 +0,0 @@
1
- if ENV['COVERAGE'] || ENV['TRAVIS']
2
- require 'simplecov'
3
- require 'coveralls'
4
-
5
- SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
6
- SimpleCov::Formatter::HTMLFormatter,
7
- Coveralls::SimpleCov::Formatter
8
- ]
9
-
10
- SimpleCov.start do
11
- command_name 'spec'
12
- add_filter 'spec'
13
- end
14
- end
15
-
16
- require "bundler/setup"
17
- require "tty-font"
18
-
19
- RSpec.configure do |config|
20
- # Enable flags like --only-failures and --next-failure
21
- config.example_status_persistence_file_path = ".rspec_status"
22
-
23
- # Disable RSpec exposing methods globally on `Module` and `main`
24
- config.disable_monkey_patching!
25
-
26
- config.expect_with :rspec do |c|
27
- c.syntax = :expect
28
- end
29
- end
@@ -1,70 +0,0 @@
1
- RSpec.describe TTY::Font, '#write' do
2
- it "writes font lowercase characters out" do
3
- font = TTY::Font.new(:doom)
4
- expect(font.write('abcde')).to eq([
5
- " _ _ ",
6
- " | | | | ",
7
- " __ _ | |__ ___ __| | ___ ",
8
- " / _` || '_ \\ / __| / _` | / _ \\",
9
- "| (_| || |_) || (__ | (_| || __/",
10
- " \\__,_||_.__/ \\___| \\__,_| \\___|",
11
- " ",
12
- " ",
13
- ].join("\n"))
14
- end
15
-
16
- it "writes doom font digit characters out" do
17
- font = TTY::Font.new(:doom)
18
- expect(font.write('12345')).to eq([
19
- " __ _____ _____ ___ _____ ",
20
- "/ | / __ \\|____ | / || ___|",
21
- "`| | `' / /' / / / /| ||___ \\ ",
22
- " | | / / \\ \\/ /_| | \\ \\",
23
- "_| |_./ /___.___/ /\\___ |/\\__/ /",
24
- "\\___/\\_____/\\____/ |_/\\____/ ",
25
- " ",
26
- " ",
27
- ].join("\n"))
28
- end
29
-
30
- it "writes text with space in between letters" do
31
- font = TTY::Font.new(:doom)
32
- expect(font.write('ABC', letter_spacing: 2)).to eq([
33
- " ___ ______ _____ ",
34
- " / _ \\ | ___ \\ / __ \\",
35
- "/ /_\\ \\ | |_/ / | / \\/",
36
- "| _ | | ___ \\ | | ",
37
- "| | | | | |_/ / | \\__/\\",
38
- "\\_| |_/ \\____/ \\____/",
39
- " ",
40
- " ",
41
- ].join("\n"))
42
- end
43
-
44
- it "allows for space character" do
45
- font = TTY::Font.new(:doom)
46
- expect(font.write('a b')).to eq([
47
- " _ ",
48
- " | | ",
49
- " __ _ | |__ ",
50
- " / _` | | '_ \\ ",
51
- "| (_| | | |_) |",
52
- " \\__,_| |_.__/ ",
53
- " ",
54
- " ",
55
- ].join("\n"))
56
- end
57
-
58
- it "raises when font doesn't exist" do
59
- expect {
60
- TTY::Font.new(:unknown)
61
- }.to raise_error(ArgumentError, /Font 'unknown.yml' not found/)
62
- end
63
-
64
- it "raises when character doesn't exist" do
65
- font = TTY::Font.new(:doom)
66
- expect {
67
- font.write("みる")
68
- }.to raise_error(ArgumentError, /Font doom doesn't support 'み' character/)
69
- end
70
- end
@@ -1,11 +0,0 @@
1
- # encoding: utf-8
2
-
3
- desc 'Load gem inside irb console'
4
- task :console do
5
- require 'irb'
6
- require 'irb/completion'
7
- require File.join(__FILE__, '../../lib/tty-font')
8
- ARGV.clear
9
- IRB.start
10
- end
11
- task c: %w[ console ]
@@ -1,11 +0,0 @@
1
- # encoding: utf-8
2
-
3
- desc 'Measure code coverage'
4
- task :coverage do
5
- begin
6
- original, ENV['COVERAGE'] = ENV['COVERAGE'], 'true'
7
- Rake::Task['spec'].invoke
8
- ensure
9
- ENV['COVERAGE'] = original
10
- end
11
- end
@@ -1,29 +0,0 @@
1
- # encoding: utf-8
2
-
3
- begin
4
- require 'rspec/core/rake_task'
5
-
6
- desc 'Run all specs'
7
- RSpec::Core::RakeTask.new(:spec) do |task|
8
- task.pattern = 'spec/{unit,integration}{,/*/**}/*_spec.rb'
9
- end
10
-
11
- namespace :spec do
12
- desc 'Run unit specs'
13
- RSpec::Core::RakeTask.new(:unit) do |task|
14
- task.pattern = 'spec/unit{,/*/**}/*_spec.rb'
15
- end
16
-
17
- desc 'Run integration specs'
18
- RSpec::Core::RakeTask.new(:integration) do |task|
19
- task.pattern = 'spec/integration{,/*/**}/*_spec.rb'
20
- end
21
- end
22
-
23
- rescue LoadError
24
- %w[spec spec:unit spec:integration].each do |name|
25
- task name do
26
- $stderr.puts "In order to run #{name}, do `gem install rspec`"
27
- end
28
- end
29
- end
@@ -1,36 +0,0 @@
1
- lib = File.expand_path("../lib", __FILE__)
2
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
- require "tty/font/version"
4
-
5
- Gem::Specification.new do |spec|
6
- spec.name = "tty-font"
7
- spec.version = TTY::Font::VERSION
8
- spec.authors = ["Piotr Murach"]
9
- spec.email = ["me@piotrmurach.com"]
10
- spec.summary = %q{Terminal fonts}
11
- spec.description = %q{Write text in large stylized characters using a variety of terminal friendly fonts.}
12
- spec.homepage = "https://piotrmurach.github.io/tty"
13
- spec.license = "MIT"
14
- if spec.respond_to?(:metadata=)
15
- spec.metadata = {
16
- "allowed_push_host" => "https://rubygems.org",
17
- "bug_tracker_uri" => "https://github.com/piotrmurach/tty-font/issues",
18
- "changelog_uri" => "https://github.com/piotrmurach/tty-font/blob/master/CHANGELOG.md",
19
- "documentation_uri" => "https://www.rubydoc.info/gems/tty-font",
20
- "homepage_uri" => spec.homepage,
21
- "source_code_uri" => "https://github.com/piotrmurach/tty-font"
22
- }
23
- end
24
- spec.files = Dir['{lib,spec,examples}/**/*.{rb,yml}']
25
- spec.files += Dir['{bin,tasks}/*', 'tty-font.gemspec']
26
- spec.files += Dir['{fonts/*.md}', 'README.md', 'CHANGELOG.md']
27
- spec.files += Dir['LICENSE.txt', 'Rakefile']
28
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
29
- spec.require_paths = ["lib"]
30
-
31
- spec.required_ruby_version = '>= 2.0.0'
32
-
33
- spec.add_development_dependency "bundler", ">= 1.5"
34
- spec.add_development_dependency "rspec", "~> 3.0"
35
- spec.add_development_dependency "rake"
36
- end