一般的に、アプリに「サードパーティの実行可能ファイル」を含めたくありません。理想的には、それらがRubyGemsである場合、gemspecでそれらに依存することができます。
そうは言っても、そうする正当な理由があると仮定すると、RubyGemでそれらが確実に配布されるようにすることができます。
- それらを配置する
bin
files
それらがgemspecの属性に含まれていることを確認します
executables
それらがgemspecの属性に含まれていることを確認します
- それ
bindir
が設定されていることを確認します。
したがって、/ / bin / bin / your_app / bin / other_app / bin / other_app2/lib/your_app.rbがある場合
gemspecは次のようになります。
spec = Gem::Specification.new do |s|
s.name = 'your_app'
s.version = '1.2.3'
s.author = 'Your'
s.email = 'your@email.com'
s.platform = Gem::Platform::RUBY
s.summary = 'Your app summary'
s.description = 'Your app description`
s.files = [
'bin/your_app',
'bin/other_app',
'bin/other_app2',
'lib/your_app.rb',
]
s.executables = ["your_app","other_app","other_app2"]
s.require_paths = ["lib"]
s.bindir = 'bin'
end
ユーザーがRubyGemsを介してアプリをインストールすると、3つの実行可能ファイルがパスに含まれます。