L2 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
2
  SHA256:
3
- metadata.gz: 7bc7d0ef98bee3aafbcd864b5e84216d9a161325adacf580b9056d2a6af8ce23
4
- data.tar.gz: 7e203c92debe58286027cb2d78dfa62694ac2f37f0c1b84c415b19f86ce23998
3
+ metadata.gz: 79f81940a9c5d179bab99a69088d187541a0c1566967df0d13e882063cdd3c71
4
+ data.tar.gz: f8d68da4292939f0bfded98a955ecb6d40861c52c8462f2d366b88b52ca826d2
5
5
  SHA512:
6
- metadata.gz: 15ee7b554fcb3ff2518ecc4a8db11d390e4186bb119eac0cd6e43757fbad6bbd9dcbf2cd18578865a9e29b86d04c0055841b8361eac94f3caab86795cdb093bf
7
- data.tar.gz: e07d9d67cd4fe101d55f7528e1d2c55e4b1c01dae9f2be66554444abad6f25f6ea013d0ca378513287004eaac25205760f7ad51fef2481d9debb5a9c962df1cb
6
+ metadata.gz: b130dce7642cdd99c25be5001b5693e430a1209100804be427ad2e1f4996b2a9352412e820b592ce6a88b0268b14df662d1c94199d075610d9a836134e65ca1b
7
+ data.tar.gz: 8ba4c32eaffabfe0ae8fe4f887cd0ce7a1ccf7b34898fddb8432022ed2d113ab087846b2ae96344fb387281fb9a80c6cd2f0e07359a9d8d633a60636af3eec77
data/Gemfile CHANGED
@@ -1,10 +1,38 @@
1
- # frozen_string_literal: true
1
+ =begin
2
+
3
+ Copyright (c) 2022, Lesli Technologies, S. A.
4
+
5
+ This program is free software: you can redistribute it and/or modify
6
+ it under the terms of the GNU General Public License as published by
7
+ the Free Software Foundation, either version 3 of the License, or
8
+ (at your option) any later version.
9
+
10
+ This program is distributed in the hope that it will be useful,
11
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ GNU General Public License for more details.
14
+
15
+ You should have received a copy of the GNU General Public License
16
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+
18
+ Lesli Ruby Messages - Message utilities for the Ruby console
2
19
 
20
+ Powered by https://www.lesli.tech
21
+ Building a better future, one line of code at a time.
22
+
23
+ @contact <hello@lesli.tech>
24
+ @website <https://www.lesli.tech>
25
+ @license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
26
+ @author The Lesli Development Team
27
+
28
+ // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
29
+ // ·
30
+ =end
31
+
32
+ # frozen_string_literal: true
3
33
  source "https://rubygems.org"
4
34
 
5
35
  # Specify your gem's dependencies in l2.gemspec
6
36
  gemspec
7
37
 
8
- gem "rake", "~> 13.0"
9
-
10
38
  gem "rspec", "~> 3.0"
data/Gemfile.lock CHANGED
@@ -1,12 +1,11 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- l2 (0.1.0)
4
+ L2 (0.2.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
- colorize (0.8.1)
10
9
  diff-lcs (1.5.0)
11
10
  rake (13.0.6)
12
11
  rspec (3.11.0)
@@ -27,8 +26,7 @@ PLATFORMS
27
26
  x86_64-darwin-21
28
27
 
29
28
  DEPENDENCIES
30
- colorize
31
- l2!
29
+ L2!
32
30
  rake (~> 13.0)
33
31
  rspec (~> 3.0)
34
32
 
data/lib/l2/version.rb CHANGED
@@ -30,5 +30,5 @@ Building a better future, one line of code at a time.
30
30
  =end
31
31
 
32
32
  module L2
33
- VERSION = "0.2.0"
33
+ VERSION = "0.3.0"
34
34
  end
data/lib/l2.rb CHANGED
@@ -34,7 +34,7 @@ require_relative "l2/version"
34
34
  module L2
35
35
 
36
36
  # standard color palette for texts
37
- COLOURS = {
37
+ COLORS = {
38
38
  default: '38',
39
39
  yellow: '1;33',
40
40
  white: '1;37',
@@ -45,7 +45,7 @@ module L2
45
45
  }.freeze
46
46
 
47
47
  # standard color palette for backgrounds
48
- BG_COLOURS = {
48
+ BG_COLORS = {
49
49
  default: '0',
50
50
  yellow: '103',
51
51
  white: '107',
@@ -179,6 +179,18 @@ module L2
179
179
  end
180
180
 
181
181
 
182
+ # · Aliases
183
+
184
+
185
+ def self.warn *messages
186
+ warning(messages)
187
+ end
188
+
189
+
190
+ def self.error *messages
191
+ danger(messages)
192
+ end
193
+
182
194
  private
183
195
 
184
196
 
@@ -198,8 +210,8 @@ module L2
198
210
 
199
211
 
200
212
  def self.colorize(text, colour = :default, bg_colour = :default)
201
- colour_code = COLOURS[colour]
202
- bg_colour_code = BG_COLOURS[bg_colour]
213
+ colour_code = COLORS[colour]
214
+ bg_colour_code = BG_COLORS[bg_colour]
203
215
  return "\e[#{bg_colour_code};#{colour_code}m#{text}\e[0m".squeeze(';')
204
216
  end
205
217
 
File without changes
@@ -17,41 +17,101 @@ If bundler is not being used to manage dependencies, install the gem by executin
17
17
 
18
18
  $ gem install l2
19
19
 
20
+ Rails apps
21
+
22
+ $ gem "L2", "~> 0.2.0"
23
+
20
24
  ## Usage
21
25
 
26
+
27
+ **Simple message:**
28
+
29
+ ```ruby
22
30
  L2.m("hola")
23
31
  L2.m("hola", "hello", "hallo", 1, [2], {"a":"b"})
32
+ ```
24
33
 
34
+
35
+ **Simple message with dividing line:**
36
+
37
+ ```ruby
25
38
  L2.msg("hola")
26
39
  L2.msg("hola", "hello", "hallo", 1, [2], {"a":"b"})
40
+ ```
41
+
27
42
 
43
+ **Informative message:**
44
+
45
+ ```ruby
28
46
  L2.info("hola")
29
47
  L2.info("hola", "hello", "hallo", 1, [2], {"a":"b"})
48
+ ```
49
+
50
+
51
+ **Sucessful message:**
30
52
 
53
+ ```ruby
31
54
  L2.success("hola")
32
55
  L2.success("hola", "hello", "hallo", 1, [2], {"a":"b"})
56
+ ```
33
57
 
58
+
59
+ **Simple message:**
60
+
61
+ ```ruby
34
62
  L2.warning("hola")
35
63
  L2.warning("hola", "hello", "hallo", 1, [2], {"a":"b"})
64
+ ```
65
+
36
66
 
67
+ **Error message:**
68
+
69
+ ```ruby
37
70
  L2.danger("hola")
38
71
  L2.danger("hola", "hello", "hallo", 1, [2], {"a":"b"})
72
+ ```
73
+
74
+
75
+ **Error with flashing message:**
39
76
 
77
+ ```ruby
40
78
  L2.fatal("hola")
41
79
  L2.fatal("hola", "hello", "hallo", 1, [2], {"a":"b"})
80
+ ```
42
81
 
82
+
83
+ **Flashing message:**
84
+
85
+ ```ruby
43
86
  L2.alert("hola")
44
87
  L2.alert("hola", "hello", "hallo", 1, [2], {"a":"b"})
88
+ ```
89
+
45
90
 
91
+ **Useful to give instructions in deprecated methods or code:**
92
+
93
+ ```ruby
46
94
  L2.deprecation("hola")
95
+ ```
96
+
97
+
98
+ **Print a simple list:**
47
99
 
100
+ ```ruby
48
101
  L2.list("hola", "hello", "hallo", 1, [2], {"a":"b"})
102
+ ```
49
103
 
104
+
105
+ **Show data as table:**
106
+
107
+ ```ruby
50
108
  L2.table([
51
109
  { español: "hola", english: "hello", deutsch: "hallo" },
52
110
  { español: "hola", english: "hello", deutsch: "hallo" },
53
111
  { español: "hola", english: "hello", deutsch: "hallo" }
54
112
  ])
113
+ ```
114
+
55
115
 
56
116
  ### Development
57
117
  ------
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.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - The Lesli Development Team
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-10-19 00:00:00.000000000 Z
11
+ date: 2022-10-20 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email:
@@ -23,21 +23,20 @@ files:
23
23
  - GPLv3.txt
24
24
  - Gemfile
25
25
  - Gemfile.lock
26
- - LICENSE.txt
27
- - README.md
28
- - Rakefile
29
26
  - docs/l2-logo.svg
30
27
  - lib/l2.rb
31
28
  - lib/l2/version.rb
29
+ - license.txt
30
+ - readme.md
32
31
  - sig/l2.rbs
33
- homepage: https://www.lesli.dev
32
+ homepage: https://github.com/LesliTech/L2
34
33
  licenses:
35
34
  - GPL-3.0
36
35
  metadata:
37
- homepage_uri: https://www.lesli.dev
36
+ homepage_uri: https://github.com/LesliTech/L2
38
37
  source_code_uri: https://github.com/LesliTech/l2
39
38
  bug_tracker_uri: https://github.com/LesliTech/l2/issues
40
- changelog_uri: https://github.com/LesliTech/l2/releases/tag/v0.2.0
39
+ changelog_uri: https://github.com/LesliTech/l2/releases/tag/v0.3.0
41
40
  post_install_message:
42
41
  rdoc_options: []
43
42
  require_paths:
data/Rakefile DELETED
@@ -1,8 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "bundler/gem_tasks"
4
- require "rspec/core/rake_task"
5
-
6
- RSpec::Core::RakeTask.new(:spec)
7
-
8
- task default: :spec