-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test not working :(.
- Loading branch information
Showing
9 changed files
with
53 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,26 @@ | ||
#!/usr/bin/env ruby | ||
|
||
require 'optparse' | ||
require 'hola_albertogg' | ||
|
||
puts Hola::Say.hi | ||
options = { | ||
:Translation => 'english' | ||
} | ||
|
||
option_parser = OptionParser.new("", 24, ' ') do |opts| | ||
opts.on('-t', '--translate [TRANSLATION]', 'Write down the language') do |translations| | ||
options[:Translation] = translations | ||
end | ||
opts.on('-v', '--version', 'show version') do | ||
puts "hola_albertogg version #{Hola::VERSION}" | ||
exit | ||
end | ||
opts.on('-h', '--help', 'display help') do | ||
puts opts | ||
exit | ||
end | ||
|
||
opts.parse! ARGV | ||
end | ||
|
||
Hola::Translator.new("#{options[:Translation]}").hi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,7 @@ | ||
require 'hola_albertogg/translator' | ||
require 'hola_albertogg/command_line' | ||
|
||
module Hola | ||
|
||
VERSION = "0.1.0" # keep it in sync with gemspec. | ||
|
||
class Say | ||
def self.hi | ||
cli = CommandLine.new | ||
cli.parse_options | ||
end | ||
end | ||
end | ||
|
||
require 'hola_albertogg/translator' | ||
require 'hola_albertogg/const' |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module Hola | ||
|
||
VERSION = "0.1.0" unless defined?(Hola::VERSION)# keep it in sync with gemspec. | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
require 'minitest/autorun' | ||
require 'hola_albertogg' | ||
|
||
class CommandLineTest < MiniTest::Unit::TestCase | ||
def test_help_menu | ||
assert system('bin/hola_albertogg -h') | ||
end | ||
|
||
def test_version | ||
assert system('bin/hola_albertogg --version') | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters