runit-man 1.10.3 → 1.11.0

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.
@@ -1,72 +1,95 @@
1
- runit:
2
- label: runit web management tool
3
- title: "%1 - %2"
4
- header: "%1: %2"
5
- error: Error encountered while accessing resource
6
- loading: "Please wait while loading…"
7
- footer: "State of services updated automatically every %1 seconds."
8
- services:
9
- table:
10
- caption: Services
11
- headers:
12
- pid: PID
13
- name: Name
14
- uptime: Uptime (s)
15
- stat: Status
16
- actions: Actions
17
- log_file: Log file
18
- values:
19
- log_hint: Open tail 100 lines of %1 service log in new window
20
- log_absent: Absent
21
- files_to_view: Files
22
- urls_to_views: Urls
23
- footer: Updated at %1
24
- subst:
25
- inactive: <span class="inactive">inactive</span>
26
- down: <span class="down">down<span>
27
- finish: <span class="down">finish<span>
28
- run: <span class="run">run<span>
29
- up: <span class="run">up<span>
30
- actions:
31
- start: Start
32
- stop: Stop
33
- restart: Restart
34
- switch_down: Deactivate
35
- switch_up: Activate
36
- signals:
37
- t: TERM
38
- k: KILL
39
- i: INT
40
- 1: USR1
41
- 2: USR2
42
- a: ALARM
43
- q: QUIT
44
- x: EXIT
45
- p: PAUSE
46
- c: CONT
47
- h: HUP
48
- o: ONCE
49
- log:
50
- title: "Tail %3 lines of service %1 log - %2"
51
- header: "Tail %3 lines of service <strong>%1</strong> log: %2 (<code>%4</code>)"
52
- counts: "Show %1 lines of log"
53
- updated: "Page updated at %1"
54
- reload: Reload
1
+ en:
2
+ runit:
3
+ label: runit web management tool
4
+ title: "%{p1} - %{p2}"
5
+ header: "%{p1}: %{p2}"
6
+ error: Error encountered while accessing resource
7
+ loading: "Please wait while loading&hellip;"
8
+ footer: "State of services updated automatically every %{sec} seconds."
9
+ services:
10
+ table:
11
+ caption: Services
12
+ headers:
13
+ pid: PID
14
+ name: Name
15
+ uptime: Uptime (s)
16
+ stat: Status
17
+ actions: Actions
18
+ log_file: Log file
19
+ values:
20
+ log_hint: Open tail 100 lines of %{name} service log in new window
21
+ log_absent: Absent
22
+ files_to_view: Files
23
+ urls_to_views: Urls
24
+ footer: Updated at %{time}
25
+ subst:
26
+ inactive: <span class="inactive">inactive</span>
27
+ down: <span class="down">down<span>
28
+ finish: <span class="down">finish<span>
29
+ run: <span class="run">run<span>
30
+ up: <span class="run">up<span>
31
+ actions:
32
+ start: Start
33
+ stop: Stop
34
+ restart: Restart
35
+ switch_down: Deactivate
36
+ switch_up: Activate
37
+ signals:
38
+ t: TERM
39
+ k: KILL
40
+ i: INT
41
+ 1: USR1
42
+ 2: USR2
43
+ a: ALARM
44
+ q: QUIT
45
+ x: EXIT
46
+ p: PAUSE
47
+ c: CONT
48
+ h: HUP
49
+ o: ONCE
50
+ log:
51
+ title: "Tail @{count} lines of service @{name} log - @{host}"
52
+ header: "Tail @{count} lines of service <strong>@{name}</strong> log: @{host} (<code>@{log_location}}</code>)"
53
+ counts: "Show @{count} lines of log"
54
+ updated: "Page updated at @{time}"
55
+ reload: Reload
56
+ raw: Raw
57
+ downloads: Log downloads
58
+ download: Download
59
+ modified: Last modified
60
+ file_name: File name
61
+ file_size: File size
62
+ about_utc: All times for log files are represented in UTC.
63
+ b: b
64
+ Kb: Kb
65
+ Mb: Mb
66
+ Gb: Gb
67
+ view_file:
55
68
  raw: Raw
56
- downloads: Log downloads
57
- download: Download
58
- modified: Last modified
59
- file_name: File name
60
- file_size: File size
61
- about_utc: All times for log files are represented in UTC.
62
- b: b
63
- Kb: Kb
64
- Mb: Mb
65
- Gb: Gb
66
- view_file:
67
- raw: Raw
68
- title: 'File %1 on %2'
69
- header: 'View %1 file on %2'
70
- updated: "Page updated at %1"
71
- reload: Reload
69
+ title: 'File %{file} on %{host}'
70
+ header: 'View %{file} file on %{host}'
71
+ updated: "Page updated at %{time}"
72
+ reload: Reload
73
+
74
+ date:
75
+ formats:
76
+ default: "%Y-%m-%d"
77
+ short: "%b %d"
78
+ long: "%B %d, %Y"
79
+
80
+ day_names: [Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday]
81
+ abbr_day_names: [Sun, Mon, Tue, Wed, Thu, Fri, Sat]
82
+
83
+ month_names: [~, January, February, March, April, May, June, July, August, September, October, November, December]
84
+ abbr_month_names: [~, Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec]
85
+ order:
86
+ - :year
87
+ - :month
88
+ - :day
89
+
90
+ time:
91
+ formats:
92
+ default: "%Y-%m-%d %H:%M"
93
+ am: "am"
94
+ pm: "pm"
72
95
 
@@ -1,73 +1,99 @@
1
- runit:
2
- label: runit - управляющий web-интерфейс
3
- title: "%1 - %2"
4
- header: "%1: %2"
5
- error: Ошибка обращения к ресурсу
6
- loading: "Идёт загрузка&hellip;"
7
- footer: "Состояние сервисов обновляется автоматически каждые %1 секунд."
8
- services:
9
- table:
10
- caption: Сервисы
11
- headers:
12
- pid: PID
13
- name: Название
14
- uptime: "Время исполнения (сек.)"
15
- stat: Состояние
16
- actions: Действия
17
- log_file: Лог
18
- values:
19
- log_hint: Отрыть последние 100 строк лога сервиса %1 в новом окне
20
- log_absent: Отсутствует
21
- files_to_view: Файлы
22
- urls_to_view: Ссылки
23
- footer: Обновлено %1
24
- subst:
25
- inactive: <span class="inactive">неактивен</span>
26
- down: <span class="down">остановлен</span>
27
- finish: <span class="down">останавливается</span>
28
- run: <span class="run">работает</span>
29
- up: <span class="run">поднятие</span>
30
- got: получен
31
- want: ожидается
32
- actions:
33
- start: Запустить
34
- stop: Остановить
35
- restart: Перезапустить
36
- switch_down: Выключить
37
- switch_up: Включить
38
- signals:
39
- t: TERM
40
- k: KILL
41
- i: INT
42
- 1: USR1
43
- 2: USR2
44
- a: ALARM
45
- q: QUIT
46
- x: EXIT
47
- p: PAUSE
48
- c: CONT
49
- h: HUP
50
- o: ONCE
51
- log:
52
- title: "Последние %3 строк лога сервиса %1 - %2"
53
- header: "Последние %3 строк лога сервиса <strong>%1</strong>: %2 (<code>%4</code>)"
54
- counts: "Показать %1 строк лога"
55
- updated: "Страница обновлена %1"
56
- reload: Обновить страницу
1
+ ru:
2
+ runit:
3
+ label: runit - управляющий web-интерфейс
4
+ title: "%{p1} - %{p2}"
5
+ header: "%{p1}: %{p2}"
6
+ error: Ошибка обращения к ресурсу
7
+ loading: "Идёт загрузка&hellip;"
8
+ footer: "Состояние сервисов обновляется автоматически каждые %{sec} секунд."
9
+ services:
10
+ table:
11
+ caption: Сервисы
12
+ headers:
13
+ pid: PID
14
+ name: Название
15
+ uptime: "Время исполнения (сек.)"
16
+ stat: Состояние
17
+ actions: Действия
18
+ log_file: Лог
19
+ values:
20
+ log_hint: Отрыть последние 100 строк лога сервиса %{name} в новом окне
21
+ log_absent: Отсутствует
22
+ files_to_view: Файлы
23
+ urls_to_view: Ссылки
24
+ footer: Обновлено %{time}
25
+ subst:
26
+ inactive: <span class="inactive">неактивен</span>
27
+ down: <span class="down">остановлен</span>
28
+ finish: <span class="down">останавливается</span>
29
+ run: <span class="run">работает</span>
30
+ up: <span class="run">поднятие</span>
31
+ got: получен
32
+ want: ожидается
33
+ actions:
34
+ start: Запустить
35
+ stop: Остановить
36
+ restart: Перезапустить
37
+ switch_down: Выключить
38
+ switch_up: Включить
39
+ signals:
40
+ t: TERM
41
+ k: KILL
42
+ i: INT
43
+ 1: USR1
44
+ 2: USR2
45
+ a: ALARM
46
+ q: QUIT
47
+ x: EXIT
48
+ p: PAUSE
49
+ c: CONT
50
+ h: HUP
51
+ o: ONCE
52
+ log:
53
+ title: "Последние %{count} строк лога сервиса %{name} - %{log_location}"
54
+ header: "Последние %{count} строк лога сервиса <strong>%{name}</strong>: %{host} (<code>%{log_location}</code>)"
55
+ counts: "Показать %{count} строк лога"
56
+ updated: "Страница обновлена %{time}"
57
+ reload: Обновить страницу
58
+ raw: Текст
59
+ downloads: Загрузка логов
60
+ download: Скачать
61
+ modified: Последнее изменение
62
+ file_name: Имя файла
63
+ file_size: Размер файла
64
+ about_utc: Все времена для файлов представлены в формате UTC.
65
+ b: б
66
+ Kb: Кб
67
+ Mb: Мб
68
+ Gb: Гб
69
+ view_file:
57
70
  raw: Текст
58
- downloads: Загрузка логов
59
- download: Скачать
60
- modified: Последнее изменение
61
- file_name: Имя файла
62
- file_size: Размер файла
63
- about_utc: Все времена для файлов представлены в формате UTC.
64
- b: б
65
- Kb: Кб
66
- Mb: Мб
67
- Gb: Гб
68
- view_file:
69
- raw: Текст
70
- title: 'Файл %1 на %2'
71
- header: 'Просмотр файла %1 на %2'
72
- updated: "Страница обновлена %1"
73
- reload: Обновить страницу
71
+ title: 'Файл %{name} на %{host}'
72
+ header: 'Просмотр файла %{name} на %{host}'
73
+ updated: "Страница обновлена %{time}"
74
+ reload: Обновить страницу
75
+
76
+ date:
77
+ formats:
78
+ default: "%d.%m.%Y"
79
+ short: "%d %b"
80
+ long: "%d %B %Y"
81
+
82
+ day_names: [воскресенье, понедельник, вторник, среда, четверг, пятница, суббота]
83
+ standalone_day_names: [Воскресенье, Понедельник, Вторник, Среда, Четверг, Пятница, Суббота]
84
+ abbr_day_names: [Вс, Пн, Вт, Ср, Чт, Пт, Сб]
85
+
86
+ month_names: [~, января, февраля, марта, апреля, мая, июня, июля, августа, сентября, октября, ноября, декабря]
87
+ # see russian gem for info on "standalone" day names
88
+ standalone_month_names: [~, Январь, Февраль, Март, Апрель, Май, Июнь, Июль, Август, Сентябрь, Октябрь, Ноябрь, Декабрь]
89
+ abbr_month_names: [~, янв., февр., марта, апр., мая, июня, июля, авг., сент., окт., нояб., дек.]
90
+ standalone_abbr_month_names: [~, янв., февр., март, апр., май, июнь, июль, авг., сент., окт., нояб., дек.]
91
+
92
+ order: [ :day, :month, :year ]
93
+
94
+ time:
95
+ formats:
96
+ default: "%d.%m.%Y %H:%M"
97
+ am: "утра"
98
+ pm: "вечера"
99
+
@@ -1,8 +1,8 @@
1
1
  require 'fileutils'
2
2
  require 'yajl'
3
3
  require 'erubis'
4
+ require 'i18n'
4
5
  require 'sinatra/base'
5
- require 'sinatra/r18n'
6
6
  require 'runit-man/helpers'
7
7
  require 'runit-man/version'
8
8
 
@@ -21,8 +21,6 @@ class RunitMan < Sinatra::Base
21
21
  :json => 'application/json'
22
22
  }.freeze
23
23
 
24
- R18n::Filters.on :variables
25
-
26
24
  set :environment, :production
27
25
  set :static, true
28
26
  set :logging, true
@@ -30,12 +28,29 @@ class RunitMan < Sinatra::Base
30
28
  set :raise_errors, false
31
29
  set :root, GEM_FOLDER
32
30
 
33
- register Sinatra::R18n
34
-
35
31
  helpers do
36
32
  include Helpers
37
33
  end
38
34
 
35
+ def self.i18n_location
36
+ File.join(GEM_FOLDER, 'i18n')
37
+ end
38
+
39
+ def self.setup_i18n_files
40
+ files = []
41
+ Dir.glob("#{i18n_location}/*.yml") do |full_path|
42
+ next unless File.file?(full_path)
43
+ files << full_path
44
+ end
45
+ I18n.load_path = files
46
+ I18n.reload!
47
+ nil
48
+ end
49
+
50
+ configure do
51
+ RunitMan.setup_i18n_files
52
+ end
53
+
39
54
  before do
40
55
  @scripts = []
41
56
  base_content_type = CONTENT_TYPES.keys.detect do |t|
@@ -46,6 +61,38 @@ class RunitMan < Sinatra::Base
46
61
  'X-Powered-By' => 'runit-man',
47
62
  'X-Version' => RunitMan::VERSION
48
63
  })
64
+ parse_language(request.env['HTTP_ACCEPT_LANGUAGE'])
65
+ end
66
+
67
+
68
+ def setup_i18n(locales)
69
+ locales.each do |locale|
70
+ if I18n.available_locales.include?(locale)
71
+ I18n.locale = locale
72
+ break
73
+ end
74
+ end
75
+ end
76
+
77
+ def parse_language(header)
78
+ weighted_locales = []
79
+ if header
80
+ header.split(',').each do |s|
81
+ if s =~ /^(.+)\;q\=(\d(?:\.\d)?)$/
82
+ weighted_locales << { :locale => $1.to_sym, :weight => $2.to_f }
83
+ else
84
+ weighted_locales << { :locale => s.to_sym, :weight => 1.0 }
85
+ end
86
+ end
87
+ end
88
+ weighted_locales << { :locale => :en, :weight => 0.0 }
89
+ if weighted_locales.length >= 2
90
+ weighted_locales.sort! do |a, b|
91
+ b[:weight] <=> a[:weight]
92
+ end
93
+ end
94
+ locales = weighted_locales.map { |wl| wl[:locale] }
95
+ setup_i18n(locales)
49
96
  end
50
97
 
51
98
  get '/' do
@@ -79,7 +126,7 @@ class RunitMan < Sinatra::Base
79
126
  get %r[^/([^/]+)/log(?:/(\d+))?/?$] do |name, count|
80
127
  data = log_of_service(name, count)
81
128
  return not_found if data.nil?
82
- @title = t.runit.services.log.title(h(name), h(host_name), h(count), h(data[:log_location]))
129
+ @title = t('runit.services.log.title', :name => h(name), :host => h(host_name), :count => h(count), :log_location => h(data[:log_location]))
83
130
  erubis :log, :locals => data
84
131
  end
85
132
 
@@ -2,6 +2,7 @@ require 'runit-man/service_info'
2
2
  require 'runit-man/partials'
3
3
  require 'runit-man/utils'
4
4
  require 'sinatra/content_for2'
5
+ require 'i18n'
5
6
 
6
7
  module Helpers
7
8
  include Rack::Utils
@@ -14,6 +15,11 @@ module Helpers
14
15
  def host_name
15
16
  Utils.host_name
16
17
  end
18
+
19
+
20
+ def t(*args)
21
+ Utils.t(*args)
22
+ end
17
23
 
18
24
  def service_infos
19
25
  ServiceInfo.all
@@ -62,7 +68,7 @@ module Helpers
62
68
  end
63
69
 
64
70
  def log_downloads_link(name)
65
- "<a target=\"_blank\" href=\"/#{h(name)}/log-downloads\/\">#{h(t.runit.services.log.downloads)}&hellip;</a>"
71
+ "<a target=\"_blank\" href=\"/#{h(name)}/log-downloads\/\">#{h(t('runit.services.log.downloads'))}&hellip;</a>"
66
72
  end
67
73
 
68
74
  def even_or_odd
@@ -89,13 +95,18 @@ module Helpers
89
95
  suffix = 'Kb'
90
96
  end
91
97
  bytes = ((bytes * 100 + 0.5).to_i.to_f / 100)
92
- "#{sign}#{bytes}#{t.runit.services.log[suffix]}"
98
+ "#{sign}#{bytes}#{t("runit.services.log.#{suffix}")}"
93
99
  end
94
100
 
95
101
  def stat_subst(s)
96
102
  s.split(/\s/).map do |s|
97
- if s =~ /(\w+)/ && t.runit.services.table.subst[$1].translated?
98
- s.sub(/\w+/, t.runit.services.table.subst[$1].to_s)
103
+ if s =~ /(\w+)/
104
+ word = $1
105
+ if t("runit.services.table.subst.#{word}") !~ /translation missing/
106
+ s.sub(word, t("runit.services.table.subst.#{word}"))
107
+ else
108
+ s
109
+ end
99
110
  else
100
111
  s
101
112
  end
@@ -5,8 +5,6 @@ require 'runit-man/utils'
5
5
  class ServiceInfo
6
6
  SPECIAL_LOG_FILES = %w(lock config state newstate).freeze
7
7
 
8
- include R18n::Helpers
9
-
10
8
  attr_reader :name
11
9
 
12
10
  def initialize(a_name)
@@ -109,11 +107,6 @@ class ServiceInfo
109
107
  File.expand_path(file_name, dir_name)
110
108
  end
111
109
 
112
- # Localizes time and replaces some localized characters with more file system friendly characters
113
- def fl(time)
114
- l(time).gsub(/[\:\s]/, '-').gsub(/[\\\/]/, '.')
115
- end
116
-
117
110
  def log_files
118
111
  r = []
119
112
  dir_name = File.dirname(log_file_location)
@@ -122,7 +115,8 @@ class ServiceInfo
122
115
  next if SPECIAL_LOG_FILES.include?(name)
123
116
  full_name = File.expand_path(name, dir_name)
124
117
  stats = File.stat(full_name)
125
- label = "#{Utils.host_name}-#{self.name}-#{fl(stats.atime.utc)}-#{fl(stats.mtime.utc)}.log"
118
+ label = "#{Utils.host_name}-#{self.name}-#{I18n.l(stats.atime.utc)}-#{I18n.l(stats.mtime.utc)}.log"
119
+ label = label.gsub(/[\:\s\,]/, '-').gsub(/[\\\/]/, '.')
126
120
  r << {
127
121
  :name => name,
128
122
  :label => label,
@@ -1,4 +1,5 @@
1
1
  require 'socket'
2
+ require 'i18n'
2
3
 
3
4
  class Utils
4
5
  class << self
@@ -12,5 +13,9 @@ class Utils
12
13
  end
13
14
  @host_name
14
15
  end
16
+
17
+ def t(*args)
18
+ I18n.t(*args)
19
+ end
15
20
  end
16
21
  end
@@ -1,4 +1,4 @@
1
1
  module RunitManVersion
2
- VERSION = '1.10.3'.freeze
2
+ VERSION = '1.11.0'.freeze
3
3
  end
4
4
 
@@ -8,41 +8,41 @@ need_second_row = !service_info.files_to_view.empty? || !service_info.urls_to_vi
8
8
  <td><%= stat_subst(service_info.stat) %></td>
9
9
  <td>
10
10
  <% if service_info.active? %>
11
- <%= service_action service_info.name, :restart, t.runit.services.table.actions.restart, !service_info.down? %>
12
- <%= service_action service_info.name, :down, t.runit.services.table.actions.stop, !service_info.down? %>
13
- <%= service_action service_info.name, :up, t.runit.services.table.actions.start, service_info.down? %>
11
+ <%= service_action service_info.name, :restart, t('runit.services.table.actions.restart'), !service_info.down? %>
12
+ <%= service_action service_info.name, :down, t('runit.services.table.actions.stop'), !service_info.down? %>
13
+ <%= service_action service_info.name, :up, t('runit.services.table.actions.start'), service_info.down? %>
14
14
  <% unless service_info.down? %>
15
15
  <% service_info.allowed_signals.each do |signal| %>
16
- <%= service_signal service_info.name, signal, t.runit.services.table.signals[signal] %>
16
+ <%= service_signal service_info.name, signal, t("runit.services.table.signals.#{signal}") %>
17
17
  <% end %>
18
18
  <% end %>
19
19
  <% if service_info.switchable? %>
20
- <%= service_action service_info.name, :switch_down, t.runit.services.table.actions.switch_down %>
20
+ <%= service_action service_info.name, :switch_down, t('runit.services.table.actions.switch_down') %>
21
21
  <% end %>
22
22
  <% else %>
23
23
  <% if service_info.switchable? %>
24
- <%= service_action service_info.name, :switch_up, t.runit.services.table.actions.switch_up %>
24
+ <%= service_action service_info.name, :switch_up, t('runit.services.table.actions.switch_up') %>
25
25
  <% end %>
26
26
  <% end %>
27
27
  </td>
28
28
  <td>
29
29
  <% if service_info.logged? %>
30
- <%= log_link(service_info.name, :hint => t.runit.services.table.values.log_hint(service_info.name), :blank => true, :title => service_info.log_file_location) %>
30
+ <%= log_link(service_info.name, :hint => t('runit.services.table.values.log_hint', service_info.name), :blank => true, :title => service_info.log_file_location) %>
31
31
  <%= log_downloads_link(service_info.name) %>
32
32
  <% else %>
33
- <%= t.runit.services.table.values.log_absent %>
33
+ <%= t('runit.services.table.values.log_absent') %>
34
34
  <% end %>
35
35
  </td>
36
36
  </tr>
37
37
  <% if need_second_row %><tr><td colspan="5">
38
38
  <% unless service_info.files_to_view.empty? %>
39
- <%= h(t.runit.services.table.values.files_to_view) %>:
39
+ <%= h(t('runit.services.table.values.files_to_view')) %>:
40
40
  <% service_info.files_to_view.each do |f| %>
41
41
  <a href="/view?file=<%= h(f) %>"><%= h(f) %></a>
42
42
  <% end %>
43
43
  <% end %>
44
44
  <% unless service_info.urls_to_view.empty? %>
45
- <%= h(t.runit.services.table.values.urls_to_view) %>:
45
+ <%= h(t('runit.services.table.values.urls_to_view')) %>:
46
46
  <% service_info.urls_to_view.each do |url| %>
47
47
  <a href="<%= h(url) %>"><%= h(url) %></a>
48
48
  <% end %>
@@ -1,18 +1,18 @@
1
1
  <table>
2
- <caption><%= h(t.runit.services.table.caption) %></caption>
2
+ <caption><%= h(t('runit.services.table.caption')) %></caption>
3
3
  <thead>
4
4
  <tr>
5
- <th><%= h(t.runit.services.table.headers.pid) %></th>
6
- <th><%= h(t.runit.services.table.headers.name) %></th>
7
- <th><%= h(t.runit.services.table.headers.uptime) %></th>
8
- <th><%= h(t.runit.services.table.headers.stat) %></th>
9
- <th><%= h(t.runit.services.table.headers.actions) %></th>
10
- <th><%= h(t.runit.services.table.headers.log_file) %></th>
5
+ <th><%= h(t('runit.services.table.headers.pid')) %></th>
6
+ <th><%= h(t('runit.services.table.headers.name')) %></th>
7
+ <th><%= h(t('runit.services.table.headers.uptime')) %></th>
8
+ <th><%= h(t('runit.services.table.headers.stat')) %></th>
9
+ <th><%= h(t('runit.services.table.headers.actions')) %></th>
10
+ <th><%= h(t('runit.services.table.headers.log_file')) %></th>
11
11
  </tr>
12
12
  </thead>
13
13
  <tfoot>
14
14
  <tr>
15
- <td colspan="6"><%= t.runit.services.table.footer(h(Time.now.utc)) %></td>
15
+ <td colspan="6"><%= t('runit.services.table.footer', :time => h(Time.now.utc)) %></td>
16
16
  </tr>
17
17
  </tfoot>
18
18
  <tbody>
@@ -1,14 +1,14 @@
1
1
  <% content_for :content do %>
2
2
  <div id="error" class="error">
3
- <%= h(t.runit.error('<span id="url"></span>')) %>.
3
+ <%= h(t('runit.error', :err => '<span id="url"></span>')) %>.
4
4
  </div>
5
5
  <div id="services">
6
- <%= t.runit.loading %>
6
+ <%= t('runit.loading') %>
7
7
  </div>
8
8
  <% end %>
9
9
  <% content_for :footer do %>
10
10
  <p>
11
- <%= t.runit.footer('<span id="service-refresh-interval">?</span>') %>
11
+ <%= t('runit.footer', :sec => '<span id="service-refresh-interval">?</span>') %>
12
12
  </p>
13
13
  <% end %>
14
14
  <% @scripts << 'runit-man' %>
@@ -1,6 +1,6 @@
1
1
  <html>
2
2
  <head>
3
- <title><%= h(t.runit.title(@title, t.runit.label)) %></title>
3
+ <title><%= h(t('runit.title', :p1 => @title, :p2 => t('runit.label'))) %></title>
4
4
  <link href="/css/tripoli.simple.css" type="text/css" rel="stylesheet" />
5
5
  <link href="/css/tripoli.visual.css" type="text/css" rel="stylesheet" />
6
6
  <link href="/css/tripoli.type.css" type="text/css" rel="stylesheet" />
@@ -11,7 +11,7 @@
11
11
  <div id="container">
12
12
  <div id="header">
13
13
  <div class="content">
14
- <strong><%= h(t.runit.header(host_name, t.runit.label)) %></strong>
14
+ <strong><%= h(t('runit.header', :p1 => host_name, :p2 => t('runit.label'))) %></strong>
15
15
  </div>
16
16
  </div>
17
17
 
@@ -1,8 +1,8 @@
1
1
  <% content_for :content do %>
2
- <%= t.runit.services.log.header(h(name), h(host_name), h(count), h(log_location)) %> | <%= log_link(name, :count => count, :title => t.runit.services.log.raw, :raw => true) %>
2
+ <%= t('runit.services.log.header', :name => h(name), :host => h(host_name), :count => h(count), :log_location => h(log_location)) %> | <%= log_link(name, :count => count, :title => t('runit.services.log.raw'), :raw => true) %>
3
3
 
4
4
  <p>
5
- <%= t.runit.services.log.counts([100, 250, 500, 1000, 5000].map { |n| log_link(name, :count => n, :title => n) }.join(' ')) %>
5
+ <%= t('runit.services.log.counts', :count => [100, 250, 500, 1000, 5000].map { |n| log_link(name, :count => n, :title => n) }.join(' ')) %>
6
6
  <%= log_downloads_link(name) %>
7
7
 
8
8
  </p>
@@ -10,6 +10,6 @@
10
10
  <% end %>
11
11
  <% content_for :footer do %>
12
12
  <p>
13
- <%= t.runit.services.log.updated(Time.now.utc) %> <a href="javascript:;" rel="nofollow" onclick="window.location.reload()"><%= t.runit.services.log.reload %></a>
13
+ <%= t('runit.services.log.updated', :time => I18n.l(Time.now.utc)) %> <a href="javascript:;" rel="nofollow" onclick="window.location.reload()"><%= t('runit.services.log.reload') %></a>
14
14
  </p>
15
15
  <% end %>
@@ -1,27 +1,27 @@
1
1
  <% content_for :content do %>
2
2
  <h2><%= h(name) %></h2>
3
- <h3><%= h(t.runit.services.log.downloads) %></h3>
3
+ <h3><%= h(t('runit.services.log.downloads')) %></h3>
4
4
  <table>
5
5
  <thead>
6
6
  <tr>
7
- <th><%= h(t.runit.services.log.modified) %></th>
8
- <th><%= h(t.runit.services.log.file_name) %></th>
9
- <th><%= h(t.runit.services.log.file_size) %></th>
7
+ <th><%= h(t('runit.services.log.modified')) %></th>
8
+ <th><%= h(t('runit.services.log.file_name')) %></th>
9
+ <th><%= h(t('runit.services.log.file_size')) %></th>
10
10
  <th></th>
11
11
  </tr>
12
12
  </thead>
13
13
  <tfoot>
14
14
  <tr>
15
- <td colspan="4"><%= h(t.runit.services.log.about_utc) %></td>
15
+ <td colspan="4"><%= h(t('runit.services.log.about_utc')) %></td>
16
16
  </tr>
17
17
  </tfoot>
18
18
  <tbody>
19
19
  <% files.each do |f| %>
20
20
  <tr class="<%= even_or_odd ? 'even' : 'odd' %>">
21
- <td title="<%= h(l(f[:modified], :full)) %>"><%= h(l(f[:modified], :human)) %></td>
21
+ <td><%= h(I18n.l(f[:modified])) %></td>
22
22
  <td><%= h(f[:label]) %></td>
23
23
  <td title="<%= h(f[:size]) %>"><%= h(human_bytes(f[:size])) %></td>
24
- <td><a href="/<%= h(name) %>/log-download/<%= h(f[:name]) %>"><%= h(t.runit.services.log.download) %>&hellip;</a></td>
24
+ <td><a href="/<%= h(name) %>/log-download/<%= h(f[:name]) %>"><%= h(t('runit.services.log.download')) %>&hellip;</a></td>
25
25
  </tr>
26
26
  <% end %>
27
27
  </tbody>
@@ -1,10 +1,10 @@
1
1
  <% content_for :content do %>
2
- <%= t.runit.view_file.header(h(name), h(host_name)) %> | <a href="/view.txt?file=<%= h(name) %>"><%= t.runit.view_file.raw %></a>
2
+ <%= t('runit.view_file.header', :name =>h(name), :host => h(host_name)) %> | <a href="/view.txt?file=<%= h(name) %>"><%= t('runit.view_file.raw') %></a>
3
3
 
4
4
  <pre><%= h(text) %></pre>
5
5
  <% end %>
6
6
  <% content_for :footer do %>
7
7
  <p>
8
- <%= t.runit.view_file.updated(Time.now.utc) %> <a href="javascript:;" rel="nofollow" onclick="window.location.reload()"><%= t.view_file.reload %></a>
8
+ <%= t('runit.view_file.updated', :time => Time.now.utc) %> <a href="javascript:;" rel="nofollow" onclick="window.location.reload()"><%= t('runit.view_file.reload') %></a>
9
9
  </p>
10
10
  <% end %>
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: 57
5
- prerelease:
4
+ hash: 59
5
+ prerelease: false
6
6
  segments:
7
7
  - 1
8
- - 10
9
- - 3
10
- version: 1.10.3
8
+ - 11
9
+ - 0
10
+ version: 1.11.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Akzhan Abdulin
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-02-15 00:00:00 +03:00
18
+ date: 2011-02-18 00:00:00 +03:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -78,7 +78,7 @@ dependencies:
78
78
  type: :runtime
79
79
  version_requirements: *id004
80
80
  - !ruby/object:Gem::Dependency
81
- name: sinatra-r18n
81
+ name: i18n
82
82
  prerelease: false
83
83
  requirement: &id005 !ruby/object:Gem::Requirement
84
84
  none: false
@@ -88,9 +88,9 @@ dependencies:
88
88
  hash: 11
89
89
  segments:
90
90
  - 0
91
- - 4
92
- - 2
93
- version: 0.4.2
91
+ - 5
92
+ - 0
93
+ version: 0.5.0
94
94
  type: :runtime
95
95
  version_requirements: *id005
96
96
  - !ruby/object:Gem::Dependency
@@ -224,7 +224,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
224
224
  requirements:
225
225
  - none
226
226
  rubyforge_project:
227
- rubygems_version: 1.5.2
227
+ rubygems_version: 1.3.7
228
228
  signing_key:
229
229
  specification_version: 3
230
230
  summary: Runit web management tool.