Skip to content

Commit

Permalink
generator tweaks: add license, allow ambitious_blah directory name, n…
Browse files Browse the repository at this point in the history
…o xxspecify
  • Loading branch information
defunkt committed Dec 23, 2007
1 parent cf72362 commit 64c25d0
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions Manifest
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ app_generators/ambition_adapter/templates/lib/query.rb.erb
app_generators/ambition_adapter/templates/lib/select.rb.erb
app_generators/ambition_adapter/templates/lib/slice.rb.erb
app_generators/ambition_adapter/templates/lib/sort.rb.erb
app_generators/ambition_adapter/templates/LICENSE
app_generators/ambition_adapter/templates/Rakefile
app_generators/ambition_adapter/templates/README
app_generators/ambition_adapter/templates/test/helper.rb.erb
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ def initialize(runtime_args, runtime_options = {})
super
usage if args.empty?
@destination_root = File.expand_path(args.shift)
base_name = self.base_name.sub(/ambitious(-|_)/,'')
@adapter_name = base_name
@adapter_module = base_name.split('_').map { |part| part[0] = part[0...1].upcase; part }.join
extract_options
Expand Down
7 changes: 6 additions & 1 deletion app_generators/ambition_adapter/templates/test/helper.rb.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
%w( rubygems test/spec mocha redgreen English ).each { |f| require f }
%w( rubygems test/spec mocha English ).each { |f| require f }

begin
require 'redgreen'
rescue LoadError
end

$LOAD_PATH.unshift File.dirname(__FILE__) + '/../lib'
require 'ambition/adapters/<%= adapter_name %>'
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ context "<%= adapter_module %> Adapter :: Sort" do
string.should == "foo"
end

xxspecify "reverse order with #reverse" do
xspecify "reverse order with #reverse" do
# TODO: not implemented
string = @block.sort_by { |m| m.age }.reverse.to_s
string.should == "foo"
Expand Down

0 comments on commit 64c25d0

Please sign in to comment.