ruby-zen 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -3
- data/lib/ruby-zen/cli.rb +1 -0
- data/lib/ruby-zen/files/title.txt +6 -0
- data/lib/ruby-zen/params.rb +1 -1
- data/lib/ruby-zen/rules.rb +33 -11
- data/lib/ruby-zen.rb +2 -2
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 94b6c9e0213a4afbb888a4b4b937d8d1c1c3f7ede4719ce582a362762754e4f5
|
4
|
+
data.tar.gz: 04b4529731f7efc69027b1f71ee1f6e05e1684e9a0cf31ba1551c0ec6cd537ae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cd713a5cdb69fca117a7fa2011fc5e3f1d1be8ee6cd97e02b73f0213bf98ff93c65fac26eb7f81f6203be890463dd98c67daf87661b9872113e88b4189a0b697
|
7
|
+
data.tar.gz: e7a1006e8a688067e5c2d113e32bf3ebc63c35555319da1c64a3e479bf87dddead4a99fff0918da63e1d7ec009bac9ec3e302e22021392874c60b5f1300c86c3
|
data/README.md
CHANGED
@@ -2,7 +2,8 @@
|
|
2
2
|
# RubyZen
|
3
3
|
|
4
4
|
Display Ruby ZEN rules.
|
5
|
-
|
5
|
+
|
6
|
+
![logo](./docs/images/logo.png)
|
6
7
|
|
7
8
|
# Documentation
|
8
9
|
|
@@ -12,8 +13,7 @@ Display Ruby ZEN rules.
|
|
12
13
|
|
13
14
|
# Use
|
14
15
|
|
15
|
-
|
16
|
-
|
16
|
+
Run `rubyzen` command.
|
17
17
|
|
18
18
|
| Function | Description |
|
19
19
|
| -------- | ------------------------- |
|
@@ -24,3 +24,4 @@ Try with `rubyzen` command to see all functions.
|
|
24
24
|
# Contact
|
25
25
|
|
26
26
|
* **Email**: `dvarrui@protonmail.com`
|
27
|
+
* [IloveRuby - dvarrui](https://github.com/dvarrui/iloveruby)
|
data/lib/ruby-zen/cli.rb
CHANGED
@@ -0,0 +1,6 @@
|
|
1
|
+
____ _ __________ _ _ _
|
2
|
+
| _ \ _ _| |__ _ _ |__ / ____| \ | | _ __ _ _| | ___ ___
|
3
|
+
| |_) | | | | '_ \| | | | / /| _| | \| | | '__| | | | |/ _ \/ __|
|
4
|
+
| _ <| |_| | |_) | |_| | / /_| |___| |\ | | | | |_| | | __/\__ \
|
5
|
+
|_| \_\\__,_|_.__/ \__, | /____|_____|_| \_| |_| \__,_|_|\___||___/
|
6
|
+
|___/
|
data/lib/ruby-zen/params.rb
CHANGED
data/lib/ruby-zen/rules.rb
CHANGED
@@ -7,25 +7,31 @@ class Rules
|
|
7
7
|
@app = application
|
8
8
|
end
|
9
9
|
|
10
|
-
def show(options =
|
11
|
-
if options
|
12
|
-
|
10
|
+
def show(options = { 'more' => false, 'step' => true })
|
11
|
+
if options['more']
|
12
|
+
step = options['step']
|
13
|
+
show_more(step: step)
|
13
14
|
else
|
14
|
-
|
15
|
+
show_only_names
|
15
16
|
end
|
16
17
|
end
|
17
18
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
19
|
+
private
|
20
|
+
|
21
|
+
def show_title
|
22
|
+
dirbase = File.dirname(__FILE__)
|
23
|
+
filepath = File.join(dirbase, 'files', 'title.txt')
|
24
|
+
content = File.read(filepath)
|
25
|
+
puts content
|
26
|
+
puts
|
23
27
|
end
|
24
28
|
|
25
|
-
def
|
29
|
+
def show_more(step:)
|
30
|
+
show_title
|
31
|
+
|
26
32
|
@app.rules.each_with_index do |rule, index|
|
27
33
|
principle = rule[:rule]
|
28
|
-
puts "
|
34
|
+
puts "[#{(index + 1)}] #{principle}"
|
29
35
|
desc = rule[:desc]
|
30
36
|
if desc.is_a? String
|
31
37
|
puts "#{desc}\n".white
|
@@ -36,6 +42,22 @@ class Rules
|
|
36
42
|
puts text
|
37
43
|
end
|
38
44
|
end
|
45
|
+
puts
|
46
|
+
if step
|
47
|
+
print '[Press ENTER to continue]'
|
48
|
+
STDIN.gets
|
49
|
+
puts
|
50
|
+
end
|
39
51
|
end
|
40
52
|
end
|
53
|
+
|
54
|
+
def show_only_names
|
55
|
+
show_title
|
56
|
+
|
57
|
+
@app.rules.each_with_index do |rule, index|
|
58
|
+
principle = rule[:rule]
|
59
|
+
puts "[#{(index + 1)}] #{principle}"
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
41
63
|
end
|
data/lib/ruby-zen.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
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.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Vargas Ruiz
|
@@ -67,6 +67,7 @@ files:
|
|
67
67
|
- lib/ruby-zen.rb
|
68
68
|
- lib/ruby-zen/application.rb
|
69
69
|
- lib/ruby-zen/cli.rb
|
70
|
+
- lib/ruby-zen/files/title.txt
|
70
71
|
- lib/ruby-zen/files/zenfile.yaml
|
71
72
|
- lib/ruby-zen/params.rb
|
72
73
|
- lib/ruby-zen/rules.rb
|