L2 0.5.1 → 0.5.3

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 +4 -4
  2. data/lib/L2.rb +33 -7
  3. metadata +18 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1260aec7e85dc8ab823d5c3934d3109004978f8696a5b33a2ce074b58a255f5f
4
- data.tar.gz: c307860877c31b19ad2fb3bd4b84ebb151dc7d5378a56291b50214efa63daa91
3
+ metadata.gz: 72bec19656fedce4d1ba29e52e69ab7fb3126ca267f0dd21fc280496c916df86
4
+ data.tar.gz: d54e89941967353bc3995ac8c9f70d3ecede70f0ecbc3a15124817ea5d23398f
5
5
  SHA512:
6
- metadata.gz: f41b27e3c76c37599b3c25cfc2311c93ab9bbb4d6082b35c5d221ae701208e7083f569158d3ab992da5a9c5a87264e5d8f897e95ba44aef8c189af5c8e9cd24b
7
- data.tar.gz: 5b6c3500eecbb3485a51642062462e70e507b3f6f29a4c1be17b88a8348309bacdc7ded21e4ef24d938a185a499c0e611a3ddff2a388111ef81e100779b5277b
6
+ metadata.gz: d620fe151f7cc4497ef5617eab8b74fc534039abe5688c43146c25ddbd4f9e1c9e82d2a0f3c1288f5338885105fd19bde38aa3cbd5cf65624b61ecda4df70263
7
+ data.tar.gz: 30800e7c63b08e69f1a0e21db96ab679328dec1d5addf10388b34eb6e30f6b7105f81aa64b859af530ea7801656040b2cd9baa471093b5ec33102892762fa468
data/lib/L2.rb CHANGED
@@ -29,8 +29,11 @@ Building a better future, one line of code at a time.
29
29
  // ·
30
30
  =end
31
31
 
32
+
33
+ # ·
32
34
  require "ruby_cowsay"
33
35
 
36
+ # ·
34
37
  module L2
35
38
 
36
39
  # standard color palette for texts
@@ -58,17 +61,17 @@ module L2
58
61
 
59
62
  # calculate the console width
60
63
  # tputcols is not available on windows
61
- WIDTH = `tput cols`.to_i rescue 5;
64
+ WIDTH = `tput cols`.to_i rescue WIDTH = 1;
62
65
 
63
66
 
64
67
  def self.m *messages
65
- puts(messages.join("\n"))
68
+ messages.each { |m| puts(m) }
66
69
  end
67
-
68
-
70
+
71
+
69
72
  def self.msg *messages
70
- separator_blank(2)
71
- puts(messages.join("\n"))
73
+ separator_blank
74
+ self.m(messages)
72
75
  separator_line
73
76
  separator_blank
74
77
  end
@@ -178,7 +181,7 @@ module L2
178
181
 
179
182
  end
180
183
 
181
- def self.cow message
184
+ def self.cow message="Process completed!"
182
185
 
183
186
  # ids of the prettiest cows in the library
184
187
  pretty_cows = [46,33,32,31,29,27,21,10,5]
@@ -192,6 +195,26 @@ module L2
192
195
  puts Cow.new({ :cow => Cow.cows[pretty_cows[random_cows]] }).say(message)
193
196
  end
194
197
 
198
+ def self.spin_it(times)
199
+ pinwheel = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏']
200
+ # times.times do
201
+ # print "\b" + pinwheel.rotate!.first
202
+ # sleep(0.1)
203
+ # end
204
+
205
+ check = "\u2713"
206
+ heart = "\u2665"
207
+ package = "\u{1F4E6}"
208
+ fire_and_one_hundred = "\u{1F525 1F4AF}"
209
+ puts heart
210
+ puts package
211
+ puts fire_and_one_hundred
212
+ puts self.colorize(check, :green)
213
+ pp check
214
+ end
215
+
216
+
217
+
195
218
 
196
219
  # · Aliases
197
220
 
@@ -238,7 +261,10 @@ module L2
238
261
 
239
262
 
240
263
  def self.pretty(message, colour = :default, bg_colour = :default)
264
+
241
265
  width = WIDTH - message.length - 4
266
+ width = 1 if width.negative?
267
+
242
268
  return colorize("\ \ #{ message } #{"\ " * width}", colour, bg_colour)
243
269
  end
244
270
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: L2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - The Lesli Development Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-01-03 00:00:00.000000000 Z
11
+ date: 2024-03-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby_cowsay
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: 0.1.3
27
+ - !ruby/object:Gem::Dependency
28
+ name: cli-ui
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 2.2.3
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 2.2.3
27
41
  description:
28
42
  email:
29
43
  - hello@lesli.tech
@@ -39,7 +53,7 @@ metadata:
39
53
  homepage_uri: https://github.com/LesliTech/L2
40
54
  source_code_uri: https://github.com/LesliTech/L2
41
55
  bug_tracker_uri: https://github.com/LesliTech/L2/issues
42
- changelog_uri: https://github.com/LesliTech/L2/releases/tag/v0.5.1
56
+ changelog_uri: https://github.com/LesliTech/L2/releases/tag/v0.5.3
43
57
  post_install_message:
44
58
  rdoc_options: []
45
59
  require_paths:
@@ -55,7 +69,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
55
69
  - !ruby/object:Gem::Version
56
70
  version: '0'
57
71
  requirements: []
58
- rubygems_version: 3.1.4
72
+ rubygems_version: 3.3.7
59
73
  signing_key:
60
74
  specification_version: 4
61
75
  summary: Message utilities for the Ruby console.