Skip to content

Instantly share code, notes, and snippets.

@ryuta-ito
Last active July 17, 2016 07:36
Show Gist options
  • Save ryuta-ito/6354ed266e83315f71173f702ee7620a to your computer and use it in GitHub Desktop.
Save ryuta-ito/6354ed266e83315f71173f702ee7620a to your computer and use it in GitHub Desktop.
# % tree
# .
# ├── Thorfile
# ├── json
# └── template
# └── hello.json.tt
# $ thor hello:hello
# hello
# create node/hello.json
class Hello < Thor
include Thor::Actions
desc :hello, 'hello'
def hello
puts 'hello'
@hello = 'hello'
template 'template/hello.json.tt', 'json/hello.json'
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment