From 4f07b73d1c387b1fa6e4fa8a9ce0c10070cc4086 Mon Sep 17 00:00:00 2001 From: Ryan Davis Date: Thu, 19 Feb 2009 16:48:56 -0800 Subject: Renamed all template files to xxx.erb. sow deals with that and renames dirs as well [git-p4: depot-paths = "//src/hoe/dev/": change = 4627] --- History.txt | 2 +- Manifest.txt | 16 ++++++------- bin/sow | 8 ++++++- template/.autotest | 23 ------------------ template/.autotest.erb | 23 ++++++++++++++++++ template/History.txt | 6 ----- template/History.txt.erb | 6 +++++ template/Manifest.txt | 7 ------ template/Manifest.txt.erb | 7 ++++++ template/README.txt | 48 ------------------------------------- template/README.txt.erb | 48 +++++++++++++++++++++++++++++++++++++ template/Rakefile | 12 ---------- template/Rakefile.erb | 12 ++++++++++ template/bin/file_name | 3 --- template/bin/file_name.erb | 3 +++ template/lib/file_name.rb | 3 --- template/lib/file_name.rb.erb | 3 +++ template/test/test_file_name.rb | 8 ------- template/test/test_file_name.rb.erb | 8 +++++++ 19 files changed, 126 insertions(+), 120 deletions(-) delete mode 100644 template/.autotest create mode 100644 template/.autotest.erb delete mode 100644 template/History.txt create mode 100644 template/History.txt.erb delete mode 100644 template/Manifest.txt create mode 100644 template/Manifest.txt.erb delete mode 100644 template/README.txt create mode 100644 template/README.txt.erb delete mode 100644 template/Rakefile create mode 100644 template/Rakefile.erb delete mode 100755 template/bin/file_name create mode 100755 template/bin/file_name.erb delete mode 100644 template/lib/file_name.rb create mode 100644 template/lib/file_name.rb.erb delete mode 100644 template/test/test_file_name.rb create mode 100644 template/test/test_file_name.rb.erb diff --git a/History.txt b/History.txt index df996d6..3ed3d7d 100644 --- a/History.txt +++ b/History.txt @@ -9,7 +9,7 @@ * Added rspec support including having both tests and specs. * Match RubyGems' RDoc behavior and removed rdoc_pattern attribute. Use extra_rdoc_files instead. - * Replaced my hand rolled test/multi tasks with TestTask versions. From:JB + * Added testlib and SUPPORTED_TEST_FRAMEWORKS to switch your testing library. * 1 bug fixes: diff --git a/Manifest.txt b/Manifest.txt index 2bff231..4aa6a7d 100644 --- a/Manifest.txt +++ b/Manifest.txt @@ -4,13 +4,13 @@ README.txt Rakefile bin/sow lib/hoe.rb -template/.autotest -template/History.txt -template/Manifest.txt -template/README.txt -template/Rakefile -template/bin/file_name -template/lib/file_name.rb -template/test/test_file_name.rb +template/.autotest.erb +template/History.txt.erb +template/Manifest.txt.erb +template/README.txt.erb +template/Rakefile.erb +template/bin/file_name.erb +template/lib/file_name.rb.erb +template/test/test_file_name.rb.erb test/test_hoe.rb diff --git a/bin/sow b/bin/sow index fcfb1d5..23a6fa2 100755 --- a/bin/sow +++ b/bin/sow @@ -50,7 +50,13 @@ Dir.chdir project do end end - paths.grep(/file_name/).each do |file| + paths.grep(/file_name|\.erb$/).each do |file| + new_file = file.sub(/file_name/, file_name).sub(/\.erb$/, '') + FileUtils.mv file, new_file, :verbose => true + end + + dirs = (Dir["**/*"] + Dir["**/.*"]).select { |f| File.directory? f }.sort + dirs.grep(/file_name/).each do |file| FileUtils.mv file, file.gsub(/file_name/, file_name), :verbose => true end end diff --git a/template/.autotest b/template/.autotest deleted file mode 100644 index ef753ad..0000000 --- a/template/.autotest +++ /dev/null @@ -1,23 +0,0 @@ -# -*- ruby -*- - -require 'autotest/restart' - -# Autotest.add_hook :initialize do |at| -# at.extra_files << "../some/external/dependency.rb" -# -# at.libs << ":../some/external" -# -# at.add_exception 'vendor' -# -# at.add_mapping(/dependency.rb/) do |f, _| -# at.files_matching(/test_.*rb$/) -# end -# -# %w(TestA TestB).each do |klass| -# at.extra_class_map[klass] = "test/test_misc.rb" -# end -# end - -# Autotest.add_hook :run_command do |at| -# system "rake build" -# end diff --git a/template/.autotest.erb b/template/.autotest.erb new file mode 100644 index 0000000..ef753ad --- /dev/null +++ b/template/.autotest.erb @@ -0,0 +1,23 @@ +# -*- ruby -*- + +require 'autotest/restart' + +# Autotest.add_hook :initialize do |at| +# at.extra_files << "../some/external/dependency.rb" +# +# at.libs << ":../some/external" +# +# at.add_exception 'vendor' +# +# at.add_mapping(/dependency.rb/) do |f, _| +# at.files_matching(/test_.*rb$/) +# end +# +# %w(TestA TestB).each do |klass| +# at.extra_class_map[klass] = "test/test_misc.rb" +# end +# end + +# Autotest.add_hook :run_command do |at| +# system "rake build" +# end diff --git a/template/History.txt b/template/History.txt deleted file mode 100644 index d90f052..0000000 --- a/template/History.txt +++ /dev/null @@ -1,6 +0,0 @@ -=== 1.0.0 / <%= Time.new.strftime("%Y-%m-%d") %> - -* 1 major enhancement - - * Birthday! - diff --git a/template/History.txt.erb b/template/History.txt.erb new file mode 100644 index 0000000..d90f052 --- /dev/null +++ b/template/History.txt.erb @@ -0,0 +1,6 @@ +=== 1.0.0 / <%= Time.new.strftime("%Y-%m-%d") %> + +* 1 major enhancement + + * Birthday! + diff --git a/template/Manifest.txt b/template/Manifest.txt deleted file mode 100644 index a6f8832..0000000 --- a/template/Manifest.txt +++ /dev/null @@ -1,7 +0,0 @@ -History.txt -Manifest.txt -README.txt -Rakefile -bin/<%= project %> -lib/<%= project %>.rb -test/test_<%= project %>.rb diff --git a/template/Manifest.txt.erb b/template/Manifest.txt.erb new file mode 100644 index 0000000..a6f8832 --- /dev/null +++ b/template/Manifest.txt.erb @@ -0,0 +1,7 @@ +History.txt +Manifest.txt +README.txt +Rakefile +bin/<%= project %> +lib/<%= project %>.rb +test/test_<%= project %>.rb diff --git a/template/README.txt b/template/README.txt deleted file mode 100644 index 531df89..0000000 --- a/template/README.txt +++ /dev/null @@ -1,48 +0,0 @@ -= <%= project %> - -* <%= XIF %> (url) - -== DESCRIPTION: - -<%= XIF %> (describe your package) - -== FEATURES/PROBLEMS: - -* <%= XIF %> (list of features or problems) - -== SYNOPSIS: - - <%= XIF %> (code sample of usage) - -== REQUIREMENTS: - -* <%= XIF %> (list of requirements) - -== INSTALL: - -* <%= XIF %> (sudo gem install, anything else) - -== LICENSE: - -(The MIT License) - -Copyright (c) <%= Time.new.strftime("%Y") %> <%= XIF %> - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/template/README.txt.erb b/template/README.txt.erb new file mode 100644 index 0000000..531df89 --- /dev/null +++ b/template/README.txt.erb @@ -0,0 +1,48 @@ += <%= project %> + +* <%= XIF %> (url) + +== DESCRIPTION: + +<%= XIF %> (describe your package) + +== FEATURES/PROBLEMS: + +* <%= XIF %> (list of features or problems) + +== SYNOPSIS: + + <%= XIF %> (code sample of usage) + +== REQUIREMENTS: + +* <%= XIF %> (list of requirements) + +== INSTALL: + +* <%= XIF %> (sudo gem install, anything else) + +== LICENSE: + +(The MIT License) + +Copyright (c) <%= Time.new.strftime("%Y") %> <%= XIF %> + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/template/Rakefile b/template/Rakefile deleted file mode 100644 index 7a59ce7..0000000 --- a/template/Rakefile +++ /dev/null @@ -1,12 +0,0 @@ -# -*- ruby -*- - -require 'rubygems' -require 'hoe' -require './lib/<%= project %>.rb' - -Hoe.new('<%= project %>', <%= klass %>::VERSION) do |p| - # p.rubyforge_name = '<%= project %>x' # if different than lowercase project name - # p.developer('<%= XIF %>', '<%= XIF %>@example.com') -end - -# vim: syntax=Ruby diff --git a/template/Rakefile.erb b/template/Rakefile.erb new file mode 100644 index 0000000..7a59ce7 --- /dev/null +++ b/template/Rakefile.erb @@ -0,0 +1,12 @@ +# -*- ruby -*- + +require 'rubygems' +require 'hoe' +require './lib/<%= project %>.rb' + +Hoe.new('<%= project %>', <%= klass %>::VERSION) do |p| + # p.rubyforge_name = '<%= project %>x' # if different than lowercase project name + # p.developer('<%= XIF %>', '<%= XIF %>@example.com') +end + +# vim: syntax=Ruby diff --git a/template/bin/file_name b/template/bin/file_name deleted file mode 100755 index 1b4eff8..0000000 --- a/template/bin/file_name +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env ruby - -abort "you need to write me" diff --git a/template/bin/file_name.erb b/template/bin/file_name.erb new file mode 100755 index 0000000..1b4eff8 --- /dev/null +++ b/template/bin/file_name.erb @@ -0,0 +1,3 @@ +#!/usr/bin/env ruby + +abort "you need to write me" diff --git a/template/lib/file_name.rb b/template/lib/file_name.rb deleted file mode 100644 index 2c5cda5..0000000 --- a/template/lib/file_name.rb +++ /dev/null @@ -1,3 +0,0 @@ -class <%= klass %> - VERSION = '1.0.0' -end diff --git a/template/lib/file_name.rb.erb b/template/lib/file_name.rb.erb new file mode 100644 index 0000000..2c5cda5 --- /dev/null +++ b/template/lib/file_name.rb.erb @@ -0,0 +1,3 @@ +class <%= klass %> + VERSION = '1.0.0' +end diff --git a/template/test/test_file_name.rb b/template/test/test_file_name.rb deleted file mode 100644 index 44fb2fa..0000000 --- a/template/test/test_file_name.rb +++ /dev/null @@ -1,8 +0,0 @@ -require "test/unit" -require "<%= file_name %>" - -class Test<%= klass %> < Test::Unit::TestCase - def test_sanity - flunk "write tests or I will kneecap you" - end -end diff --git a/template/test/test_file_name.rb.erb b/template/test/test_file_name.rb.erb new file mode 100644 index 0000000..44fb2fa --- /dev/null +++ b/template/test/test_file_name.rb.erb @@ -0,0 +1,8 @@ +require "test/unit" +require "<%= file_name %>" + +class Test<%= klass %> < Test::Unit::TestCase + def test_sanity + flunk "write tests or I will kneecap you" + end +end -- cgit v1.2.1