mysh 0.2.4 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mysh/internal/format/array.rb +12 -3
- data/lib/mysh/internal/format/object.rb +5 -0
- data/lib/mysh/version.rb +1 -1
- data/tests/my_shell_tests.rb +4 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9696599d94ed469efdc12d988e1fca5e033f5126
|
4
|
+
data.tar.gz: bd16dac7ecb6b576fc009334f0f326c97eb7be8c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6b5dd1d00c374dfdb3b482a518d8f3bdb8a7b3754e6b31efc05e02e178cef3db0d2eb1dd62da90098a3fef819a98c17f56e025a65d4cfac346aeab330f098d5e
|
7
|
+
data.tar.gz: 717a6190bff1dd180906d447d440efeee689fbd425fde050a2bc556036a7644f71a977d0308b29337ebeb31dbe1a1b917a06664d68aad217b714a08dd0375626
|
@@ -45,8 +45,8 @@ class Array
|
|
45
45
|
# Bullets ========================================================
|
46
46
|
|
47
47
|
#Print out the array as bullet points.
|
48
|
-
def puts_mysh_bullets
|
49
|
-
puts mysh_bulletize
|
48
|
+
def puts_mysh_bullets(page_width = Mysh::PAGE_WIDTH)
|
49
|
+
puts mysh_bulletize(page_width)
|
50
50
|
end
|
51
51
|
|
52
52
|
#Convert the array to strings with bullet points.
|
@@ -59,10 +59,19 @@ class Array
|
|
59
59
|
|
60
60
|
builder = Mysh::BulletPoints.new(page_width)
|
61
61
|
|
62
|
-
each {|pair| builder.add(*pair)}
|
62
|
+
each {|pair| builder.add(*pair.prepare_bullet_data)}
|
63
63
|
|
64
64
|
builder.render.join("\n")
|
65
65
|
end
|
66
66
|
|
67
|
+
#Get data ready for being in a bullet point.
|
68
|
+
def prepare_bullet_data
|
69
|
+
if length < 2
|
70
|
+
["*", self[0]]
|
71
|
+
else
|
72
|
+
self
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
67
76
|
end
|
68
77
|
|
data/lib/mysh/version.rb
CHANGED
data/tests/my_shell_tests.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mysh
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Camilleri
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-11-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|