storazzo 0.0.1 → 0.0.5

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: a433e4e528abbf38896947399fedcd9c1076a4eeb8d7acd1a7d327fc5dbd8ab3
4
- data.tar.gz: 3030b75d7ea029c88c9bf238a94c71fdcd839ef1ba1dc710cd9e99e0554a4429
3
+ metadata.gz: 3b6f11122ebdc242a695b25dee97fc6d09d2059df95f7318b42679a66ccfd9c3
4
+ data.tar.gz: '045047399e27b7b9bf55ae5230babb9443dd5903adbabcdf562f16eec1e1b258'
5
5
  SHA512:
6
- metadata.gz: f84d349840017c769c637526d043f92f20a8b634623fb779dca711cb662ffe53a28f4f18379374a473c23598df6958dcb7a98c007f5c57e282edbc6e9d8c87f3
7
- data.tar.gz: f903a4c7bdc2706b6b108554df21f91dbc617b1fa9c04815e917d52b27ea61daede61a194ba0642ef9e01938e814180471b25104a8673b3a3002ccce45870aba
6
+ metadata.gz: 618bfb7e3664ae8fe0f8429e1c8527aec76bdfd5c37f4cc1693ebfbc41ba94bd0235c13738479f3f2ea31da593d1483ca2c25881edd3be1a8757f2cf3b892fbf
7
+ data.tar.gz: 37e515b93523cc8b0b31791152edff586d3a8dfd5490b7b889b0595dbea31ac2a69a2b4b7cdd2c37187fbe545b133921333185ea1a1e48136aead9fc073df49a
@@ -0,0 +1,42 @@
1
+ # Use EXTEND vs INCLUDE and magically the Class will inherit instead of instance. Magical! :)
2
+ # http://www.railstips.org/blog/archives/2009/05/15/include-vs-extend-in-ruby/
3
+
4
+ module Storazzo::Colors
5
+ # class Storazzo::Colors
6
+ PREPEND_ME = "[Storazzo::Colors] "
7
+
8
+ def deb(s); puts "#DEB #{gray(s)}" if $DEBUG; end
9
+
10
+ # colors 16
11
+ def yellow(s) "\033[1;33m#{s}\033[0m" ; end
12
+ def gray(s) "\033[1;30m#{s}\033[0m" ; end
13
+ def green(s) "\033[1;32m#{s}\033[0m" ; end
14
+ def red(s) "\033[1;31m#{s}\033[0m" ; end
15
+ def blue(s) "\033[1;34m#{s}\033[0m" ; end
16
+ def purple(s) "\033[1;35m#{s}\033[0m" ; end
17
+ def azure(s) "\033[1;36m#{s}\033[0m" ; end
18
+ def white(s) "\033[1;37m#{s}\033[0m" ; end
19
+
20
+ # colors 64k
21
+ def orange(s) "\033[38;5;208m#{s}\033[0m" ; end
22
+
23
+ # i dont undertstand why i need self :/
24
+ # SELF version because I'm just stupid or lazy or both.
25
+ # def self.yellow(s) "#{PREPEND_ME}\033[1;33m#{s}\033[0m" ; end
26
+ # def self.green(s) "#{PREPEND_ME}\033[1;32m#{s}\033[0m" ; end
27
+ # def self.gray(s) "#{PREPEND_ME}\033[1;30m#{s}\033[0m" ; end
28
+ # def self.green(s) "#{PREPEND_ME}\033[1;32m#{s}\033[0m" ; end
29
+ # def self.red(s) "#{PREPEND_ME}\033[1;31m#{s}\033[0m" ; end
30
+ # def self.blue(s) "#{PREPEND_ME}\033[1;34m#{s}\033[0m" ; end
31
+ # def self.purple(s) "#{PREPEND_ME}\033[1;35m#{s}\033[0m" ; end
32
+ # def self.azure(s) "#{PREPEND_ME}\033[1;36m#{s}\033[0m" ; end
33
+ # def self.white(s) "#{PREPEND_ME}\033[1;37m#{s}\033[0m" ; end
34
+
35
+ # p<COLOR> Carlessian functions..
36
+ def pwhite(s) puts(white(s)); end
37
+ def pgreen(s) puts(green(s)); end
38
+ def pred(s) puts(red(s)); end
39
+ def pyellow(s) puts(yellow(s)); end
40
+
41
+
42
+ end
@@ -0,0 +1,17 @@
1
+ # todo remove
2
+ class Storazzo::Translator
3
+
4
+ def initialize(language)
5
+ @language = language
6
+ end
7
+
8
+ def hi
9
+ case @language
10
+ when "spanish"
11
+ "hola mundo"
12
+ else
13
+ "hello world"
14
+ end
15
+ end
16
+
17
+ end
data/lib/storazzo.rb CHANGED
@@ -1,8 +1,43 @@
1
1
  # copied from https://guides.rubygems.org/make-your-own-gem/#introduction
2
2
 
3
+ #require 'storazzo/colors'
4
+
5
+ module StorazzoMod
6
+ VERSION = File.read('./VERSION').chomp # "10.0.0"
7
+ #require 'storazzo/translator'
8
+
9
+ def latest_version
10
+ "1.2"
11
+ end
12
+ end
13
+
3
14
  class Storazzo
15
+ require 'storazzo/colors'
16
+
4
17
  # version 1.2
5
18
  def self.hi
6
- puts "Hello storazzo!"
19
+ puts "Hello from Storazzo v#{StorazzoMod::VERSION rescue :ERROR}!"
7
20
  end
8
- end
21
+
22
+ def self.all_tests
23
+ # include vs extend: https://stackoverflow.com/questions/15097929/ruby-module-require-and-include
24
+ # => http://www.railstips.org/blog/archives/2009/05/15/include-vs-extend-in-ruby/
25
+ #include Storazzo::Colors
26
+ extend Storazzo::Colors
27
+
28
+ pwhite "All tests BEGIN"
29
+ deb "Maybe debug is enabled?"
30
+ #puts "This is Storazzo v#{StorazzoMod::VERSION}"
31
+ hi
32
+ # This works with EXTEND..
33
+ puts(yellow "Just YELLOW 0")
34
+ # This reqwuires a INCLUDE.
35
+ #puts(Storazzo::Colors.yellow "Test YELLOW 1 self")
36
+ #puts(Colors.yellow "Test YELLOW 1 self")
37
+ #puts(Colors.green "Test YELLOW 2 ohne self")
38
+ pwhite "All tests END"
39
+ #puts "All tests END"
40
+ end
41
+ end
42
+
43
+ require 'storazzo/translator'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: storazzo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Riccardo Carlesso
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-07-10 00:00:00.000000000 Z
11
+ date: 2022-07-11 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A simple hello world gem.. for now. Then... more!
14
14
  email: name dot surname at popular Google-owned Mail
@@ -17,11 +17,13 @@ extensions: []
17
17
  extra_rdoc_files: []
18
18
  files:
19
19
  - lib/storazzo.rb
20
+ - lib/storazzo/colors.rb
21
+ - lib/storazzo/translator.rb
20
22
  homepage: https://rubygems.org/gems/storazzo
21
23
  licenses:
22
24
  - MIT
23
25
  metadata: {}
24
- post_install_message:
26
+ post_install_message:
25
27
  rdoc_options: []
26
28
  require_paths:
27
29
  - lib
@@ -37,7 +39,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
37
39
  version: '0'
38
40
  requirements: []
39
41
  rubygems_version: 3.1.4
40
- signing_key:
42
+ signing_key:
41
43
  specification_version: 4
42
44
  summary: storazzo is an amazing gem. Code is in https://github.com/palladius/storazzo
43
45
  test_files: []