Skip to content

Instantly share code, notes, and snippets.

@jacoyutorius
Created August 22, 2014 06:54
Show Gist options
  • Select an option

  • Save jacoyutorius/e3b328aae6e50ea3baed to your computer and use it in GitHub Desktop.

Select an option

Save jacoyutorius/e3b328aae6e50ea3baed to your computer and use it in GitHub Desktop.
RubyでオレオレCLIツールを作って大人しめに公開する ref: http://qiita.com/jacoyutorius/items/7df32a1653b5572adbc0
require "oreore"
require "thor"
module Oreore
class CLI < Thor
desc "hello", "say 'hello world!'."
def hello
puts "Hello World!"
end
end
end
ruby cli.rb hello
bundle gem oreore -b
tree
.
└── oreore
├── Gemfile
├── LICENSE.txt
├── README.md
├── Rakefile
├── bin
│   └── oreore
├── lib
│   ├── oreore
│   │   └── version.rb
│   └── oreore.rb
└── oreore.gemspec
4 directories, 8 files
bundle install
chmod 777 bin/oreore
bundle exec bin/oreore hello
=> Hello World!
git commit -am "initial commit"
git remote add origin [email protected]:jacoyutorius/oreore-cli-tool.git
git push -u origin master
gem install specific_install
gem specific_install -l "[email protected]:jacoyutorius/oreore-cli-tool.git"
oreore hello
=> Hello World!
#!/usr/bin/env ruby
require 'oreore'
Oreore::CLI.start
Gem::Specification.new do |spec|
spec.name = "oreore"
spec.version = Oreore::VERSION
spec.authors = ["Jacoyutorius"]
spec.email = ["[email protected]"]
spec.summary = %q{TODO: Write a short summary. Required.}
spec.description = %q{TODO: Write a longer description. Optional.}
~(省略)~
spec.add_dependency "thor"
end
require "oreore/version"
require "oreore/cli"
module Oreore
# Your code goes here...
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment