L2 0.4.0 → 0.5.1

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 +17 -1
  3. metadata +18 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ddeba38d40acfcbecbd60a3d2fc00e2e1ca7758924796c8dd06ccb2d2ac89b07
4
- data.tar.gz: 4978f6b0d0572e46ce701d3225db0d9e59ccff1a74b34733dc76fa265848ae39
3
+ metadata.gz: 1260aec7e85dc8ab823d5c3934d3109004978f8696a5b33a2ce074b58a255f5f
4
+ data.tar.gz: c307860877c31b19ad2fb3bd4b84ebb151dc7d5378a56291b50214efa63daa91
5
5
  SHA512:
6
- metadata.gz: f05e7a81b8c3e6754b337f68bd5c5cfbd193eea41bcb81cc58d4392012e27409ec1d57c6a7f7b7bac89c3273127ccba6b2396bcd1ae1db9b24af96aa85066b3a
7
- data.tar.gz: db0b6a2934ee2c0d267344b0d1499d1f980c4f9f1f992795a701973b46f3920996456b6ce0df924c713643f32a3276c5d14145b2892ebc9c6317cdaf3d4fc9a5
6
+ metadata.gz: f41b27e3c76c37599b3c25cfc2311c93ab9bbb4d6082b35c5d221ae701208e7083f569158d3ab992da5a9c5a87264e5d8f897e95ba44aef8c189af5c8e9cd24b
7
+ data.tar.gz: 5b6c3500eecbb3485a51642062462e70e507b3f6f29a4c1be17b88a8348309bacdc7ded21e4ef24d938a185a499c0e611a3ddff2a388111ef81e100779b5277b
data/lib/L2.rb CHANGED
@@ -29,6 +29,8 @@ Building a better future, one line of code at a time.
29
29
  // ·
30
30
  =end
31
31
 
32
+ require "ruby_cowsay"
33
+
32
34
  module L2
33
35
 
34
36
  # standard color palette for texts
@@ -56,7 +58,7 @@ module L2
56
58
 
57
59
  # calculate the console width
58
60
  # tputcols is not available on windows
59
- WIDTH = `tput cols`.to_i rescue 1;
61
+ WIDTH = `tput cols`.to_i rescue 5;
60
62
 
61
63
 
62
64
  def self.m *messages
@@ -176,6 +178,20 @@ module L2
176
178
 
177
179
  end
178
180
 
181
+ def self.cow message
182
+
183
+ # ids of the prettiest cows in the library
184
+ pretty_cows = [46,33,32,31,29,27,21,10,5]
185
+
186
+ # get a random cow id
187
+ random_cows = rand(0..(pretty_cows.size - 1))
188
+
189
+ br()
190
+
191
+ # show simple text message
192
+ puts Cow.new({ :cow => Cow.cows[pretty_cows[random_cows]] }).say(message)
193
+ end
194
+
179
195
 
180
196
  # · Aliases
181
197
 
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: L2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.1
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: 2022-10-27 00:00:00.000000000 Z
12
- dependencies: []
11
+ date: 2023-01-03 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: ruby_cowsay
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 0.1.3
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 0.1.3
13
27
  description:
14
28
  email:
15
29
  - hello@lesli.tech
@@ -25,7 +39,7 @@ metadata:
25
39
  homepage_uri: https://github.com/LesliTech/L2
26
40
  source_code_uri: https://github.com/LesliTech/L2
27
41
  bug_tracker_uri: https://github.com/LesliTech/L2/issues
28
- changelog_uri: https://github.com/LesliTech/L2/releases/tag/v0.4.0
42
+ changelog_uri: https://github.com/LesliTech/L2/releases/tag/v0.5.1
29
43
  post_install_message:
30
44
  rdoc_options: []
31
45
  require_paths: