Created
August 22, 2014 06:54
-
-
Save jacoyutorius/e3b328aae6e50ea3baed to your computer and use it in GitHub Desktop.
RubyでオレオレCLIツールを作って大人しめに公開する ref: http://qiita.com/jacoyutorius/items/7df32a1653b5572adbc0
This file contains hidden or 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
| require "oreore" | |
| require "thor" | |
| module Oreore | |
| class CLI < Thor | |
| desc "hello", "say 'hello world!'." | |
| def hello | |
| puts "Hello World!" | |
| end | |
| end | |
| end |
This file contains hidden or 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
| ruby cli.rb hello |
This file contains hidden or 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
| 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 |
This file contains hidden or 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
| bundle install | |
| chmod 777 bin/oreore | |
| bundle exec bin/oreore hello | |
| => Hello World! |
This file contains hidden or 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
| git commit -am "initial commit" | |
| git remote add origin [email protected]:jacoyutorius/oreore-cli-tool.git | |
| git push -u origin master |
This file contains hidden or 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
| gem install specific_install | |
| gem specific_install -l "[email protected]:jacoyutorius/oreore-cli-tool.git" | |
| oreore hello | |
| => Hello World! |
This file contains hidden or 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
| #!/usr/bin/env ruby | |
| require 'oreore' | |
| Oreore::CLI.start |
This file contains hidden or 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
| 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 |
This file contains hidden or 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
| 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