yuurisan 1.0.0 → 1.0.2
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 +145 -0
- data/lib/yuurisan/banner.rb +10 -6
- data/lib/yuurisan/title.rb +3 -0
- data/lib/yuurisan/version.rb +3 -1
- data/lib/yuurisan.rb +6 -0
- data/yuurisan.gemspec +2 -2
- metadata +4 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d17eb4e83166539fef4d084067a49aadbbc920e6fd8ae74a635f7e7903633dca
|
|
4
|
+
data.tar.gz: 74f5d952173220260e0b5f86dcb0afa77b7366b923abb8fcabb9fa7f86e529db
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: '0182fb7e2943895da303322aa5c194c03faac66dd1f9a50f0d4034d372c1d8f43dc095c4b9e6fc1ba9f1d4567d21e60ec890582affaa151f232a6ece5821fe08'
|
|
7
|
+
data.tar.gz: 655c90d7e41af38534ec0139156232650e31bb399e83a324b4877dd6fb55393309b0b0720b0f5e75e82f470f8b1124da5182f20a8a989fe4112764969c4f2374
|
data/README.md
ADDED
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
<img width="100%" alt="header" src="https://capsule-render.vercel.app/api?type=waving&height=210&text=yuurisan&fontAlign=50&fontAlignY=36&fontSize=56&desc=Ruby%20Gem%20%7C%20ASCII%20Banner%20%7C%20Terminal%20Title%20Setter&descAlign=50&descAlignY=58"/>
|
|
4
|
+
|
|
5
|
+
<img alt="typing" src="https://readme-typing-svg.demolab.com?font=Inter&size=18&duration=3000&pause=650¢er=true&vCenter=true&width=900&lines=ASCII+Banner+with+Figlet+Style+in+Ruby;Set+Terminal+Tab+Title+from+Your+Bot;One+Call+to+Show+Banner+and+Set+Title;Matches+Python+colorama+Fore%2FStyle+Colors;Works+on+Linux+%2F+macOS+%2F+Windows+Terminal"/>
|
|
6
|
+
|
|
7
|
+
<p>
|
|
8
|
+
<img alt="ruby" src="https://img.shields.io/badge/Ruby-3.2+-CC342D?logo=ruby&logoColor=white"/>
|
|
9
|
+
<img alt="gem" src="https://img.shields.io/badge/RubyGems-yuurisan-CC342D?logo=rubygems&logoColor=white"/>
|
|
10
|
+
<img alt="version" src="https://img.shields.io/badge/Version-1.0.2-111111"/>
|
|
11
|
+
<img alt="author" src="https://img.shields.io/badge/by-Yuurisandesu-111111"/>
|
|
12
|
+
</p>
|
|
13
|
+
|
|
14
|
+
<p>
|
|
15
|
+
<b>yuurisan</b> is a Ruby gem that prints a styled ASCII art banner and sets the terminal tab title for your Ruby bots and scripts.<br/>
|
|
16
|
+
Drop it into any Ruby project and call one method to get a clean startup banner with your bot name, community link, and timestamp -- styled with ANSI colors that match the Python colorama palette used across Yuurisandesu's projects.<br/>
|
|
17
|
+
Built and distributed by <b>Yuurisandesu</b>.
|
|
18
|
+
</p>
|
|
19
|
+
|
|
20
|
+
</div>
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Table of Contents
|
|
25
|
+
|
|
26
|
+
- [Requirements](#requirements)
|
|
27
|
+
- [Installation](#installation)
|
|
28
|
+
- [Usage](#usage)
|
|
29
|
+
- [API Reference](#api-reference)
|
|
30
|
+
- [File Structure](#file-structure)
|
|
31
|
+
- [Disclaimer](#disclaimer)
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## Requirements
|
|
36
|
+
|
|
37
|
+
- Ruby `3.2+`
|
|
38
|
+
- RubyGems
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## Installation
|
|
43
|
+
|
|
44
|
+
Add to your `Gemfile`:
|
|
45
|
+
|
|
46
|
+
```ruby
|
|
47
|
+
gem "yuurisan"
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Then run:
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
bundle install
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Or install directly:
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
gem install yuurisan
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## Usage
|
|
65
|
+
|
|
66
|
+
Require the gem and call `Yuurisan.banner` at the top of your bot or script:
|
|
67
|
+
|
|
68
|
+
```ruby
|
|
69
|
+
require "yuurisan"
|
|
70
|
+
|
|
71
|
+
Yuurisan.banner("My Bot Name")
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
This clears the terminal, prints the ASCII art banner, and sets the terminal tab title all in one call.
|
|
75
|
+
|
|
76
|
+
To set only the terminal title without printing the banner:
|
|
77
|
+
|
|
78
|
+
```ruby
|
|
79
|
+
Yuurisan.set_title("My Bot Name")
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Example output in the terminal:
|
|
83
|
+
|
|
84
|
+
```
|
|
85
|
+
__ __ _ _
|
|
86
|
+
\ \ / / _ _ _ _ __(_)___ __ _ _ __ __| | ___ ___ _ _
|
|
87
|
+
\ V / | | | | | | '__| / __|/ _` | '_ \ / _` |/ _ \/ __| | | |
|
|
88
|
+
| || |_| | |_| | | | \__ \ (_| | | | | (_| | __/\__ \ |_| |
|
|
89
|
+
|_| \__,_|\__,_|_| |_|___/\__,_|_| |_|\__,_|\___||___/\__,_|
|
|
90
|
+
|
|
91
|
+
Welcome to Yuuri's My Bot Name
|
|
92
|
+
Join our community: https://t.me/Y3YuYuYo
|
|
93
|
+
Current time: 13-08-2026 12:00:00
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## API Reference
|
|
99
|
+
|
|
100
|
+
### `Yuurisan.banner(bot_name)`
|
|
101
|
+
|
|
102
|
+
Clears the terminal, renders the `Yuurisandesu` ASCII art in cyan bold using the standard figlet font via the `artii` gem, then prints the welcome line, community link, and current timestamp. Also sets the terminal tab title.
|
|
103
|
+
|
|
104
|
+
| Parameter | Type | Description |
|
|
105
|
+
|---|---|---|
|
|
106
|
+
| `bot_name` | String | Name of your bot, shown in the welcome line and terminal title |
|
|
107
|
+
|
|
108
|
+
### `Yuurisan.set_title(bot_name)`
|
|
109
|
+
|
|
110
|
+
Sets the terminal tab title to `<bot_name> by : 佐賀県産 (YUURI)` using an ANSI escape sequence. Works on xterm, iTerm2, GNOME Terminal, and Windows Terminal.
|
|
111
|
+
|
|
112
|
+
| Parameter | Type | Description |
|
|
113
|
+
|---|---|---|
|
|
114
|
+
| `bot_name` | String | Name of your bot, shown in the terminal tab title |
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## File Structure
|
|
119
|
+
|
|
120
|
+
```text
|
|
121
|
+
Yuurisan-rb/
|
|
122
|
+
├── .github/
|
|
123
|
+
│ └── workflows/
|
|
124
|
+
│ └── publish.yml # CI: publish gem to RubyGems on version tag push
|
|
125
|
+
├── lib/
|
|
126
|
+
│ ├── yuurisan.rb # Main entry point, exposes Yuurisan.banner and Yuurisan.set_title
|
|
127
|
+
│ └── yuurisan/
|
|
128
|
+
│ ├── banner.rb # ASCII art rendering and ANSI color output
|
|
129
|
+
│ ├── title.rb # Terminal tab title setter via ANSI escape
|
|
130
|
+
│ └── version.rb # Gem version constant (1.0.2)
|
|
131
|
+
├── LICENSE
|
|
132
|
+
└── .gitignore
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
---
|
|
136
|
+
|
|
137
|
+
## Disclaimer
|
|
138
|
+
|
|
139
|
+
This tool is built for educational and technical exploration purposes. Use it wisely and at your own responsibility.
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
<div align="center">
|
|
144
|
+
<img width="100%" alt="footer" src="https://capsule-render.vercel.app/api?type=waving&height=120§ion=footer"/>
|
|
145
|
+
</div>
|
data/lib/yuurisan/banner.rb
CHANGED
|
@@ -1,23 +1,27 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
require "time"
|
|
2
4
|
require "artii"
|
|
3
5
|
|
|
4
6
|
module Yuurisan
|
|
5
7
|
module Banner
|
|
8
|
+
# ANSI color codes — matches colorama Fore/Style used in Python version
|
|
6
9
|
RESET = "\e[0m"
|
|
7
10
|
BOLD = "\e[1m"
|
|
8
|
-
CYAN = "\e[36m"
|
|
9
|
-
MAGENTA = "\e[35m"
|
|
10
|
-
GREEN = "\e[32m"
|
|
11
|
-
YELLOW = "\e[33m"
|
|
11
|
+
CYAN = "\e[36m" # Fore.CYAN
|
|
12
|
+
MAGENTA = "\e[35m" # Fore.MAGENTA
|
|
13
|
+
GREEN = "\e[32m" # Fore.GREEN
|
|
14
|
+
YELLOW = "\e[33m" # Fore.YELLOW
|
|
12
15
|
|
|
13
16
|
def self.show(bot_name)
|
|
14
17
|
system("cls") || system("clear")
|
|
15
18
|
|
|
16
|
-
|
|
19
|
+
# pyfiglet.figlet_format("Yuurisandesu", font="standard") equivalent
|
|
20
|
+
ascii_art = Artii::Base.new(font: "standard").asciify("Yuurisandesu").rstrip
|
|
17
21
|
|
|
18
22
|
timestamp = Time.now.strftime("%d-%m-%Y %H:%M:%S")
|
|
19
23
|
|
|
20
|
-
puts "#{CYAN}#{BOLD}#{ascii_art}#{RESET}"
|
|
24
|
+
puts "#{CYAN}#{BOLD}#{ascii_art}#{RESET}\n"
|
|
21
25
|
puts "#{MAGENTA}#{BOLD}Welcome to Yuuri's #{bot_name}#{RESET}"
|
|
22
26
|
puts "#{GREEN}#{BOLD}Join our community: https://t.me/Y3YuYuYo#{RESET}"
|
|
23
27
|
puts "#{YELLOW}#{BOLD}Current time: #{timestamp}#{RESET}"
|
data/lib/yuurisan/title.rb
CHANGED
data/lib/yuurisan/version.rb
CHANGED
data/lib/yuurisan.rb
CHANGED
|
@@ -1,13 +1,19 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
require_relative "yuurisan/version"
|
|
2
4
|
require_relative "yuurisan/banner"
|
|
3
5
|
require_relative "yuurisan/title"
|
|
4
6
|
|
|
5
7
|
module Yuurisan
|
|
8
|
+
# Sets terminal title and prints the ASCII banner
|
|
9
|
+
# Usage: Yuurisan.banner("My Bot")
|
|
6
10
|
def self.banner(bot_name)
|
|
7
11
|
set_title(bot_name)
|
|
8
12
|
Banner.show(bot_name)
|
|
9
13
|
end
|
|
10
14
|
|
|
15
|
+
# Only sets the terminal tab title
|
|
16
|
+
# Usage: Yuurisan.set_title("My Bot")
|
|
11
17
|
def self.set_title(bot_name)
|
|
12
18
|
Title.set(bot_name)
|
|
13
19
|
end
|
data/yuurisan.gemspec
CHANGED
|
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
|
|
|
9
9
|
spec.email = [""]
|
|
10
10
|
|
|
11
11
|
spec.summary = "Shared utility library for all Yuuri bots banner & terminal title"
|
|
12
|
-
spec.description = "Ruby port of yuurisan-
|
|
12
|
+
spec.description = "Ruby port of yuurisan-lib. Provides reusable ASCII banner generation " \
|
|
13
13
|
"and terminal window title management so every Yuuri bot looks consistent."
|
|
14
14
|
spec.homepage = "https://github.com/Yuurichan-N3/yuurisan-rb"
|
|
15
15
|
spec.license = "MIT"
|
|
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
|
|
|
20
20
|
spec.metadata["source_code_uri"] = "https://github.com/Yuurichan-N3/yuurisan-rb"
|
|
21
21
|
|
|
22
22
|
# Include all lib files
|
|
23
|
-
spec.files = Dir.glob("lib/**/*.rb") + ["yuurisan.gemspec", "LICENSE"]
|
|
23
|
+
spec.files = Dir.glob("lib/**/*.rb") + ["yuurisan.gemspec", "README.md", "LICENSE"]
|
|
24
24
|
|
|
25
25
|
spec.require_paths = ["lib"]
|
|
26
26
|
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: yuurisan
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Yuurisandesu
|
|
@@ -23,8 +23,8 @@ dependencies:
|
|
|
23
23
|
- - "~>"
|
|
24
24
|
- !ruby/object:Gem::Version
|
|
25
25
|
version: '2.1'
|
|
26
|
-
description: Ruby port of yuurisan-
|
|
27
|
-
terminal window title management so every Yuuri bot looks consistent.
|
|
26
|
+
description: Ruby port of yuurisan-lib. Provides reusable ASCII banner generation
|
|
27
|
+
and terminal window title management so every Yuuri bot looks consistent.
|
|
28
28
|
email:
|
|
29
29
|
- ''
|
|
30
30
|
executables: []
|
|
@@ -32,6 +32,7 @@ extensions: []
|
|
|
32
32
|
extra_rdoc_files: []
|
|
33
33
|
files:
|
|
34
34
|
- LICENSE
|
|
35
|
+
- README.md
|
|
35
36
|
- lib/yuurisan.rb
|
|
36
37
|
- lib/yuurisan/banner.rb
|
|
37
38
|
- lib/yuurisan/title.rb
|