itgwiki_mirror 1.0.1 → 1.0.2

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.
@@ -62,10 +62,6 @@ end
62
62
  # main
63
63
  #
64
64
 
65
- # get installation directory
66
- #
67
- dir = File.expand_path "#{File.dirname __FILE__}/.."
68
-
69
65
  # check requirements
70
66
  #
71
67
  begin
@@ -90,7 +86,7 @@ rsync = ask "rsync user@host:port:/path/to/mirror string (port is optional)?"
90
86
  # set up cron job
91
87
  #
92
88
  begin
93
- bin = File.expand_path "#{dir}/bin/itgwiki_mirror_backup"
89
+ bin = "#{Gem.bindir}/itgwiki_mirror_backup"
94
90
  command = "sudo -u#{user} #{bin} -u#{dbuser} -p#{dbpass} -d#{dbname} -w#{wiki} #{rsync}"
95
91
  File.open '/etc/cron.daily/itgwiki_mirror_backup', 'w', 0700 do |f|
96
92
  f.puts "#!/bin/sh"
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
+ require 'rubygems'
3
4
  require 'highline/import'
4
5
  require 'fileutils'
5
6
 
@@ -114,7 +115,7 @@ FileUtils.chown_R user, user, wiki
114
115
  # set up cron job
115
116
  #
116
117
  begin
117
- bin = File.expand_path "#{dir}/bin/itgwiki_mirror_deploy"
118
+ bin = "#{Gem.bindir}/itgwiki_mirror_deploy"
118
119
  command = "exec sudo -u#{user} #{bin} -d#{dbname} -u#{dbuser} -p#{dbpass} -w#{wiki} -m#{mirror}"
119
120
  File.open '/etc/init/itgwiki_mirror_deploy.conf', 'w', 0600 do |f|
120
121
  f.puts UPSTART_TEMPLATE
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: itgwiki_mirror
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
4
+ hash: 19
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 1
10
- version: 1.0.1
9
+ - 2
10
+ version: 1.0.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Justin Force