1
간단한 질문;외부 정적 클래스에서 Capistrano 메서드에 액세스하는 방법?
namespace :mycompany do
class SomeClass
def self.some_static_method()
mylog = capture("some_command")
end
end
end
:이처럼 클래스의 방법을 사용하는 경우, 그러나
namespace :mycompany do
def some_function()
mylog = capture("some_command")
end
desc <<-DESC
some task description
DESC
task :some_task do
mylog = capture("some_command")
end
end
: 그래서 카피 스트라 노에서 내 deploy.rb 스크립트는 내가 쉽게 캡처 기능을 사용할 수있는 곳처럼 보인다
비참하게 실패합니다 :
/config/deploy.rb:120:in `some_static_method': undefined method `capture' for #<Class:0x000000026234f8>::SomeClass (NameError)
어떻게해야합니까?
module Capistrano
class Configuration
module Actions
module Inspect
# Executes the given command on the first server targetted by the
# current task, collects it's stdout into a string, and returns the
# string. The command is invoked via #invoke_command.
def capture(command, options={})
...