runit-man 1.10.2 → 1.10.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -58,6 +58,7 @@ runit:
58
58
  modified: Last modified
59
59
  file_name: File name
60
60
  file_size: File size
61
+ about_utc: All times for log files are represented in UTC.
61
62
  b: b
62
63
  Kb: Kb
63
64
  Mb: Mb
@@ -60,6 +60,7 @@ runit:
60
60
  modified: Последнее изменение
61
61
  file_name: Имя файла
62
62
  file_size: Размер файла
63
+ about_utc: Все времена для файлов представлены в формате UTC.
63
64
  b: б
64
65
  Kb: Кб
65
66
  Mb: Мб
@@ -1,6 +1,6 @@
1
- require 'socket'
2
1
  require 'runit-man/service_info'
3
2
  require 'runit-man/partials'
3
+ require 'runit-man/utils'
4
4
  require 'sinatra/content_for2'
5
5
 
6
6
  module Helpers
@@ -12,16 +12,9 @@ module Helpers
12
12
  attr_accessor :even_or_odd_state
13
13
 
14
14
  def host_name
15
- unless @host_name
16
- begin
17
- @host_name = Socket.gethostbyname(Socket.gethostname).first
18
- rescue
19
- @host_name = Socket.gethostname
20
- end
21
- end
22
- @host_name
15
+ Utils.host_name
23
16
  end
24
-
17
+
25
18
  def service_infos
26
19
  ServiceInfo.all
27
20
  end
@@ -1,5 +1,6 @@
1
1
  require 'runit-man/log_location_cache'
2
2
  require 'runit-man/service_status'
3
+ require 'runit-man/utils'
3
4
 
4
5
  class ServiceInfo
5
6
  SPECIAL_LOG_FILES = %w(lock config state newstate).freeze
@@ -121,13 +122,13 @@ class ServiceInfo
121
122
  next if SPECIAL_LOG_FILES.include?(name)
122
123
  full_name = File.expand_path(name, dir_name)
123
124
  stats = File.stat(full_name)
124
- label = "#{self.name}-#{fl(stats.atime)}-#{fl(stats.mtime)}.log"
125
+ label = "#{Utils.host_name}-#{self.name}-#{fl(stats.atime.utc)}-#{fl(stats.mtime.utc)}.log"
125
126
  r << {
126
127
  :name => name,
127
128
  :label => label,
128
129
  :size => stats.size,
129
- :created => stats.ctime,
130
- :modified => stats.mtime
130
+ :created => stats.ctime.utc,
131
+ :modified => stats.mtime.utc
131
132
  }
132
133
  end
133
134
  if r.length >= 2
@@ -0,0 +1,16 @@
1
+ require 'socket'
2
+
3
+ class Utils
4
+ class << self
5
+ def host_name
6
+ unless @host_name
7
+ begin
8
+ @host_name = Socket.gethostbyname(Socket.gethostname).first
9
+ rescue
10
+ @host_name = Socket.gethostname
11
+ end
12
+ end
13
+ @host_name
14
+ end
15
+ end
16
+ end
@@ -1,4 +1,4 @@
1
1
  module RunitManVersion
2
- VERSION = '1.10.2'.freeze
2
+ VERSION = '1.10.3'.freeze
3
3
  end
4
4
 
@@ -2,7 +2,6 @@
2
2
  <h2><%= h(name) %></h2>
3
3
  <h3><%= h(t.runit.services.log.downloads) %></h3>
4
4
  <table>
5
- <caption><%= h(name + ': ' + t.runit.services.log.downloads) %></caption>
6
5
  <thead>
7
6
  <tr>
8
7
  <th><%= h(t.runit.services.log.modified) %></th>
@@ -11,6 +10,11 @@
11
10
  <th></th>
12
11
  </tr>
13
12
  </thead>
13
+ <tfoot>
14
+ <tr>
15
+ <td colspan="4"><%= h(t.runit.services.log.about_utc) %></td>
16
+ </tr>
17
+ </tfoot>
14
18
  <tbody>
15
19
  <% files.each do |f| %>
16
20
  <tr class="<%= even_or_odd ? 'even' : 'odd' %>">
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: runit-man
3
3
  version: !ruby/object:Gem::Version
4
- hash: 59
4
+ hash: 57
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 10
9
- - 2
10
- version: 1.10.2
9
+ - 3
10
+ version: 1.10.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Akzhan Abdulin
@@ -172,6 +172,7 @@ files:
172
172
  - lib/runit-man/runner.rb
173
173
  - lib/runit-man/service_info.rb
174
174
  - lib/runit-man/service_status.rb
175
+ - lib/runit-man/utils.rb
175
176
  - lib/runit-man/version.rb
176
177
  - public/css/runit-man.css
177
178
  - public/css/tripoli.simple.css