first_gem_hello_world 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/first_gem_hello_world +34 -12
- data/lib/first_gem_hello_world.rb +1 -1
- data/lib/hello.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 26583164004b8bd3c112b5596d0be31c7c4d617f
|
4
|
+
data.tar.gz: 8811def0bf2aa0ce6da4074b79a807faac50c0ee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 13d910ec37d9f6d26390ad66f6e8b904151ae08646d19b97c32f5586b182b1aa54a268a66bf81bfd13d977bc90924fad89ff777fb55c1f8b38e66c739aad4efa
|
7
|
+
data.tar.gz: 8c55602787e5b1ceca2b90151f15c3427169295ecd379b23183569682a16f210e3d3d3c664c26cfb626557acee1f51878a1616c932389b3c469640560dbdd46b
|
data/bin/first_gem_hello_world
CHANGED
@@ -1,18 +1,40 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
$LOAD_PATH << './lib'
|
3
|
+
|
2
4
|
require 'optparse'
|
3
5
|
|
4
|
-
require '
|
6
|
+
require 'first_gem_hello_world'
|
7
|
+
require 'hello'
|
8
|
+
|
9
|
+
options = {}
|
10
|
+
OptionParser.new do |opt|
|
11
|
+
opt.banner = "Usage:\n first_gem_hello_world WORD [OPTIONS]"
|
12
|
+
opt.separator ''
|
13
|
+
opt.separator 'Options'
|
14
|
+
|
15
|
+
opt.on('--world', 'Print "Hello world!!!"') do
|
16
|
+
options[:world] = true
|
17
|
+
end
|
18
|
+
|
19
|
+
opt.on('-w', '--word', String, 'Word after "Hello"') do |word|
|
20
|
+
options[:word] = word
|
21
|
+
end
|
5
22
|
|
6
|
-
|
7
|
-
|
8
|
-
|
23
|
+
opt.on_tail('-v', '--version', 'Show Version') do
|
24
|
+
puts FirstGemHelloWorld::VERSION
|
25
|
+
exit
|
26
|
+
end
|
9
27
|
|
10
|
-
|
11
|
-
|
28
|
+
opt.on_tail('-h', '--help', 'Show this.') { puts opt; exit }
|
29
|
+
|
30
|
+
if ARGV.empty? && options.empty?
|
31
|
+
opt.on { puts opt; exit }
|
32
|
+
end
|
33
|
+
end.parse!
|
12
34
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
end
|
35
|
+
if options[:world]
|
36
|
+
puts Hello.world
|
37
|
+
else
|
38
|
+
word = options[:word] || ARGV[0]
|
39
|
+
puts Hello.world(word)
|
40
|
+
end
|
data/lib/hello.rb
CHANGED