automateit 0.71103 → 0.71104

Sign up to get free protection for your applications and to get access to all the features.
data.tar.gz.sig CHANGED
Binary file
@@ -1,3 +1,9 @@
1
+ 0.71104:
2
+ Date: Sun, 04 Nov 2007 21:01:10 -0800
3
+ Desc:
4
+ - (%) Fixed bugs in startup sequence when run on Microsoft Windows. Added support for Vista.
5
+ - (%) Fixed bugs encountered on Windows in Plugin::Driver. Dependency checks are now done in specific order and stop as soon as a missing dependency is detected.
6
+
1
7
  0.71103:
2
8
  Date: Sat, 03 Nov 2007 01:26:13 -0700
3
9
  Desc:
data/Hoe.rake CHANGED
@@ -6,7 +6,7 @@ require 'automateit'
6
6
 
7
7
  HoeInclude = {
8
8
  :executables => Dir['bin/*'].reject{|t|t.match(/~/)}.map{|t|File.basename(t)},
9
- :files => (%w(env.sh gpl.txt CHANGES.txt Hoe.rake Manifest.txt Rakefile README.txt TESTING.txt TODO.txt TUTORIAL.txt) + FileList["{bin,examples,docs,lib,misc,spec}/**/*"]).to_a.reject{|t| File.directory?(t)},
9
+ :files => (%w(add2path.sh gpl.txt CHANGES.txt Hoe.rake Manifest.txt Rakefile README.txt TESTING.txt TODO.txt TUTORIAL.txt) + FileList["{bin,examples,docs,lib,misc,spec}/**/*"]).to_a.reject{|t| File.directory?(t)},
10
10
  :test_files => FileList["{spec}/**/*"].to_a,
11
11
  }
12
12
 
data/Rakefile CHANGED
@@ -1,6 +1,3 @@
1
- require 'spec/rake/spectask'
2
- require 'rake/gempackagetask'
3
-
4
1
  task :default => :spec
5
2
 
6
3
  #---[ Wrappers ]--------------------------------------------------------
@@ -27,6 +24,7 @@ end
27
24
 
28
25
  # Run rspec on the +files+
29
26
  def specify(*files)
27
+ require 'spec/rake/spectask'
30
28
  Spec::Rake::SpecTask.new(:spec_internal) do |t|
31
29
  t.rcov = @rcov
32
30
  t.rcov_opts = ['--text-summary', '--include', 'lib', '--exclude', 'spec,.irbrc']
data/TODO.txt CHANGED
@@ -2,31 +2,34 @@ KEY: Important? Urgent? Easy? 1=yes, 0=no
2
2
 
3
3
  #===[ App ]=============================================================
4
4
 
5
- BUGS
6
- - does service_manager.start_and_enable work as expected?
7
-
5
+ #---[ Quality issues ]--------------------------------------------------
6
+ 111 ServiceManager -- Create new #stop_and_start, and #restart as #tell wrapper
7
+ 111 ServiceManager -- Write tests for start_and_enable and such
8
8
  111 PackageManager -- Improve PEAR spec by having it check files with and without channel URL
9
- 111 aissh or aion -- Write command for running stuff against servers with ssh, e.g., "aissh rails_servers ls", which is basically a wrapper over "for t in aitag -w rails_servers; do echo $t; ssh $t "ls"; done"
9
+ 111 AccountManager::NSCD -- Uses "ps -ef", needs abstraction
10
+
11
+ #---[ Development ]-----------------------------------------------------
10
12
  111 Shell -- Write #su(user, *command) as a wrapper around #sh
11
13
  101 Shell -- Expand glob patterns, e.g. chown_R(500, 500, "*")
12
-
13
14
  100 Edit -- Display summary of edits, return with :details as [rv, list]
14
- 100 Shell -- Incorporate which.cmd so #which can work on Windows
15
- 100 Interpreter#invoke and HelpfulERB -- Extract error context code into class
15
+ 100 Shell -- Consistently return single items or arrays, alter specs to match
16
+ 101 PackageManager::CPAN - Implement
16
17
 
17
- 001 CPAN -- Write driver for PackageManager::CPAN
18
- 001 FreeBSD -- Write driver for PackageManager::FreeBSD_Ports (or generic ::Ports?) and FreeBSD_Pkg
19
- 000 Darwin -- Write drivers, e.g. PackageManager for Fink and MacPorts (or generic ::Ports?)
20
18
  000 Shell#chperm -- With symbolic mode, wrap `chmod -v` as temporary workaround?
21
- 000 PackageManager -- Provide a way to specify desired versions and upgrade via recipes
22
-
23
- Solaris 10
24
- 000 Create ServiceManager::SMF
25
- 000 Create PackageManager::Blastwave
26
- 000 Create PackageManager::SunOS_Pkg
27
-
28
- ??? Shell -- Return false or list, never single item?
29
- ??? Driver -- How to determine if a manager or driver method is available? Manager#available?, Manager#available and Driver#suitable? only say if it should be a default.
19
+ 001 PackageManager::FreeBSD_Ports - Implmen(or generic ::Ports?) and FreeBSD_Pkg
20
+ 000 Darwin -- Write drivers, e.g. PackageManager for Fink and MacPorts (or generic ::Ports?)
21
+ 000 PackageManager -- Upgrade or install specific versions
22
+ 000 PackageManager::Blastwave -- Implement
23
+ 000 PackageManager::SunOS_Pkg -- Implement
24
+ 000 ServiceManager::SMF -- Implement
25
+ 000 Shell -- Incorporate which.cmd so #which can work on Windows
26
+
27
+ 000 Interpreter#invoke and HelpfulERB -- Extract error context code into class
28
+ 000 Interpeter -- Implement #clear, #dirty? #track_changes
29
+ 000 DatabaseManager -- Design
30
+ 000 SourceManager -- Design
31
+ 000 ScheduleManager -- Design
32
+ 000 Driver -- How to determine if a manager or driver method is available? Manager#available?, Manager#available and Driver#suitable? only say if it should be a default.
30
33
 
31
34
  #===[ Web ]=============================================================
32
35
  100 Index: Call for pilot users, driver authors
File without changes
@@ -4,7 +4,8 @@
4
4
  # Service Cache Daemon, found on Unix-like systems.
5
5
  class ::AutomateIt::AccountManager::NSCD < ::AutomateIt::AccountManager::BaseDriver
6
6
  depends_on :programs => %w(nscd ps),
7
- :callbacks => [lambda{`ps -ef`.match(%r{/usr/sbin/nscd$})}]
7
+ # FIXME AccountManager.nscd - "ps -ef" isn't portable, may need to be "ps aux" or such
8
+ :callbacks => lambda{`ps -ef`.match(%r{/usr/sbin/nscd$})}
8
9
 
9
10
  def suitability(method, *args) # :nodoc:
10
11
  # Level must be higher than Portable
@@ -8,7 +8,7 @@ class AutomateIt::AddressManager::BSD < AutomateIt::AddressManager::BaseDriver
8
8
  end
9
9
 
10
10
  depends_on :programs => %w(ifconfig uname),
11
- :callbacks => lambda{`uname -s`.match(/openbsd|freebsd|sunos/i)}
11
+ :callbacks => lambda{`uname -s 2>&1`.match(/openbsd|freebsd|sunos/i)}
12
12
 
13
13
  def suitability(method, *args) # :nodoc:
14
14
  available? ? 2 : 0
@@ -8,10 +8,10 @@ class AutomateIt::AddressManager::FreeBSD < AutomateIt::AddressManager::BaseDriv
8
8
  end
9
9
 
10
10
  depends_on :programs => %w(ifconfig uname),
11
- :callbacks => lambda{`uname -s`.match(/freebsd/i)}
11
+ :callbacks => lambda{`uname -s 2>&1`.match(/freebsd/i)}
12
12
 
13
13
  def suitability(method, *args) # :nodoc:
14
- # Must be higher than ::BSD
14
+ # Must be higher than AddressManager::BSD
15
15
  available? ? 3 : 0
16
16
  end
17
17
 
@@ -8,10 +8,10 @@ class AutomateIt::AddressManager::OpenBSD < AutomateIt::AddressManager::BaseDriv
8
8
  end
9
9
 
10
10
  depends_on :programs => %w(ifconfig uname),
11
- :callbacks => lambda{`uname -s`.match(/openbsd/i)}
11
+ :callbacks => lambda{`uname -s 2>&1`.match(/openbsd/i)}
12
12
 
13
13
  def suitability(method, *args) # :nodoc:
14
- # Must be higher than ::BSD
14
+ # Must be higher than AddressManager::BSD
15
15
  available? ? 3 : 0
16
16
  end
17
17
 
@@ -8,10 +8,11 @@ class AutomateIt::AddressManager::SunOS < AutomateIt::AddressManager::BaseDriver
8
8
  end
9
9
 
10
10
  depends_on :programs => %w(ifconfig uname),
11
- :callbacks => lambda{`uname -s`.match(/sunos/i)}
11
+ :callbacks => lambda{`uname -s 2>&1`.match(/sunos/i)}
12
12
 
13
13
  def suitability(method, *args) # :nodoc:
14
- available? ? 2 : 0
14
+ # Must be higher than AddressManager::BSD
15
+ available? ? 3 : 0
15
16
  end
16
17
 
17
18
  # See AddressManager#add
@@ -5,16 +5,7 @@
5
5
  class AutomateIt::PackageManager::Gem < AutomateIt::PackageManager::BaseDriver
6
6
  depends_on \
7
7
  :programs => %w(gem),
8
- :callbacks => [lambda{
9
- # TODO PackageManager::Gem -- Misleading #depends_on makes entire driver unavailable, although only #install requires PTY.
10
- begin
11
- require 'expect'
12
- require 'pty'
13
- return true
14
- rescue LoadError
15
- return false
16
- end
17
- }]
8
+ :libraries => %w(expect pty)
18
9
 
19
10
  def suitability(method, *args) # :nodoc:
20
11
  # Never select GEM as the default driver
@@ -16,8 +16,15 @@ class AutomateIt::PlatformManager::Windows < AutomateIt::PlatformManager::Struct
16
16
  @struct[:os] = "windows"
17
17
  @struct[:arch] = ENV["PROCESSOR_ARCHITECTURE"]
18
18
  @struct[:distro] = "microsoft"
19
+
19
20
  # VER values: http://www.ss64.com/nt/ver.html
20
- @struct[:release] = `ver`.strip.match(/Windows (\w+)/)[1].downcase
21
+ ver = `ver`.strip
22
+ if match = ver.match(/Windows (\w+)/)
23
+ @struct[:release] = match[1].downcase
24
+ elsif match = ver.match(/Windows \[Version 6\.0\./)
25
+ @struct[:release] = "vista"
26
+ end
27
+
21
28
  @struct
22
29
  end
23
30
  private :_prepare
@@ -157,42 +157,55 @@ module AutomateIt
157
157
  elsif is_available.nil?
158
158
  all_present = true
159
159
  missing = {}
160
- for kind in opts.keys
161
- #IK# for kind in [:files, :directories, :programs, :callbacks, :requires, :libraries]
162
- next unless opts[kind]
163
- for item in [opts[kind]].flatten
164
- present = \
165
- case kind
166
- when :files
167
- File.exists?(item)
168
- when :directories
169
- File.directory?(item)
170
- when :programs
171
- # XXX Find less awkward way to check if a program exists. Can't use +shell_manager.which+ because that will use +dispatch+ and go into an infinite loop checking +available?+. The +which+ command isn't available on all platforms, so that failure must be handled as well.
172
- begin
173
- interpreter.shell_manager[:which].which!(item)
174
- true
175
- rescue ArgumentError, NotImplementedError, NoMethodError
176
- false
177
- end
178
- when :requires, :libraries
179
- begin
180
- require item
181
- true
182
- rescue LoadError
183
- false
160
+
161
+ # Check callbacks last
162
+ kinds = opts.keys
163
+ callbacks = kinds.delete(:callbacks)
164
+ kinds << callbacks if callbacks
165
+
166
+ begin
167
+ for kind in kinds
168
+ next unless opts[kind]
169
+ for item in [opts[kind]].flatten
170
+ present = \
171
+ case kind
172
+ when :files
173
+ File.exists?(item)
174
+ when :directories
175
+ File.directory?(item)
176
+ when :programs
177
+ # XXX Find less awkward way to check if a program exists. Can't use +shell_manager.which+ because that will use +dispatch+ and go into an infinite loop checking +available?+. The +which+ command isn't available on all platforms, so that failure must be handled as well.
178
+ begin
179
+ interpreter.shell_manager[:which].which!(item)
180
+ true
181
+ rescue ArgumentError, NotImplementedError, NoMethodError
182
+ false
183
+ end
184
+ when :requires, :libraries
185
+ begin
186
+ require item
187
+ true
188
+ rescue LoadError
189
+ false
190
+ end
191
+ when :callbacks
192
+ item.call() ? true : false
193
+ else
194
+ raise TypeError.new("Unknown kind: #{kind}")
184
195
  end
185
- when :callbacks
186
- item.call() ? true : false
187
- else
188
- raise TypeError.new("Unknown kind: #{kind}")
196
+ unless present
197
+ all_present = false
198
+ missing[kind] ||= []
199
+ missing[kind] << item
200
+
201
+ # Do not continue scanning if dependency is missed
202
+ raise EOFError.new("break")
189
203
  end
190
- unless present
191
- all_present = false
192
- missing[kind] ||= []
193
- missing[kind] << item
194
204
  end
195
205
  end
206
+ rescue EOFError => e
207
+ # Ignore expected "break" warning
208
+ raise e unless e.message == "break"
196
209
  end
197
210
  self.class._missing_dependencies = missing
198
211
  self.class._is_available = all_present
@@ -1,7 +1,7 @@
1
1
  # See AutomateIt::Interpreter for usage information.
2
2
  module AutomateIt # :nodoc:
3
3
  # AutomateIt version
4
- VERSION=Gem::Version.new("0.71103")
4
+ VERSION=Gem::Version.new("0.71104")
5
5
 
6
6
  # Instantiates a new Interpreter. See documentation for
7
7
  # Interpreter#setup.
@@ -0,0 +1,24 @@
1
+ #!/usr/bin/env automateit
2
+
3
+ # Install ruby-dbi package and the basic drivers
4
+
5
+ package_manager.install <<-HERE, :with => :gem
6
+ postgres-pr
7
+ sqlite3-ruby
8
+ ### mysql # FIXME Fails because of compile dependencies
9
+ HERE
10
+
11
+ mktempdircd do
12
+ download "http://rubyforge.org/frs/download.php/12368/dbi-0.1.1.tar.gz"
13
+ sh "tar xvfz *.tar.gz"
14
+ extracted_to = Dir.entries(".").select{|t| t=~/\w+/ && File::directory?(t)}.first
15
+ cd extracted_to do
16
+ # FIXME mysql and sqlite fail due to compile dependencies
17
+ ### ruby setup.rb config --with=dbi,dbd_pg,dbd_mysql,dbd_sqlite && \
18
+ sh <<-HERE
19
+ ruby setup.rb config --with=dbi,dbd_pg && \
20
+ ruby setup.rb setup && \
21
+ ruby setup.rb install
22
+ HERE
23
+ end
24
+ end
@@ -159,6 +159,6 @@ else
159
159
  end
160
160
  end
161
161
  rescue NotImplementedError
162
- puts "Can't find AddressManager for this platform, #{__FILE__}"
162
+ puts "NOTE: Can't find AddressManager for this platform, #{__FILE__}"
163
163
  end
164
164
  end
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.4
3
3
  specification_version: 1
4
4
  name: automateit
5
5
  version: !ruby/object:Gem::Version
6
- version: "0.71103"
7
- date: 2007-11-03 00:00:00 -07:00
6
+ version: "0.71104"
7
+ date: 2007-11-04 00:00:00 -07:00
8
8
  summary: AutomateIt is an open source tool for automating the setup and maintenance of servers, applications and their dependencies.
9
9
  require_paths:
10
10
  - lib
@@ -51,7 +51,7 @@ post_install_message:
51
51
  authors:
52
52
  - Igal Koshevoy
53
53
  files:
54
- - env.sh
54
+ - add2path.sh
55
55
  - gpl.txt
56
56
  - CHANGES.txt
57
57
  - Hoe.rake
@@ -160,6 +160,7 @@ files:
160
160
  - misc/setup_egg.rb
161
161
  - misc/which.cmd
162
162
  - misc/setup_gem_dependencies.sh
163
+ - misc/setup_ruby-dbi.rb
163
164
  - spec/spec_helper.rb
164
165
  - spec/breaker.rb
165
166
  - spec/unit/plugins_spec.rb
metadata.gz.sig CHANGED
@@ -1 +1 @@
1
- /DS���U�8?�yp!Df xK �c�O,�+ Ng?�9�#�a-� qU�6�9��h��icE�)�����SJ`ޑj��YqY@逿5�8��H
1
+ GL4Ju�|G9Cj�\��Z(�皛L��