Thorã¯ã¾ã£ã¦ãã¾ããããããããæã«ãªããã¨ãããããã åºæ¬ã¯Ruby 1.9.1 + Thor 0.13.4ã§ãªãã§ãã§ãã¡ãããããªé¯è¦ããã ã¾ãã¯ãthorã³ãã³ãããã Thor::Runner.startãå¼ãã§ãã ãã§ãã #!/usr/bin/env ruby # -*- mode: ruby -*- require 'thor/runner' $thor_runner = true Thor::Runner.start Thor::Runnerã¯Thorãç¶æ¿ãã¦ããã®ã§å¼ã°ãã¦ããã®ã¯Thor.startã§ããã ã¡ãªã¿ã«Thot::Runnerã«ã¯ããã©ã«ãã®ã¡ã½ãããç¨æããã¦ãã¾ãã help install version uninstall update installed list Thor.startã¯ä»¥ä¸ã®ã³ã¼ãã def start(origin
@jondot | CTO at Como. Hacker. Fullstacker. Big data. Open sourcer. Thor is not new; first built as a rake and sake replacement, first commit is well over 4 years ago. Jump ahead several years and Thor is part of the foundation of the new-generation rails generator, and very popular tools such as Bundler and Foreman. Recently, @wykatz emerged a fantastic looking (and much deserved) Thor website, a
åé¡ ãµãã³ãã³ãã®ãã«ããè¦ãã«ã¯demo help subcommandã¨å ¥åããå¿ è¦ãããã¾ãã åºæ¥ãã° demo subcommand -hã¨æã¡ããæã§ãã # ok $ demo help abc print 'abc' # error $ demo abc -h demo abc requires at least 0 argument: #! /usr/bin/env ruby # -*- coding: utf-8 -*- require 'rubygems' require 'thor' class Demo < Thor class_option :help, :type => :boolean, :aliases => '-h', :desc => 'Help message.' desc "abc", "print 'abc'" def abc puts 'ab
I'm looking for a way to create a command-line thor app that will run a default method without any arguments. I fiddled with Thor's default_method option, but still requires that I pass in an argument. I found a similar case where someone wanted to run a CLI Thor task with arguments but without a task name. I'd like to run a task with no task name and no arguments. Is such a thing possible?
ã¡ãã£ã¨Jenkinsã®ãã¨ã¯ç½®ãã¦ããã¦ãrubyã§ããããæ¸ããã¨ã«ãªã£ãã æ©ãã§ããããã試ãã¦ã¿ãã ã¾ãã¯ãThorã Railsã«ããã©ã«ãã§å ¥ã£ã¦ããã®ã ãã©ãThorã ãã§å©ç¨ãã¦ã¿ãã å®è¡çµæ ãã«ãï¼ # ruby thor_test.rb help Commands: thor_test.rb execute [OPTION] # Test execute thor_test.rb help [COMMAND] # Describe available commands or one specific command Options: -h, [--help] # Thor test ãã«ãï¼ # ruby thor_test.rb help execute Usage: thor_test.rb execute [OPTION] Options: -p, [--
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}