2016-06-13 1 views

답변

1

, 일반적인 방법은 다음과 같습니다

#!/usr/bin/env ruby 

# content of the library 
... 

if $0 == __FILE__ 
    # command to be executed only when the file is called by a command 
end 

당신이 그것에게 보석을 만들고 싶어 경우, 표준 방법은 파일의 실행 루비 스크립트를 작성하는 것입니다 (하자 보석 디렉토리 내에서 /bin 디렉토리 아래 foo를) 말과하여 *.gemspec 파일에 다음을 추가,

Gem::Specification.new do |s| 
    ... 
    s.executables << "foo" 
    ... 
end 
+0

들으 아직 보석 만지작 없음. – Konstantin

관련 문제