Commit a4eee38
Changed files (5)
exe/xsay
@@ -1,3 +1,5 @@
#!/usr/bin/env ruby
require "xsay"
+
+Xsay::CLI.start(ARGV)
lib/xsay.rb
@@ -1,5 +1,27 @@
require "xsay/version"
+require "thor"
module Xsay
- # Your code goes here...
+ class CLI < Thor
+ desc "cat <message>", "xsay cat meow"
+ def cat(message)
+ line_break = "-" * message.length
+ say <<-MESSAGE
+ #{line_break}
+< #{message} >
+ #{line_break}
+ \\ \\
+ ("`-''-/").___..--''"`-._
+ `6_ 6 ) `-. ( ).`-.__.`)
+ (_Y_.)' ._ ) `._ `. ``-..-'
+ _..`--'_..-_/ /--'_.' ,'
+ (il),-'' (li),' ((!.-'
+ MESSAGE
+ end
+
+ private
+
+ def render(message, template)
+ end
+ end
end
spec/xsay_spec.rb
@@ -2,8 +2,4 @@ RSpec.describe Xsay do
it "has a version number" do
expect(Xsay::VERSION).not_to be nil
end
-
- it "does something useful" do
- expect(false).to eq(true)
- end
end
.gitignore
@@ -6,6 +6,7 @@
/pkg/
/spec/reports/
/tmp/
+Gemfile.lock
# rspec failure tracking
.rspec_status
xsay.gemspec
@@ -9,20 +9,11 @@ Gem::Specification.new do |spec|
spec.authors = ["mokha"]
spec.email = ["mokha@cisco.com"]
- spec.summary = %q{TODO: Write a short summary, because RubyGems requires one.}
- spec.description = %q{TODO: Write a longer description or delete this line.}
- spec.homepage = "TODO: Put your gem's website or public repo URL here."
+ spec.summary = %q{xsay, like cowsay but much more fun..}
+ spec.description = %q{xsay, like cowsay but much more fun..}
+ spec.homepage = "http://www.mokhan.ca/"
spec.license = "MIT"
- # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
- # to allow pushing to a single host or delete this section to allow pushing to any host.
- if spec.respond_to?(:metadata)
- spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'"
- else
- raise "RubyGems 2.0 or newer is required to protect against " \
- "public gem pushes."
- end
-
spec.files = `git ls-files -z`.split("\x0").reject do |f|
f.match(%r{^(test|spec|features)/})
end
@@ -30,6 +21,7 @@ Gem::Specification.new do |spec|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
spec.require_paths = ["lib"]
+ spec.add_dependency "thor", "~> 0.20"
spec.add_development_dependency "bundler", "~> 1.16"
spec.add_development_dependency "rake", "~> 10.0"
spec.add_development_dependency "rspec", "~> 3.0"