yggdrasil 0.0.13 → 0.0.14

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -63,7 +63,7 @@ Prepare yggdrasil client to report check results to yggdrasil server, every day:
63
63
 
64
64
  $ crontab -e
65
65
  add following line(you should check path by 'which ygg')
66
- 17 5 * * * $GEMPATH/ygg check
66
+ 17 5 * * * $GEMPATH/ygg check --non-interactive
67
67
 
68
68
  Check updates of configurations/conditions on host:$YGG_SERVER:
69
69
 
@@ -27,7 +27,6 @@ class Yggdrasil
27
27
 
28
28
  FileUtils.cd @mirror_dir do
29
29
  cmd = "#@svn revert #{confirmed_updates.reverse.join(' ')}"
30
- cmd += username_password_options_to_read_repo
31
30
  system3 cmd
32
31
 
33
32
  # make ls hash
@@ -1,5 +1,5 @@
1
1
  class Yggdrasil
2
- VERSION = '0.0.13'
2
+ VERSION = '0.0.14'
3
3
 
4
4
  def version
5
5
  puts <<"EOS"
data/lib/yggdrasil.rb CHANGED
@@ -100,7 +100,6 @@ class Yggdrasil
100
100
  elsif File.file?("/#{file}")
101
101
  if !File.exist?("#@mirror_dir/#{file}")
102
102
  cmd = "#@svn revert #{file}"
103
- cmd += username_password_options_to_read_repo
104
103
  system3 cmd
105
104
  end
106
105
  #FileUtils.copy_file "/#{file}", "#@mirror_dir/#{file}"
@@ -19,6 +19,7 @@ class YggdrasilServer
19
19
  if stat.mtime < (Time.now - @options[:expire].to_i * 60)
20
20
  alert = true
21
21
  puts "######## #{file}: last check is too old: #{stat.mtime.to_s}"
22
+ puts
22
23
  next
23
24
  end
24
25
  end
data/spec/check_spec.rb CHANGED
@@ -86,8 +86,9 @@ EOS
86
86
 
87
87
  cmd = %w{check --username hoge --password foo --non-interactive}
88
88
  out = catch_out {Yggdrasil.command(cmd, "Y\n")}
89
+ out.gsub! /[ ]+/, ' '
89
90
  out.should == <<"EOS"
90
- A 0 tmp/yggdrasil-test/.yggdrasil/checker_result/hoge
91
+ A 0 tmp/yggdrasil-test/.yggdrasil/checker_result/hoge
91
92
 
92
93
  Index: tmp/yggdrasil-test/.yggdrasil/checker_result/hoge
93
94
  ===================================================================
@@ -117,11 +118,12 @@ EOS
117
118
  `rm -f /tmp/yggdrasil-test/.yggdrasil/checker/hoge`
118
119
  cmd = %w{check --username hoge --password foo}
119
120
  out = catch_out {Yggdrasil.command(cmd, "Y\n")}
121
+ out.gsub! /[ ]+/, ' '
120
122
  out.should == <<"EOS"
121
123
 
122
124
  0:D tmp/yggdrasil-test/.yggdrasil/checker_result/hoge
123
125
  OK? [Y|n|<num to diff>]:
124
- D 4 tmp/yggdrasil-test/.yggdrasil/checker_result/hoge
126
+ D 4 tmp/yggdrasil-test/.yggdrasil/checker_result/hoge
125
127
 
126
128
  Index: tmp/yggdrasil-test/.yggdrasil/checker_result/hoge
127
129
  ===================================================================
@@ -183,11 +185,13 @@ EOS
183
185
  files = Dir.entries('/tmp/yggdrasil-test/.yggdrasil/results')
184
186
  result_files = files.select{|file| %r{^#{Socket.gethostname}} =~ file}
185
187
  result_files.size.should == 1
186
- `cat /tmp/yggdrasil-test/.yggdrasil/results/#{result_files[0]}`.should == <<"EOS"
187
- A 0 tmp
188
- A 0 tmp/yggdrasil-test
189
- A 0 tmp/yggdrasil-test/.yggdrasil
190
- A 0 tmp/yggdrasil-test/.yggdrasil/checker_result
188
+ out = `cat /tmp/yggdrasil-test/.yggdrasil/results/#{result_files[0]}`
189
+ out.gsub! /[ ]+/, ' '
190
+ out.should == <<"EOS"
191
+ A 0 tmp
192
+ A 0 tmp/yggdrasil-test
193
+ A 0 tmp/yggdrasil-test/.yggdrasil
194
+ A 0 tmp/yggdrasil-test/.yggdrasil/checker_result
191
195
 
192
196
  EOS
193
197
  end
@@ -205,8 +209,10 @@ EOS
205
209
 
206
210
  files = Dir.entries('/tmp/yggdrasil-test/.yggdrasil/results')
207
211
  result_files = files.select{|file| %r{^#{Socket.gethostname}} =~ file}
208
- `cat /tmp/yggdrasil-test/.yggdrasil/results/#{result_files[0]}`.should == <<"EOS"
209
- M 2 tmp/yggdrasil-test/A
212
+ out = `cat /tmp/yggdrasil-test/.yggdrasil/results/#{result_files[0]}`
213
+ out.gsub! /[ ]+/, ' '
214
+ out.should == <<"EOS"
215
+ M 2 tmp/yggdrasil-test/A
210
216
 
211
217
  Index: tmp/yggdrasil-test/A
212
218
  ===================================================================
@@ -63,11 +63,12 @@ describe YggdrasilServer, 'results' do
63
63
  out = catch_out do
64
64
  lambda{YggdrasilServer.command(%w{results --expire 30})}.should raise_error(SystemExit)
65
65
  end
66
-
66
+ out.gsub! /[ ]+/, ' '
67
67
  out.should == <<"EOS"
68
68
  ######## hoge-old: last check is too old: 2001-05-01 00:00:00 +0900
69
+
69
70
  ######## #{Socket.gethostname}_127.0.0.1 Mismatch:
70
- M 2 tmp/yggdrasil-test/A
71
+ M 2 tmp/yggdrasil-test/A
71
72
 
72
73
  Index: tmp/yggdrasil-test/A
73
74
  ===================================================================
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yggdrasil
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.13
4
+ version: 0.0.14
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-02-17 00:00:00.000000000 Z
12
+ date: 2013-02-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
@@ -116,7 +116,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
116
116
  version: '0'
117
117
  segments:
118
118
  - 0
119
- hash: -2008035553517272387
119
+ hash: 1459074757574721274
120
120
  required_rubygems_version: !ruby/object:Gem::Requirement
121
121
  none: false
122
122
  requirements:
@@ -125,7 +125,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
125
125
  version: '0'
126
126
  segments:
127
127
  - 0
128
- hash: -2008035553517272387
128
+ hash: 1459074757574721274
129
129
  requirements: []
130
130
  rubyforge_project:
131
131
  rubygems_version: 1.8.25