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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fc6fe2c149c2c67e100d65de2183b397be68894a74aba88249d41d269d003ee9
4
- data.tar.gz: 8832190f3f38f76d50e336bf258a763ae6d0047df0e9c29f5cb80582d0e9b1e6
3
+ metadata.gz: d44ba9994cd4ecf369c78076589571a847a39f1ce30ea1c1c513beca3772d518
4
+ data.tar.gz: 661f144c3c950673420be799577979bddf13d30c34ea54a36fe5a876b5de143a
5
5
  SHA512:
6
- metadata.gz: 3708fe53e877d9e1ae8495e91fbe1ecd0ea4d83b6b6a261e2c3a55cea0612b59f8d4ed8da8c09a31c50d577907d44ff603345b4392b81fe9138df5ad342b6bdd
7
- data.tar.gz: 792bbdbcd2dd2e09df905b0610473faecf9d600e542ab2bd1ec64d8a57e23bf669b3d030fc63ce393a17831ad74f07d69afd3132b442de780d4cb20f8fb6a6e0
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
 
@@ -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.
@@ -1,9 +1,9 @@
1
1
 
2
2
  module Params
3
3
  NAME = 'rubyzen'
4
- VERSION = '0.0.5'
4
+ VERSION = '0.0.6'
5
5
  GEMNAME = 'ruby-zen'
6
- LANGS = [ :es ]
6
+ LANGS = [ :es, :en ]
7
7
  ZEN_FILENAME = 'zenfile.yaml'
8
8
  HOMEPAGE = 'https://github.com/dvarrui/tools/tree/main/ruby.zen.d'
9
9
  end
@@ -7,10 +7,13 @@ class Rules
7
7
  @app = application
8
8
  end
9
9
 
10
- def show(options = { 'more' => false, 'step' => true })
11
- if options['more']
12
- step = options['step']
13
- show_more(step: step)
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 show_more(step:)
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
@@ -15,7 +15,8 @@ class RubyZen
15
15
  end
16
16
 
17
17
  def self.show(options)
18
- app = Application.new
18
+ lang = options['lang']&.to_sym || :en
19
+ app = Application.new(lang)
19
20
  Rules.new(app).show(options)
20
21
  end
21
22
  end
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.5
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-02-23 00:00:00.000000000 Z
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.2.32
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: []