ruby-zen 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -0
- data/lib/ruby-zen/application.rb +0 -2
- data/lib/ruby-zen/cli.rb +2 -3
- data/lib/ruby-zen/files/zenfile.yaml +24 -7
- data/lib/ruby-zen/params.rb +2 -2
- data/lib/ruby-zen/rules.rb +8 -5
- data/lib/ruby-zen.rb +2 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d44ba9994cd4ecf369c78076589571a847a39f1ce30ea1c1c513beca3772d518
|
4
|
+
data.tar.gz: 661f144c3c950673420be799577979bddf13d30c34ea54a36fe5a876b5de143a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eda1558e53bf8228bfecc56b93eb54b1e7064f73af5f9eb34f66ca132e7939f7f9f72dfd8b0389634a1d4cfa910ef94f4b64c04fdad2730ff97519c162ca7541
|
7
|
+
data.tar.gz: dcc8fa003ee57d47e32bd278815250e70655abe9cdbed61a9dcb37b8530fc5304dd39d3b189b935dcd0af6e2f40d965f59aa653c7c186e2181e65e8de18a1d2f
|
data/README.md
CHANGED
@@ -20,6 +20,8 @@ Run `rubyzen` command on your terminal
|
|
20
20
|
| version | Show currente version |
|
21
21
|
| langs | Show available languages |
|
22
22
|
| show | Show Ruby ZEN rules |
|
23
|
+
| show --more | Show every rule with detailed explanation |
|
24
|
+
| show --more --step | Show every rule with detailed explanation, step by step |
|
23
25
|
|
24
26
|
## Contact
|
25
27
|
|
data/lib/ruby-zen/application.rb
CHANGED
@@ -6,7 +6,6 @@ class Application
|
|
6
6
|
include Params
|
7
7
|
|
8
8
|
attr_reader :lang
|
9
|
-
attr_reader :config_filepath
|
10
9
|
attr_reader :data
|
11
10
|
|
12
11
|
def initialize(language = :es)
|
@@ -23,7 +22,6 @@ class Application
|
|
23
22
|
def load_data
|
24
23
|
basedir = File.dirname(__FILE__)
|
25
24
|
filepath = File.join(basedir, 'files', ZEN_FILENAME)
|
26
|
-
@config_filepath = filepath
|
27
25
|
YAML.load(File.read(filepath))
|
28
26
|
end
|
29
27
|
end
|
data/lib/ruby-zen/cli.rb
CHANGED
@@ -24,15 +24,14 @@ class CLI < Thor
|
|
24
24
|
end
|
25
25
|
|
26
26
|
map ['-s', '--show'] => 'show'
|
27
|
-
option :more, type: :boolean
|
28
27
|
option :step, type: :boolean
|
28
|
+
option :full, type: :boolean
|
29
29
|
option :lang, type: :string
|
30
|
-
desc 'show [LANG]', 'Display ZEN rules in the chosen language'
|
30
|
+
desc 'show [--step, --full, --lang=[LANG]]', 'Display ZEN rules in the chosen language'
|
31
31
|
long_desc <<-LONGDESC
|
32
32
|
Display the rules in the chosen language
|
33
33
|
LONGDESC
|
34
34
|
def show
|
35
|
-
# Typical error... write show(options) instead of show! jajaja
|
36
35
|
RubyZen.show(options)
|
37
36
|
end
|
38
37
|
|
@@ -1,4 +1,28 @@
|
|
1
1
|
# encoding: UTF-8
|
2
|
+
:en:
|
3
|
+
- :rule: Emphasize human needs more than those of the machine.
|
4
|
+
:desc:
|
5
|
+
- Put the focus more on the programmer and less on the machine.
|
6
|
+
- Often people, especially computer engineers, focus on machines.
|
7
|
+
- They think, "By doing this, the machine will run faster. By doing this, the machine will run more efficiently. "Doing this..." They are machine-centric.
|
8
|
+
- We really need to focus on people, how they make programs or how they handle applications.
|
9
|
+
- We are the bosses. They are the slaves.
|
10
|
+
- :rule: El principio de la menor sorpresa.
|
11
|
+
:desc:
|
12
|
+
- Language should behave in such a way as to minimize confusion among experienced users.
|
13
|
+
- Matz defined it this way in an interview. Everyone has a personal past.
|
14
|
+
- Someone may come from another language and may be surprised by different aspects of the language.
|
15
|
+
- Then they might say, 'I'm surprised by this feature of language, so Ruby violates the principle of least surprise.
|
16
|
+
- Wait, wait. The principle of least surprise is NOT just for you.
|
17
|
+
- The principle of least surprise means that Ruby's rules don't change. There are no exceptions.
|
18
|
+
- Once you know the rules. There are no surprises.
|
19
|
+
- :rule: Matz ha dicho que su principal objetivo era hacer un lenguaje que le divirtiera
|
20
|
+
:desc:
|
21
|
+
- For fun we will minimize programming work and possible confusion.
|
22
|
+
- That is, rule 1 and rule 2 lead to fun.
|
23
|
+
- Fun brings joy.
|
24
|
+
- Joy gives happiness.
|
25
|
+
- The Ruby path leads us to happiness!
|
2
26
|
:es:
|
3
27
|
- :rule: Enfatizar las necesidades humanas más que de las de la máquina.
|
4
28
|
:desc:
|
@@ -23,10 +47,3 @@
|
|
23
47
|
- La diversión da alegría.
|
24
48
|
- La alegría da felicidad.
|
25
49
|
- El camino Ruby nos lleva a la felicidad!
|
26
|
-
:en:
|
27
|
-
- :rule: Enfatizar las necesidades humanas más que las de la máquina.
|
28
|
-
:desc: A menudo la gente, especialmente los ingenieros en computación, se centran en las máquinas. Ellos piensan, "Haciendo esto, la máquina funcionará más rápido. Haciendo esto, la máquina funcionará de manera más eficiente. Haciendo esto..." Están centrados en las máquinas, pero en realidad necesitamos centrarnos en las personas, en cómo hacen programas o cómo manejan las aplicaciones en los ordenadores. Nosotros somos los jefes. Ellos son los esclavos.
|
29
|
-
- :rule: El principio de la menor sorpresa.
|
30
|
-
:desc: El lenguaje debe comportarse de tal manera que minimice la confusión de los usuarios experimentados.
|
31
|
-
- :rule: Matz ha dicho que su principal objetivo era hacer un lenguaje que le divirtiera
|
32
|
-
:desc: Para divertirse vamos a minimizar el trabajo de programación y la posible confusión.
|
data/lib/ruby-zen/params.rb
CHANGED
data/lib/ruby-zen/rules.rb
CHANGED
@@ -7,10 +7,13 @@ class Rules
|
|
7
7
|
@app = application
|
8
8
|
end
|
9
9
|
|
10
|
-
def show(options = { '
|
11
|
-
|
12
|
-
|
13
|
-
|
10
|
+
def show(options = { 'full' => false, 'step' => true })
|
11
|
+
full = options['full']
|
12
|
+
step = options['step']
|
13
|
+
|
14
|
+
full = true if step
|
15
|
+
if full
|
16
|
+
show_full(step: step)
|
14
17
|
else
|
15
18
|
show_only_names
|
16
19
|
end
|
@@ -26,7 +29,7 @@ class Rules
|
|
26
29
|
puts
|
27
30
|
end
|
28
31
|
|
29
|
-
def
|
32
|
+
def show_full(step:)
|
30
33
|
show_title
|
31
34
|
|
32
35
|
@app.rules.each_with_index do |rule, index|
|
data/lib/ruby-zen.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-zen
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Vargas Ruiz
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-05-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colorize
|
@@ -76,7 +76,7 @@ homepage: https://github.com/dvarrui/tools/tree/main/ruby.zen.d
|
|
76
76
|
licenses:
|
77
77
|
- GPL-3.0
|
78
78
|
metadata: {}
|
79
|
-
post_install_message:
|
79
|
+
post_install_message:
|
80
80
|
rdoc_options: []
|
81
81
|
require_paths:
|
82
82
|
- lib
|
@@ -91,8 +91,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
91
91
|
- !ruby/object:Gem::Version
|
92
92
|
version: '0'
|
93
93
|
requirements: []
|
94
|
-
rubygems_version: 3.
|
95
|
-
signing_key:
|
94
|
+
rubygems_version: 3.3.3
|
95
|
+
signing_key:
|
96
96
|
specification_version: 4
|
97
97
|
summary: Display Ruby ZEN rules
|
98
98
|
test_files: []
|