delano-drydock 0.5.0 → 0.5.1

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/CHANGES.txt CHANGED
@@ -5,22 +5,33 @@ DRYDOCK, CHANGES
5
5
  * Support putting descriptions into resource file (or __END__)
6
6
  * Define aliases with "command [:name, :alias]"
7
7
  * Add Drydock::Console, Drydock::Window, Drydock::Cursor
8
+ * Generate scripts in the form: script-action
9
+ * globals can be configured with env vars.
10
+ * Motivation to stick to a single environment (just stage)
11
+ * Add convenience methods for system calls: sh, write, read
8
12
 
13
+ #### 0.5.1 (2009-03-??) #############################
9
14
 
10
- #### 0.5 (2009-03-01) ###############################
15
+ * FIX: Prevent calling default command in at_exit when there's a LoadError.
16
+ * FIX: Exit gracefully when the application exits.
17
+ * FIX: Print command names with dashes rather than underscores
11
18
 
19
+
20
+ #### 0.5 (2009-03-11) ###############################
21
+
22
+ * NEW: Checks that the command class is a subclass of Drydock::Command
12
23
  * CHANGE: Cleaned up show-commands screen
13
24
  * FIXED: Help didn't work when using command alias
14
25
  * NEW: Named argv values.
15
26
  * CHANGE: argv are now part of the Command class (not passed to command blocks)
16
27
  * CHANGE: "project" now automatically requires the lowercase name of the project
17
- and gracefully continues if the require failed.
28
+ and gracefully continues if the require failed.
18
29
  * CHANGE: Drydock will look for different validation method, based on the method
19
- being executed. If a validation method is found it's executed and
20
- must return a true valid (it can also raise its own exceptions).
30
+ being executed. If a validation method is found it's executed and
31
+ must return a true valid (it can also raise its own exceptions).
21
32
  * NEW: command actions. These are boolean switches with a twist. Drydock looks
22
- for command_action or action_command methods. Saves checking the switches
23
- and sending to other methods manually.
33
+ for command_action or action_command methods. Saves checking the switches
34
+ and sending to other methods manually.
24
35
 
25
36
 
26
37
  #### 0.4 (2009-02-28) ###############################
data/README.rdoc CHANGED
@@ -1,4 +1,4 @@
1
- = Drydock - v0.4
1
+ = Drydock - v0.5
2
2
 
3
3
  Inspired by github-gem and bmizerany-frylock.
4
4
 
data/Rakefile CHANGED
@@ -44,7 +44,7 @@ end
44
44
  # Rubyforge Release / Publish Tasks ==================================
45
45
 
46
46
  desc 'Publish website to rubyforge'
47
- task 'publish:doc' => 'doc/index.html' do
47
+ task 'publish:rdoc' => 'doc/index.html' do
48
48
  sh "scp -rp doc/* rubyforge.org:/var/www/gforge-projects/#{name}/"
49
49
  end
50
50
 
@@ -59,7 +59,7 @@ end
59
59
  Rake::RDocTask.new do |t|
60
60
  t.rdoc_dir = 'doc'
61
61
  t.title = @spec.summary
62
- t.options << '--line-numbers' << '--inline-source' << '-A cattr_accessor=object'
62
+ t.options << '--line-numbers' << '-A cattr_accessor=object'
63
63
  t.options << '--charset' << 'utf-8'
64
64
  t.rdoc_files.include('LICENSE.txt')
65
65
  t.rdoc_files.include('README.rdoc')
data/drydock.gemspec CHANGED
@@ -1,13 +1,17 @@
1
1
  @spec = Gem::Specification.new do |s|
2
2
  s.name = %q{drydock}
3
- s.version = "0.5.0"
4
- s.date = %q{2009-03-01}
3
+ s.version = "0.5.1"
4
+ s.date = %q{2009-03-15}
5
5
  s.specification_version = 1 if s.respond_to? :specification_version=
6
6
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
7
7
 
8
8
  s.authors = ["Delano Mandelbaum"]
9
9
  s.description = %q{A seaworthy DSL for writing command line apps}
10
+ s.summary = s.description
10
11
  s.email = %q{delano@solutious.com}
12
+
13
+ # = MANIFEST =
14
+ # git ls-files
11
15
  s.files = %w(
12
16
  CHANGES.txt
13
17
  LICENSE.txt
@@ -17,12 +21,14 @@
17
21
  drydock.gemspec
18
22
  lib/drydock.rb
19
23
  )
24
+
25
+ # s.add_dependency ''
26
+
20
27
  s.has_rdoc = true
21
28
  s.homepage = %q{http://github.com/delano/drydock}
22
29
  s.extra_rdoc_files = %w[README.rdoc LICENSE.txt CHANGES.txt]
23
- s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Drydock: a seaworthy DSL for command-line apps", "--main", "README.rdoc"]
30
+ s.rdoc_options = ["--line-numbers", "--title", "Drydock: #{s.description}", "--main", "README.rdoc"]
24
31
  s.require_paths = ["lib"]
25
32
  s.rubygems_version = %q{1.1.1}
26
- s.summary = %q{Drydock: A seaworthy DSL for writing command line apps}
27
33
  s.rubyforge_project = "drydock"
28
34
  end
data/lib/drydock.rb CHANGED
@@ -16,6 +16,13 @@ module Drydock
16
16
  self[#{@fields.size}]
17
17
  end
18
18
  end
19
+ def #{n}=(val)
20
+ if self.size > @fields.size && '#{n}'.to_sym == @fields.last
21
+ self[#{@fields.size}..-1] = val
22
+ else
23
+ self[#{@fields.size}] = val
24
+ end
25
+ end
19
26
  RUBY
20
27
  @fields << n
21
28
  n
@@ -214,7 +221,7 @@ module Drydock
214
221
  next
215
222
  end
216
223
  cmds[cmd][:desc] = Drydock.commands[cmd].desc
217
- cmds[cmd][:pretty] = cmd
224
+ cmds[cmd][:pretty] = pretty
218
225
  end
219
226
 
220
227
  cmds.keys.sort{ |a,b| a.to_s <=> b.to_s }.each do |cmd|
@@ -272,7 +279,7 @@ end
272
279
  module Drydock
273
280
  extend self
274
281
 
275
- VERSION = 0.4
282
+ VERSION = 0.5
276
283
 
277
284
  @@project = nil
278
285
 
@@ -338,10 +345,14 @@ module Drydock
338
345
  # list of commands (see: Drydock::Command#show_commands). It may be
339
346
  # used elsewhere in the future.
340
347
  def project(txt=nil)
348
+
341
349
  return @@project unless txt
350
+
342
351
  begin
343
352
  require txt.downcase
344
- rescue LoadError
353
+ rescue LoadError => ex
354
+ Drydock.run = false # Prevent execution at_exit
355
+ abort "Problem during require: #{ex.message}"
345
356
  end
346
357
  @@project = txt
347
358
  end
@@ -501,6 +512,7 @@ module Drydock
501
512
  cmd = cmds.first
502
513
 
503
514
  if cmd.is_a? Hash
515
+ raise "#{cmd.values.first} is not a subclass of Drydock::Command" unless cmd.values.first.ancestors.member?(Drydock::Command)
504
516
  c = cmd.values.first.new(cmd.keys.first, &b) # A custom class was specified
505
517
  # TODO: handle command [:task, :alias] => Class
506
518
  #elsif cmd.is_a? Array
@@ -581,7 +593,7 @@ module Drydock
581
593
  #
582
594
  # Drydock.run = false
583
595
  def run=(v)
584
- @@run = (v == true) ? true : false
596
+ @@run = (v.is_a?(TrueClass)) ? true : false
585
597
  end
586
598
 
587
599
  # Return true if a command has been executed.
@@ -806,8 +818,13 @@ trap ("SIGINT") do
806
818
  end
807
819
 
808
820
 
821
+
809
822
  at_exit {
810
823
  begin
824
+ if $@
825
+ puts $@ if Drydock.debug?
826
+ exit 1
827
+ end
811
828
  Drydock.run!(ARGV, STDIN) if Drydock.run? && !Drydock.has_run?
812
829
  rescue => ex
813
830
  STDERR.puts "ERROR: #{ex.message}"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: delano-drydock
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Delano Mandelbaum
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-03-01 00:00:00 -08:00
12
+ date: 2009-03-15 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -36,9 +36,8 @@ homepage: http://github.com/delano/drydock
36
36
  post_install_message:
37
37
  rdoc_options:
38
38
  - --line-numbers
39
- - --inline-source
40
39
  - --title
41
- - "Drydock: a seaworthy DSL for command-line apps"
40
+ - "Drydock: A seaworthy DSL for writing command line apps"
42
41
  - --main
43
42
  - README.rdoc
44
43
  require_paths:
@@ -61,6 +60,6 @@ rubyforge_project: drydock
61
60
  rubygems_version: 1.2.0
62
61
  signing_key:
63
62
  specification_version: 1
64
- summary: "Drydock: A seaworthy DSL for writing command line apps"
63
+ summary: A seaworthy DSL for writing command line apps
65
64
  test_files: []
66
65