six-updater-web 0.20.4 → 0.20.5

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -7,7 +7,7 @@ require 'rake/testtask'
7
7
 
8
8
  spec = Gem::Specification.new do |s|
9
9
  s.name = 'six-updater-web'
10
- s.version = '0.20.4'
10
+ s.version = '0.20.5'
11
11
  s.has_rdoc = false
12
12
  #s.extra_rdoc_files = ['README', 'LICENSE']
13
13
  s.summary = 'Your summary here'
@@ -7,6 +7,8 @@ class RepositoriesController < ApplicationController
7
7
  :network,
8
8
  :created_at,
9
9
  :updated_at,
10
+ :ping,
11
+ :tracert,
10
12
  :priority,
11
13
  :disabled
12
14
  ]
@@ -16,4 +18,14 @@ class RepositoriesController < ApplicationController
16
18
  config.columns[column].inplace_edit = true
17
19
  end
18
20
  end
21
+
22
+ def ping
23
+ Repository.find(params[:id]).ping
24
+ render :nothing => true
25
+ end
26
+
27
+ def tracert
28
+ Repository.find(params[:id]).tracert
29
+ render :nothing => true
30
+ end
19
31
  end
@@ -1,2 +1,8 @@
1
1
  module RepositoriesHelper
2
+ def ping_column(record, b = nil)
3
+ link_to_remote "ping", {:url => "/repositories/ping/#{record.id}"}
4
+ end
5
+ def tracert_column(record, b = nil)
6
+ link_to_remote "tracert", {:url => "/repositories/tracert/#{record.id}"}
7
+ end
2
8
  end
@@ -2,11 +2,23 @@ class Repository < ActiveRecord::Base
2
2
  belongs_to :network
3
3
  six_guid
4
4
 
5
+ def ping
6
+ SixUpdaterWeb.run_program("ping", SixUpdaterWeb::BASE_PATH, "-r 9 -n 30 -t #{self.address}")
7
+ end
8
+
9
+ def tracert
10
+ SixUpdaterWeb.run_program("tracert", SixUpdaterWeb::BASE_PATH, "-d #{self.address}")
11
+ end
12
+
13
+ def address
14
+ self.url.sub("rsync://", "")
15
+ end
16
+
5
17
  def to_label
6
- "#{url}"
18
+ "#{self.url}"
7
19
  end
8
20
 
9
21
  def to_updater_yml
10
- url
22
+ self.url
11
23
  end
12
24
  end
@@ -22,7 +22,7 @@ case RUBY_VERSION
22
22
  end
23
23
 
24
24
  module SixUpdaterWeb
25
- VERSION = "0.20.4"
25
+ VERSION = "0.20.5"
26
26
  COMPONENT = "six-updater-web"
27
27
 
28
28
  DEFAULT_IP = "127.0.0.1" unless defined?(DEFAULT_IP)
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 20
8
- - 4
9
- version: 0.20.4
8
+ - 5
9
+ version: 0.20.5
10
10
  platform: ruby
11
11
  authors:
12
12
  - Sickboy