D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
opt
/
td-agent
/
embedded
/
lib
/
ruby
/
gems
/
2.1.0
/
gems
/
fluentd-ui-0.4.4
/
lib
/
Filename :
fluentd-ui.rb
back
Copy
module FluentdUI def self.latest_version=(version) @latest = version end def self.latest_version @latest end def self.update_available? return unless @latest latest = Gem::Version.new(@latest) current = Gem::Version.new(::FluentdUI::VERSION) latest > current end def self.fluentd_version setup_fluentd = Fluentd.instance return nil unless setup_fluentd setup_fluentd.agent.version end def self.data_dir if Rails.env.test? dir = Rails.root.join("tmp", "core_data").to_s else dir = ENV["FLUENTD_UI_DATA_DIR"].presence || ENV["HOME"] + "/.fluentd-ui/core_data" end FileUtils.mkdir_p(dir) # ensure directory exists dir end def self.td_agent_ui? ENV["FLUENTD_UI_TD_AGENT"].present? end def self.platform case RbConfig::CONFIG['host_os'] when /darwin|mac os/ :macosx else # FIXME: windows is unix? :P :unix end end end