automateit 0.70928 → 0.70930

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.
data.tar.gz.sig CHANGED
Binary file
@@ -1,3 +1,12 @@
1
+ 0.70930:
2
+ Date: Sun, 30 Sep 2007 15:10:43 -0700
3
+ Desc:
4
+ - Fixed ShellManager#rm to display output like 'rm -rf' rather than 'rm_rf'.
5
+ - Fixed #tags, removed the standalone tag for the distro's version (e.g., "7.04"), it must now be qualified with the distro's name, "ubuntu_7.04".
6
+ - Improved bin/automateit so it doesn't display error trace when user types 'exit' into irb.
7
+ - Improved comments in basic/examples recipes.
8
+ - Improved #tag_for to return a sorted Array instead of a Set.
9
+
1
10
  0.70928:
2
11
  Date: Fri, 28 Sep 2007 23:18:37 -0700
3
12
  Desc:
data/README.txt CHANGED
@@ -23,7 +23,7 @@ Execution:
23
23
  Plugins:
24
24
  * AutomateIt::AccountManager -- Manipulates users and groups.
25
25
  * AutomateIt::AddressManager -- Manipulates host's network addresses.
26
- * AutomateIt::EditManager -- Edits files and strings.
26
+ * AutomateIt::DownloadManager -- Downloads files.
27
27
  * AutomateIt::EditManager::EditSession -- Commands for editing files.
28
28
  * AutomateIt::FieldManager -- Queries configuration variables.
29
29
  * AutomateIt::PackageManager -- Manipulates software packages.
@@ -33,10 +33,10 @@ Examples:
33
33
 
34
34
  # Eval a string
35
35
  #{PROG} -e "puts tags.to_a.inspect"
36
-
36
+
37
37
  # Add a tag
38
38
  #{PROG} -a mytag -e "puts tags.to_a.inspect"
39
-
39
+
40
40
  # Add tags
41
41
  #{PROG} -a 'mytag othertag' -e "puts tags.to_a.inspect"
42
42
 
@@ -96,11 +96,19 @@ EOB
96
96
  argscopy = args.clone
97
97
  optscopy = opts.clone
98
98
 
99
+ # Display newline at the end
100
+ newline = true
101
+
99
102
  begin
100
103
  rv = AutomateIt::CLI.run(opts)
104
+ rescue SystemExit
105
+ # Don't display errors when 'exit' is run
106
+ newline = false
101
107
  rescue Exception => e
102
108
  msg = nil
103
- if opts[:friendly_exceptions] != false and e.is_a?(AutomateIt::Error)
109
+ if e.is_a?(AutomateIt::Error) and e.cause.to_s =~ /IRB_EXIT/
110
+ # Don't display errors interpreter is closed with 'CTRL-D'
111
+ elsif opts[:friendly_exceptions] != false and e.is_a?(AutomateIt::Error)
104
112
  # Friendly message
105
113
  msg = PERROR+e.message
106
114
  msg << "\n\n"+PNOTE+"Use 'automateit --trace' to see complete backtrace"
@@ -115,12 +123,10 @@ EOB
115
123
  end
116
124
  puts msg
117
125
  exit 1
118
- rescue SysExit => e
119
- # Don't display errors when exit gets called
120
126
  end
121
127
  if optscopy[:create] or optscopy[:eval] or argscopy.size > 0
122
128
  exit rv ? 0 :1
123
- else
129
+ elsif newline
124
130
  # CTRL-D ends the line prematurely, so add a newline
125
131
  puts
126
132
  end
@@ -6,7 +6,7 @@ if tagged?("rails_servers | myapp_servers")
6
6
  package_manager.install("build-essential", "ruby1.8-dev", "libsqlite3-dev")
7
7
  elsif tagged?("fedoracore | fedora | centos")
8
8
  # Install equivalent packages on Fedora and similar OSes
9
- package_manager.install("gcc", "'ruby-devel", "sqlite-devel")
9
+ package_manager.install("gcc", "ruby-devel", "sqlite-devel")
10
10
  else
11
11
  # Fail if running on another platform
12
12
  raise NotImplementedError.new("no packages specified for this platform")
@@ -303,7 +303,7 @@ class AutomateIt::EditManager::EditSession < AutomateIt::Common
303
303
  log.silence(Logger::WARN) do
304
304
  result = backup(@filename)
305
305
  end
306
- log.info(PNOTE+"Saved '#{@filename}' to '#{result}'")
306
+ log.debug(PNOTE+"Saved '#{@filename}' to '#{result}'")
307
307
  end
308
308
  protected :_backup
309
309
 
@@ -63,8 +63,10 @@ class AutomateIt::PlatformManager::Struct < AutomateIt::PlatformManager::BaseDri
63
63
 
64
64
  # See PlatformManager#tags
65
65
  def tags
66
- results = @struct.values
67
- results << query("os#arch") rescue IndexError
66
+ results = []
67
+ for key in %w(os arch distro os#arch)
68
+ results << query(key) rescue IndexError
69
+ end
68
70
 
69
71
  release_query = \
70
72
  if single_vendor?
@@ -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.70928")
4
+ VERSION=Gem::Version.new("0.70930")
5
5
 
6
6
  # Instantiates a new Interpreter. See documentation for
7
7
  # Interpreter#setup.
@@ -319,10 +319,23 @@ class AutomateIt::ShellManager::Portable < AutomateIt::ShellManager::BaseDriver
319
319
  else
320
320
  :rm
321
321
  end
322
+
322
323
  present = [targets].flatten.select{|entry| File.exists?(entry)}
323
324
  return false if present.empty?
325
+
326
+ msg = "rm"
327
+ if opts[:recursive] and opts[:force]
328
+ msg << " -rf"
329
+ elsif opts[:recursive]
330
+ msg << " -r"
331
+ elsif opts[:force]
332
+ msg << " -f"
333
+ end
334
+ msg << " " << present.join(' ')
335
+ log.info(PEXEC+msg)
336
+
324
337
  present = present.first if present.size == 0
325
- log.info(PEXEC+"#{kind} #{String === present ? present : present.join(' ')}")
338
+
326
339
  FileUtils.send(kind, present, _fileutils_opts)
327
340
  return present
328
341
  end
@@ -89,7 +89,7 @@ class AutomateIt::TagManager::Struct < AutomateIt::TagManager::BaseDriver
89
89
  else
90
90
  raise TypeError.new("invalid hostnames argument type: #{hostnames.class}")
91
91
  end
92
- return @struct.inject(Set.new) do |sum, role_and_members|
92
+ result = @struct.inject(Set.new) do |sum, role_and_members|
93
93
  role, members = role_and_members
94
94
  members_aliases = members.inject(Set.new) do |aliases, member|
95
95
  aliases.merge(interpreter.address_manager.hostnames_for(member)); aliases
@@ -97,5 +97,6 @@ class AutomateIt::TagManager::Struct < AutomateIt::TagManager::BaseDriver
97
97
  sum.add(role) unless (hostnames & members_aliases).empty?
98
98
  sum
99
99
  end
100
+ return result.to_a.sort
100
101
  end
101
102
  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.70928"
7
- date: 2007-09-29 00:00:00 -07:00
6
+ version: "0.70930"
7
+ date: 2007-10-01 00:00:00 -07:00
8
8
  summary: AutomateIt is an open-source tool for automating the setup and maintenance of UNIX-like systems
9
9
  require_paths:
10
10
  - lib
metadata.gz.sig CHANGED
Binary file