tty-font 0.2.0 → 0.3.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
- SHA1:
3
- metadata.gz: a04850a2bc3ff2ea8a003c245f440f58bea9dc88
4
- data.tar.gz: 0e10290aac997330a2556a13f9e7f250e9762de6
2
+ SHA256:
3
+ metadata.gz: 73df452ac43dd2d38595a3cc6214c2189d7c562c760058f60c240ca1856de619
4
+ data.tar.gz: ecdff8d368c8b41a36fbd548c014a6c70fc70ba38e33c2362b10ac9e8d4b52f4
5
5
  SHA512:
6
- metadata.gz: 55fcb422aca75166e4bc80fab96ac8c78a9715f228f718a846ac5008dc9ecf49fd4af254b28950c3c8d95a818538c17f5aed18b65473270670c69b82974eba9a
7
- data.tar.gz: 5f9244ea33eeda0776620b0c179f8a2be0c5b276784b4e5e8b98b9591ff002776749c1b7653bf56b0df4279c84512e062e6057e3879f2c2d93cb2e4ea6881f0b
6
+ metadata.gz: e60697e1e66084bd9151a07c5fc1e6278649deefeebff8db0667ac35b69fb6a260cd16c726b41e738a0b64ffca10100452bb8c077dfa1f29c717edfd7135e3e2
7
+ data.tar.gz: d552cbda2c0022c6cc0485ac7904669e5018679bdb9732793f088bebf22488c15d9966b664cb604fcc2d0e4c0312795d4f1ac93b53ff853ecbdf399689b2a02d
@@ -1,5 +1,11 @@
1
1
  # Change log
2
2
 
3
+ ## [v0.3.0] - 2018-11-01
4
+
5
+ ### Changed
6
+ * Change gemspec to require Ruby >= 2.0.0
7
+ * Change gemspec to load files without calling git
8
+
3
9
  ## [v0.2.0] - 2018-02-20
4
10
 
5
11
  ### Added
@@ -15,5 +21,6 @@
15
21
 
16
22
  * Initial implementation and release
17
23
 
24
+ [v0.3.0]: https://github.com/piotrmurach/tty-font/compare/v0.2.0...v0.3.0
18
25
  [v0.2.0]: https://github.com/piotrmurach/tty-font/compare/v0.1.0...v0.2.0
19
26
  [v0.1.0]: https://github.com/piotrmurach/tty-font/compare/v0.1.0
data/README.md CHANGED
@@ -1,3 +1,7 @@
1
+ <div align="center">
2
+ <a href="https://piotrmurach.github.io/tty" target="_blank"><img width="130" src="https://cdn.rawgit.com/piotrmurach/tty/master/images/tty.png" alt="tty logo" /></a>
3
+ </div>
4
+
1
5
  # TTY::Font [![Gitter](https://badges.gitter.im/Join%20Chat.svg)][gitter]
2
6
 
3
7
  [![Gem Version](https://badge.fury.io/rb/tty-font.svg)][gem]
@@ -1,5 +1,7 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module TTY
2
4
  class Font
3
- VERSION = "0.2.0"
5
+ VERSION = "0.3.0"
4
6
  end # Font
5
7
  end # TTY
@@ -0,0 +1,29 @@
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
@@ -0,0 +1,70 @@
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
@@ -11,13 +11,16 @@ Gem::Specification.new do |spec|
11
11
  spec.description = %q{Write text in large stylized characters using a variety of terminal friendly fonts.}
12
12
  spec.homepage = 'https://github.com/piotrmurach/tty-spinner'
13
13
  spec.license = "MIT"
14
- spec.files = `git ls-files -z`.split("\x0").reject do |f|
15
- f.match(%r{^(test|spec|features)/})
16
- end
17
- spec.bindir = "exe"
14
+
15
+ spec.files = Dir['{lib,spec,examples}/**/*.{rb,yml}']
16
+ spec.files += Dir['{bin,tasks}/*', 'tty-font.gemspec']
17
+ spec.files += Dir['{fonts/*.md}', 'README.md', 'CHANGELOG.md']
18
+ spec.files += Dir['LICENSE.txt', 'Rakefile']
18
19
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
19
20
  spec.require_paths = ["lib"]
20
21
 
22
+ spec.required_ruby_version = '>= 2.0.0'
23
+
21
24
  spec.add_development_dependency "bundler", "~> 1.16"
22
25
  spec.add_development_dependency "rake", "~> 10.0"
23
26
  spec.add_development_dependency "rspec", "~> 3.0"
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.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Piotr Murach
8
8
  autorequire:
9
- bindir: exe
9
+ bindir: bin
10
10
  cert_chain: []
11
- date: 2018-02-20 00:00:00.000000000 Z
11
+ date: 2018-11-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -59,17 +59,10 @@ executables: []
59
59
  extensions: []
60
60
  extra_rdoc_files: []
61
61
  files:
62
- - ".gitignore"
63
- - ".rspec"
64
- - ".travis.yml"
65
62
  - CHANGELOG.md
66
- - CODE_OF_CONDUCT.md
67
- - Gemfile
68
63
  - LICENSE.txt
69
64
  - README.md
70
65
  - Rakefile
71
- - appveyor.yml
72
- - assets/starwars_logo.png
73
66
  - bin/console
74
67
  - bin/setup
75
68
  - examples/3d.rb
@@ -92,6 +85,8 @@ files:
92
85
  - lib/tty/font/starwars.yml
93
86
  - lib/tty/font/straight.yml
94
87
  - lib/tty/font/version.rb
88
+ - spec/spec_helper.rb
89
+ - spec/unit/write_spec.rb
95
90
  - tasks/console.rake
96
91
  - tasks/coverage.rake
97
92
  - tasks/spec.rake
@@ -108,7 +103,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
108
103
  requirements:
109
104
  - - ">="
110
105
  - !ruby/object:Gem::Version
111
- version: '0'
106
+ version: 2.0.0
112
107
  required_rubygems_version: !ruby/object:Gem::Requirement
113
108
  requirements:
114
109
  - - ">="
@@ -116,7 +111,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
116
111
  version: '0'
117
112
  requirements: []
118
113
  rubyforge_project:
119
- rubygems_version: 2.5.1
114
+ rubygems_version: 2.7.3
120
115
  signing_key:
121
116
  specification_version: 4
122
117
  summary: Terminal fonts
data/.gitignore DELETED
@@ -1,12 +0,0 @@
1
- /.bundle/
2
- /.yardoc
3
- /_yardoc/
4
- /Gemfile.lock
5
- /coverage/
6
- /doc/
7
- /pkg/
8
- /spec/reports/
9
- /tmp/
10
-
11
- # rspec failure tracking
12
- .rspec_status
data/.rspec DELETED
@@ -1,4 +0,0 @@
1
- --format documentation
2
- --color
3
- --require spec_helper
4
- --warnings
@@ -1,25 +0,0 @@
1
- ---
2
- language: ruby
3
- sudo: false
4
- cache: bundler
5
- before_install: "gem update bundler"
6
- script: "bundle exec rake ci"
7
- rvm:
8
- - 2.0.0
9
- - 2.1.10
10
- - 2.2.8
11
- - 2.3.6
12
- - 2.4.3
13
- - 2.5.0
14
- - ruby-head
15
- - jruby-9000
16
- - jruby-head
17
- matrix:
18
- allow_failures:
19
- - rvm: ruby-head
20
- - rvm: jruby-head
21
- fast_finish: true
22
- branches:
23
- only: master
24
- notifications:
25
- email: false
@@ -1,74 +0,0 @@
1
- # Contributor Covenant Code of Conduct
2
-
3
- ## Our Pledge
4
-
5
- In the interest of fostering an open and welcoming environment, we as
6
- contributors and maintainers pledge to making participation in our project and
7
- our community a harassment-free experience for everyone, regardless of age, body
8
- size, disability, ethnicity, gender identity and expression, level of experience,
9
- nationality, personal appearance, race, religion, or sexual identity and
10
- orientation.
11
-
12
- ## Our Standards
13
-
14
- Examples of behavior that contributes to creating a positive environment
15
- include:
16
-
17
- * Using welcoming and inclusive language
18
- * Being respectful of differing viewpoints and experiences
19
- * Gracefully accepting constructive criticism
20
- * Focusing on what is best for the community
21
- * Showing empathy towards other community members
22
-
23
- Examples of unacceptable behavior by participants include:
24
-
25
- * The use of sexualized language or imagery and unwelcome sexual attention or
26
- advances
27
- * Trolling, insulting/derogatory comments, and personal or political attacks
28
- * Public or private harassment
29
- * Publishing others' private information, such as a physical or electronic
30
- address, without explicit permission
31
- * Other conduct which could reasonably be considered inappropriate in a
32
- professional setting
33
-
34
- ## Our Responsibilities
35
-
36
- Project maintainers are responsible for clarifying the standards of acceptable
37
- behavior and are expected to take appropriate and fair corrective action in
38
- response to any instances of unacceptable behavior.
39
-
40
- Project maintainers have the right and responsibility to remove, edit, or
41
- reject comments, commits, code, wiki edits, issues, and other contributions
42
- that are not aligned to this Code of Conduct, or to ban temporarily or
43
- permanently any contributor for other behaviors that they deem inappropriate,
44
- threatening, offensive, or harmful.
45
-
46
- ## Scope
47
-
48
- This Code of Conduct applies both within project spaces and in public spaces
49
- when an individual is representing the project or its community. Examples of
50
- representing a project or community include using an official project e-mail
51
- address, posting via an official social media account, or acting as an appointed
52
- representative at an online or offline event. Representation of a project may be
53
- further defined and clarified by project maintainers.
54
-
55
- ## Enforcement
56
-
57
- Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
- reported by contacting the project team at [email]. All
59
- complaints will be reviewed and investigated and will result in a response that
60
- is deemed necessary and appropriate to the circumstances. The project team is
61
- obligated to maintain confidentiality with regard to the reporter of an incident.
62
- Further details of specific enforcement policies may be posted separately.
63
-
64
- Project maintainers who do not follow or enforce the Code of Conduct in good
65
- faith may face temporary or permanent repercussions as determined by other
66
- members of the project's leadership.
67
-
68
- ## Attribution
69
-
70
- This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
- available at [http://contributor-covenant.org/version/1/4][version]
72
-
73
- [homepage]: http://contributor-covenant.org
74
- [version]: http://contributor-covenant.org/version/1/4/
data/Gemfile DELETED
@@ -1,15 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
-
5
- gemspec
6
-
7
- gem 'pastel'
8
- gem 'tty-cursor'
9
- gem 'tty-screen'
10
-
11
- group :test do
12
- gem 'benchmark-ips', '~> 2.0.0'
13
- gem 'simplecov', '~> 0.10.0'
14
- gem 'coveralls', '~> 0.8.2'
15
- end
@@ -1,23 +0,0 @@
1
- ---
2
- install:
3
- - SET PATH=C:\Ruby%ruby_version%\bin;%PATH%
4
- - ruby --version
5
- - gem --version
6
- - bundle install
7
- build: off
8
- test_script:
9
- - bundle exec rake ci
10
- environment:
11
- matrix:
12
- - ruby_version: "200"
13
- - ruby_version: "200-x64"
14
- - ruby_version: "21"
15
- - ruby_version: "21-x64"
16
- - ruby_version: "22"
17
- - ruby_version: "22-x64"
18
- - ruby_version: "23"
19
- - ruby_version: "23-x64"
20
- - ruby_version: "24"
21
- - ruby_version: "24-x64"
22
- - ruby_version: "25"
23
- - ruby_version: "25-x64"
Binary file