rabal 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGES CHANGED
@@ -1,12 +1,20 @@
1
- = rabal Changelog
1
+ = Changelog
2
+
3
+ === Version 0.2.0
4
+
5
+ * create conditional tasks based upon the availability of libraries (webby, heel, rubyforge)
6
+ * added in site plugin add associated tasks
7
+ * moved all rake tasks to .rake files
8
+ * added tasks to show website and rdoc if heel is installed
9
+
2
10
  === Version 0.1.0
3
11
 
4
12
  * Support for building ruby C extensions
5
13
  * Highline prompting for arguments missed on the commandline
6
14
  * logfile and verbosity options works
7
15
  * Refactored generated rakefile tasks into namespaces
8
- ** rubyforge support
9
- ** rspec and ruby unit templates
16
+ * rubyforge support
17
+ * rspec and ruby unit templates
10
18
 
11
19
  === Version 0.0.1
12
20
 
data/Rakefile CHANGED
@@ -1,79 +1,12 @@
1
+ # make sure our project's ./lib directory is added to the ruby search path
2
+ $: << File.join(File.dirname(__FILE__),"lib")
3
+
1
4
  require 'rubygems'
2
5
  require 'rake/gempackagetask'
3
6
  require 'rake/clean'
4
7
  require 'rake/rdoctask'
8
+ require 'rake/contrib/sshpublisher'
5
9
 
6
- # since we have directories named 'core' remove that from CLEAN
7
- CLEAN.exclude("**/core")
8
-
9
- $: << File.join(File.dirname(__FILE__),"lib")
10
10
  require 'rabal'
11
11
 
12
- # load all the extra tasks for the project
13
- TASK_DIR = File.join(File.dirname(__FILE__),"tasks")
14
- FileList[File.join(TASK_DIR,"*.rb")].each do |tasklib|
15
- require "tasks/#{File.basename(tasklib)}"
16
- end
17
-
18
- task :default => 'test:default'
19
-
20
- #-----------------------------------------------------------------------
21
- # Documentation
22
- #-----------------------------------------------------------------------
23
- namespace :doc do |ns|
24
-
25
- # generating documentation locally
26
- Rake::RDocTask.new do |rdoc|
27
- rdoc.rdoc_dir = Rabal::SPEC.local_rdoc_dir
28
- rdoc.options = Rabal::SPEC.rdoc_options
29
- rdoc.rdoc_files = Rabal::SPEC.rdoc_files
30
- end
31
-
32
- #desc "View the RDoc documentation locally"
33
- task :view => :rdoc do
34
- show_files Rabal::SPEC.local_rdoc_dir
35
- end
36
- end
37
-
38
- #-----------------------------------------------------------------------
39
- # Packaging and Distribution
40
- #-----------------------------------------------------------------------
41
- namespace :dist do
42
-
43
- GEM_SPEC = eval(Rabal::SPEC.to_ruby)
44
-
45
- Rake::GemPackageTask.new(GEM_SPEC) do |pkg|
46
- pkg.need_tar = Rabal::SPEC.need_tar
47
- pkg.need_zip = Rabal::SPEC.need_zip
48
- end
49
-
50
- desc "Install as a gem"
51
- task :install => [:clobber_package, :package] do
52
- sh "sudo gem install pkg/#{Rabal::SPEC.full_name}.gem"
53
- end
54
-
55
- # uninstall the gem and all executables
56
- desc "Uninstall gem"
57
- task :uninstall do
58
- sh "sudo gem uninstall #{Rabal::SPEC.name} -x"
59
- end
60
-
61
- desc "dump gemspec"
62
- task :gemspec do
63
- puts Rabal::SPEC.to_ruby
64
- end
65
-
66
- desc "reinstall gem"
67
- task :reinstall => [:install, :uninstall]
68
-
69
- end
70
-
71
- #-----------------------------------------------------------------------
72
- # update the top level clobber task to depend on all possible sub-level
73
- # tasks that have a name like ':clobber' in other namespaces
74
- #-----------------------------------------------------------------------
75
- Rake.application.tasks.each do |t|
76
- if t.name =~ /:clobber/ then
77
- task :clobber => [t.name]
78
- end
79
- end
12
+ load 'tasks/setup.rb'
@@ -122,10 +122,6 @@ module Rabal
122
122
 
123
123
  }
124
124
 
125
- option("version","V") {
126
- description "Display the version number"
127
- }
128
-
129
125
  def run
130
126
  Rabal.application.rabalize
131
127
  end
@@ -241,7 +237,7 @@ module Rabal
241
237
  Log.logger = main.params["logfile"].value
242
238
  end
243
239
  Log.logger.level = ::Logger::SEV_LABEL.index(main.params["verbosity"].value)
244
- Log.info "Logger initialized"
240
+ Log.debug "Logger initialized"
245
241
  end
246
242
  end
247
243
  end
@@ -33,10 +33,10 @@ module Rabal
33
33
  def before_action
34
34
  @parent_dir = Dir.pwd
35
35
  if not File.directory?(dir_name) then
36
- info("creating directory #{dir_name}")
36
+ info("creating #{dir_name}")
37
37
  Dir.mkdir(dir_name)
38
38
  else
39
- info("skipping directory #{dir_name} - already exists")
39
+ debug("skipping #{dir_name} - already exists")
40
40
  end
41
41
  end
42
42
 
@@ -44,7 +44,7 @@ module Rabal
44
44
  # change into the directory
45
45
  #
46
46
  def action
47
- info("entering directory #{dir_name}")
47
+ debug("entering #{dir_name}")
48
48
  Dir.chdir(dir_name)
49
49
  end
50
50
 
@@ -52,7 +52,7 @@ module Rabal
52
52
  # change back to the parent directory
53
53
  #
54
54
  def after_action
55
- info("leaving directory #{dir_name}")
55
+ debug("leaving #{dir_name}")
56
56
  Dir.chdir(parent_dir)
57
57
  end
58
58
  end
@@ -23,7 +23,7 @@ module Rabal
23
23
 
24
24
  # the contents of the file to write
25
25
  attr_accessor :file_contents
26
-
26
+
27
27
  class << self
28
28
 
29
29
  #
@@ -64,7 +64,7 @@ module Rabal
64
64
  # binding for erb if there is one
65
65
  #
66
66
  def before_action
67
- info("creating content for #{file_name}")
67
+ debug("creating content for #{file_name}")
68
68
  begin
69
69
  @file_contents = ERB.new(template).result(binding)
70
70
  rescue Exception => e
@@ -82,12 +82,12 @@ module Rabal
82
82
  #
83
83
  def action
84
84
  if not File.file?(file_name) then
85
- info("writing file #{file_name}")
85
+ info("creating #{file_name}")
86
86
  File.open(file_name,"w+") do |f|
87
87
  f.write(file_contents)
88
88
  end
89
89
  else
90
- info("skipping file #{file_name} - already exists")
90
+ debug("skipping #{file_name} - already exists")
91
91
  end
92
92
  end
93
93
  end
@@ -34,15 +34,16 @@ module Rabal
34
34
  spec.add_dependency("main", ">= 0.0.2")
35
35
  spec.add_dependency("gem_plugin", ">= 0.2.1")
36
36
  spec.add_dependency("highline", ">= 1.2.9")
37
+ spec.required_ruby_version = ">= 1.8.5"
37
38
 
38
39
  spec.platform = Gem::Platform::RUBY
39
40
 
41
+ spec.remote_user = "jjh"
40
42
  spec.local_rdoc_dir = "doc/rdoc"
41
- spec.remote_rdoc_dir = "#{spec.name}/rdoc"
43
+ spec.remote_rdoc_dir = ""
42
44
  spec.local_coverage_dir = "doc/coverage"
43
- spec.remote_coverage_dir= "#{spec.name}/coverage"
44
45
 
45
- spec.remote_site_dir = "#{spec.name}/"
46
+ spec.remote_site_dir = ""
46
47
 
47
48
  end
48
49
  end
@@ -7,3 +7,4 @@ require 'rabal/plugin/license'
7
7
  require 'rabal/plugin/rubyforge'
8
8
  require 'rabal/plugin/spec'
9
9
  require 'rabal/plugin/test'
10
+ require 'rabal/plugin/website'
@@ -91,7 +91,7 @@ module Rabal
91
91
  # validate the parameters of the plugin in the simplest way
92
92
  # possible. Make sure that each listend parameters is not
93
93
  # null. This assumes that @parameters has a method for each
94
- # parameter naem
94
+ # parameter name
95
95
  #
96
96
  def validate_parameters
97
97
  self.class.parameters.each do |name,param_info|
@@ -0,0 +1,13 @@
1
+ require 'rabal/plugin/foundation'
2
+ module Rabal
3
+ module Plugin
4
+ class Website < Rabal::Plugin::Base "/rabal/website"
5
+ description "Add a website for your application."
6
+ def initialize(options)
7
+ @parameters = OpenStruct.new(options)
8
+ validate_parameters
9
+ @tree = PluginTree.new({}, resource_by_name(my_main_tree_name))
10
+ end
11
+ end
12
+ end
13
+ end
@@ -3,7 +3,7 @@ require 'rabal'
3
3
  module Rabal
4
4
  class Version
5
5
  MAJOR = 0
6
- MINOR = 1
6
+ MINOR = 2
7
7
  BUILD = 0
8
8
 
9
9
  class << self
@@ -2,9 +2,11 @@
2
2
 
3
3
  begin
4
4
  require '<%= project_name %>'
5
- rescue LoadError => le
6
- $: << File.expand_path(File.join(File.dirname(__FILE__),"..","lib"))
7
- require '<%= project_name %>'
5
+ rescue LoadError
6
+ path = File.expand_path(File.join(File.dirname(__FILE__),"..","lib"))
7
+ raise if $:.include?(path)
8
+ $: << path
9
+ retry
8
10
  end
9
11
 
10
12
  puts "I am the killer app <%= project_name %> at version #{<%= project_name.camelize %>::VERSION}!"
@@ -1,67 +1,14 @@
1
+ # make sure our project's ./lib directory is added to the ruby search path
2
+ $: << File.join(File.dirname(__FILE__),"lib")
3
+
1
4
  require 'rubygems'
2
5
  require 'rake/gempackagetask'
3
6
  require 'rake/clean'
4
7
  require 'rake/rdoctask'
8
+ require 'rake/contrib/sshpublisher'
5
9
 
6
- $: << File.join(File.dirname(__FILE__),"lib")
7
10
  require '<%= project_name.underscore %>'
8
11
 
9
- # load all the extra tasks for the project
10
- TASK_DIR = File.join(File.dirname(__FILE__),"tasks")
11
- FileList[File.join(TASK_DIR,"*.rb")].each do |tasklib|
12
- require "tasks/#{File.basename(tasklib)}"
13
- end
14
-
15
- task :default => "test:default"
16
-
17
- #-----------------------------------------------------------------------
18
- # Documentation
19
- #-----------------------------------------------------------------------
20
- namespace :doc do
21
-
22
- # generating documentation locally
23
- Rake::RDocTask.new do |rdoc|
24
- rdoc.rdoc_dir = <%= project_name.camelize %>::SPEC.local_rdoc_dir
25
- rdoc.options = <%= project_name.camelize %>::SPEC.rdoc_options
26
- rdoc.rdoc_files = <%= project_name.camelize %>::SPEC.rdoc_files
27
- end
28
-
29
- desc "View the RDoc documentation locally"
30
- task :view => :rdoc do
31
- show_files <%= project_name.camelize %>::SPEC.local_rdoc_dir
32
- end
33
-
34
- end
35
-
36
- #-----------------------------------------------------------------------
37
- # Packaging and Distribution
38
- #-----------------------------------------------------------------------
39
- namespace :dist do
40
-
41
- GEM_SPEC = eval(<%= project_name.camelize %>:::SPEC.to_ruby)
42
-
43
- Rake::GemPackageTask.new(GEM_SPEC) do |pkg|
44
- pkg.need_tar = <%= project_name.camelize %>::SPEC.need_tar
45
- pkg.need_zip = <%= project_name.camelize %>::SPEC.need_zip
46
- end
47
-
48
- desc "Install as a gem"
49
- task :install => [:clobber, :package] do
50
- sh "sudo gem install pkg/#{<%= project_name.camelize %>::SPEC.full_name}.gem"
51
- end
52
-
53
- # uninstall the gem and all executables
54
- desc "Uninstall gem"
55
- task :uninstall do
56
- sh "sudo gem uninstall #{<%= project_name.camelize %>::SPEC.name} -x"
57
- end
58
-
59
- desc "dump gemspec"
60
- task :gemspec do
61
- puts <%= project_name.camelize %>::SPEC.to_ruby
62
- end
12
+ load 'tasks/setup.rb'
63
13
 
64
- desc "reinstall gem"
65
- task :reinstall => [:install, :uninstall]
66
14
 
67
- end
@@ -0,0 +1,57 @@
1
+ #-----------------------------------------------------------------------
2
+ # Announcement tasks
3
+ # - create a basic email template that can be used to send email to
4
+ # rubytalk.
5
+ #-----------------------------------------------------------------------
6
+ def changes
7
+ change_file = File.expand_path(File.join(<%= project_name.camelize %>::ROOT_DIR,"CHANGES"))
8
+ sections = File.read(change_file).split(/^(?===)/)
9
+ end
10
+
11
+ def last_changeset
12
+ changes[1]
13
+ end
14
+
15
+ def announcement
16
+ urls = " #{<%= project_name.camelize %>::SPEC.homepage}"
17
+ subject = "#{<%= project_name.camelize %>::SPEC.name} #{<%= project_name.camelize %>::VERSION} Released"
18
+ title = "#{<%= project_name.camelize %>::SPEC.name} version #{<%= project_name.camelize %>::VERSION} has been released."
19
+ body = <<BODY
20
+ #{<%= project_name.camelize %>::SPEC.description.rstrip}
21
+
22
+ {{ Changelog for Version #{<%= project_name.camelize %>::VERSION} }}
23
+
24
+ #{last_changeset.rstrip}
25
+
26
+ BODY
27
+
28
+ return subject, title, body, urls
29
+ end
30
+
31
+ namespace :announce do
32
+ desc "create email for ruby-talk"
33
+ task :email do
34
+ subject, title, body, urls = announcement
35
+
36
+ File.open("email.txt", "w") do |mail|
37
+ mail.puts "From: #{<%= project_name.camelize %>::SPEC.author} <#{<%= project_name.camelize %>::SPEC.email}>"
38
+ mail.puts "To: ruby-talk@ruby-lang.org"
39
+ mail.puts "Date: #{Time.now.rfc2822}"
40
+ mail.puts "Subject: [ANN] #{subject}"
41
+ mail.puts
42
+ mail.puts title
43
+ mail.puts
44
+ mail.puts urls
45
+ mail.puts
46
+ mail.puts body
47
+ mail.puts
48
+ mail.puts urls
49
+ end
50
+ puts "Created the following as email.txt:"
51
+ puts "-" * 72
52
+ puts File.read("email.txt")
53
+ puts "-" * 72
54
+ end
55
+
56
+ CLOBBER << "email.txt"
57
+ end
@@ -0,0 +1,32 @@
1
+ #-----------------------------------------------------------------------
2
+ # Distribution and Packaging
3
+ #-----------------------------------------------------------------------
4
+ namespace :dist do
5
+
6
+ GEM_SPEC = eval(<%= project_name.camelize %>::SPEC.to_ruby)
7
+
8
+ Rake::GemPackageTask.new(GEM_SPEC) do |pkg|
9
+ pkg.need_tar = <%= project_name.camelize %>::SPEC.need_tar
10
+ pkg.need_zip = <%= project_name.camelize %>::SPEC.need_zip
11
+ end
12
+
13
+ desc "Install as a gem"
14
+ task :install => [:clobber, :package] do
15
+ sh "sudo gem install pkg/#{<%= project_name.camelize %>::SPEC.full_name}.gem"
16
+ end
17
+
18
+ # uninstall the gem and all executables
19
+ desc "Uninstall gem"
20
+ task :uninstall do
21
+ sh "sudo gem uninstall #{<%= project_name.camelize %>::SPEC.name} -x"
22
+ end
23
+
24
+ desc "dump gemspec"
25
+ task :gemspec do
26
+ puts <%= project_name.camelize %>::SPEC.to_ruby
27
+ end
28
+
29
+ desc "reinstall gem"
30
+ task :reinstall => [:uninstall, :install]
31
+
32
+ end
@@ -0,0 +1,25 @@
1
+ #-----------------------------------------------------------------------
2
+ # Documentation
3
+ #-----------------------------------------------------------------------
4
+
5
+ namespace :doc do
6
+
7
+ # generating documentation locally
8
+ Rake::RDocTask.new do |rdoc|
9
+ rdoc.rdoc_dir = <%= project_name.camelize %>::SPEC.local_rdoc_dir
10
+ rdoc.options = <%= project_name.camelize %>::SPEC.rdoc_options
11
+ rdoc.rdoc_files = <%= project_name.camelize %>::SPEC.rdoc_files
12
+ end
13
+
14
+ desc "Deploy the RDoc documentation to #{<%= project_name.camelize %>::SPEC.remote_rdoc_location}"
15
+ task :deploy => :rerdoc do
16
+ sh "rsync -zav --delete #{<%= project_name.camelize %>::SPEC.local_rdoc_dir}/ #{<%= project_name.camelize %>::SPEC.remote_rdoc_location}"
17
+ end
18
+
19
+ if HAVE_HEEL then
20
+ desc "View the RDoc documentation locally"
21
+ task :view => :rdoc do
22
+ sh "heel --root #{<%= project_name.camelize %>::SPEC.local_rdoc_dir}"
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,40 @@
1
+ #-----------------------------------------------------------------------
2
+ # Try to load the given _library_ using the built-in require, but do not
3
+ # raise a LoadError if unsuccessful. Returns +true+ if the _library_ was
4
+ # successfully loaded; returns +false+ otherwise.
5
+ #-----------------------------------------------------------------------
6
+ def try_require( lib )
7
+ require lib
8
+ true
9
+ rescue LoadError
10
+ false
11
+ end
12
+
13
+ #-----------------------------------------------------------------------
14
+ # setup global constants so the task libs can make decisions based upon
15
+ # the availability of other libraries.
16
+ # - heel is a mongrel based webserver used to serve up files locally
17
+ # - webby is a static site generation tool
18
+ # - rubyforge is self explanatory
19
+ #-----------------------------------------------------------------------
20
+ %w(heel webby rubyforge).each do |lib|
21
+ Object.instance_eval { const_set "HAVE_#{lib.upcase}", try_require(lib) }
22
+ end
23
+
24
+ #-----------------------------------------------------------------------
25
+ # load all the extra tasks for the project and setup the default task
26
+ # the test:default is set by the spec or by the testunit library.
27
+ #-----------------------------------------------------------------------
28
+ FileList["tasks/*.rake"].each { |tasklib| import tasklib }
29
+
30
+ task :default => 'test:default'
31
+
32
+ #-----------------------------------------------------------------------
33
+ # update the top level clobber task to depend on all possible sub-level
34
+ # tasks that have a name like ':clobber' in other namespaces
35
+ #-----------------------------------------------------------------------
36
+ Rake.application.tasks.each do |t|
37
+ if t.name =~ /:clobber/ then
38
+ task :clobber => [t.name]
39
+ end
40
+ end
@@ -0,0 +1,43 @@
1
+ if HAVE_RUBYFORGE then
2
+ require 'rubyforge'
3
+
4
+ #-----------------------------------------------------------------------
5
+ # Rubyforge additions to the task library
6
+ #-----------------------------------------------------------------------
7
+ namespace :dist do
8
+ desc "Release files to rubyforge"
9
+ task :rubyforge => [:clean, :package] do
10
+
11
+ rubyforge = RubyForge.new
12
+
13
+ # make sure this release doesn't already exist
14
+ releases = rubyforge.autoconfig['release_ids']
15
+ if releases.has_key?(<%= project_name.camelize %>::SPEC.name) and releases[<%= project_name.camelize %>::SPEC.name][<%= project_name.camelize %>::VERSION] then
16
+ abort("Release #{<%= project_name.camelize %>::VERSION} already exists! Unable to release.")
17
+ end
18
+
19
+ config = rubyforge.userconfig
20
+ config["release_notes"] = <%= project_name.camelize %>::SPEC.description
21
+ config["release_changes"] = last_changeset
22
+ config["Prefomatted"] = true
23
+
24
+ puts "Uploading to rubyforge..."
25
+ files = FileList[File.join("pkg","#{<%= project_name.camelize %>::SPEC.name}-#{<%= project_name.camelize %>::VERSION}*.*")].to_a
26
+ rubyforge.login
27
+ rubyforge.add_release(<%= project_name.camelize %>::SPEC.rubyforge_project, <%= project_name.camelize %>::SPEC.name, <%= project_name.camelize %>::VERSION, *files)
28
+ puts "done."
29
+ end
30
+ end
31
+
32
+ namespace :announce do
33
+ desc "Post news of #{<%= project_name.camelize %>::SPEC.name} to #{<%= project_name.camelize %>::SPEC.rubyforge_project} on rubyforge"
34
+ task :rubyforge do
35
+ subject, title, body, urls = announcement
36
+ rubyforge = RubyForge.new
37
+ rubyforge.login
38
+ rubyforge.post_news(<%= project_name.camelize %>::SPEC.rubyforge_project, subject, "#{title}\n\n#{urls}\n\n#{body}")
39
+ puts "Posted to rubyforge"
40
+ end
41
+
42
+ end
43
+ end
@@ -1,5 +1,5 @@
1
1
  require 'rubygems'
2
- require 'rspec'
2
+ require 'spec'
3
3
 
4
4
  $: << File.expand_path(File.join(File.dirname(__FILE__),"..","lib"))
5
5
  require '<%= project_name %>'
@@ -11,10 +11,14 @@ namespace :test do
11
11
  r.rcov = true
12
12
  r.rcov_dir = <%= project_name.camelize %>::SPEC.local_coverage_dir
13
13
  r.libs = <%= project_name.camelize %>::SPEC.require_paths
14
- r.spec_opts = %w(--format specdoc)
14
+ r.spec_opts = %w(--format specdoc --color)
15
15
  end
16
16
 
17
- task :coverage => [:spec] do
18
- show_files <%= project_name.camelize %>::SPEC.local_coverage_dir
19
- end
17
+ if HAVE_HEEL then
18
+ desc "View the code coverage report locally"
19
+ task :coverage => [:spec] do
20
+ sh "heel --root #{<%= project_name.camelize %>::SPEC.local_coverage_dir}"
21
+ end
22
+ end
23
+
20
24
  end
@@ -0,0 +1,39 @@
1
+ #-----------------------------------------------------------------------
2
+ # Website maintenance
3
+ #-----------------------------------------------------------------------
4
+
5
+ namespace :site do
6
+
7
+ desc "Remove all the files from the local deployment of the site"
8
+ task :clobber do
9
+ rm_rf <%= project_name.camelize %>::SPEC.local_site_dir
10
+ end
11
+
12
+ desc "Update the website on #{<%= project_name.camelize %>::SPEC.remote_site_location}"
13
+ task :deploy => :build do
14
+ sh "rsync -zav --delete #{<%= project_name.camelize %>::SPEC.local_site_dir}/ #{<%= project_name.camelize %>::SPEC.remote_site_location}"
15
+ end
16
+
17
+ if HAVE_WEBBY then
18
+ desc "Create the initial webiste template"
19
+ task :init do
20
+ Dir.chdir <%= project_name.camelize %>::ROOT_DIR do
21
+ ::Webby::Main.run(["website"])
22
+ end
23
+ puts "You will need to edit the website/tasks/setup.rb file at this time."
24
+ end
25
+
26
+ desc "Build the public website"
27
+ task :build do
28
+ sh "pushd website && rake"
29
+ end
30
+ end
31
+
32
+ if HAVE_HEEL then
33
+ desc "View the website locally"
34
+ task :view => :build do
35
+ sh "heel --root #{<%= project_name.camelize %>::SPEC.local_site_dir}"
36
+ end
37
+ end
38
+
39
+ end
@@ -5,7 +5,7 @@ describe Rabal::Plugin::Bin do
5
5
  @working_dir = my_temp_dir
6
6
  @before = Dir.pwd
7
7
  @core = Rabal::Plugin::Core.new({:project => "new-spec-proj", :author => "Foo Bar", :email => "foobar@example.com"})
8
- @base_tree = Set.new(%w(README Rakefile CHANGES lib lib/new-spec-proj lib/new_spec_proj.rb lib/new-spec-proj/version.rb bin bin/new_spec_proj lib/new-spec-proj/specification.rb lib/new-spec-proj/gemspec.rb))
8
+ @base_tree = Set.new(%w(README Rakefile CHANGES lib lib/new-spec-proj lib/new_spec_proj.rb lib/new-spec-proj/version.rb bin bin/new_spec_proj lib/new-spec-proj/specification.rb lib/new-spec-proj/gemspec.rb tasks tasks/setup.rb tasks/announce.rake tasks/distribution.rake tasks/documentation.rake))
9
9
  Dir.chdir(@working_dir)
10
10
  end
11
11
 
@@ -4,7 +4,7 @@ describe Rabal::Plugin::Core do
4
4
  @working_dir = my_temp_dir
5
5
  @before = Dir.pwd
6
6
  @core = Rabal::Plugin::Core.new({:project => "new-spec-proj", :author => "Foo Bar", :email => "foobar@example.com"})
7
- @base_tree = Set.new(%w(README Rakefile CHANGES lib lib/new-spec-proj lib/new_spec_proj.rb lib/new-spec-proj/version.rb lib/new-spec-proj/specification.rb lib/new-spec-proj/gemspec.rb))
7
+ @base_tree = Set.new(%w(README Rakefile CHANGES lib lib/new-spec-proj lib/new_spec_proj.rb lib/new-spec-proj/version.rb lib/new-spec-proj/specification.rb lib/new-spec-proj/gemspec.rb tasks tasks/setup.rb tasks/announce.rake tasks/distribution.rake tasks/documentation.rake))
8
8
  Dir.chdir(@working_dir)
9
9
  end
10
10
 
@@ -4,7 +4,7 @@ describe Rabal::Plugin::License do
4
4
  @working_dir = my_temp_dir
5
5
  @before = Dir.pwd
6
6
  @core = Rabal::Plugin::Core.new({:project => "new-spec-proj", :author => "Foo Bar", :email => "foobar@example.com"})
7
- @base_tree = Set.new(%w(README Rakefile CHANGES COPYING LICENSE lib lib/new-spec-proj lib/new_spec_proj.rb lib/new-spec-proj/version.rb lib/new-spec-proj/gemspec.rb lib/new-spec-proj/specification.rb))
7
+ @base_tree = Set.new(%w(README Rakefile CHANGES COPYING LICENSE lib lib/new-spec-proj lib/new_spec_proj.rb lib/new-spec-proj/version.rb lib/new-spec-proj/gemspec.rb lib/new-spec-proj/specification.rb tasks tasks/setup.rb tasks/announce.rake tasks/distribution.rake tasks/documentation.rake))
8
8
  Dir.chdir(@working_dir)
9
9
  end
10
10
 
@@ -8,7 +8,7 @@ describe Rabal::PluginTree do
8
8
  @tree = ProjectTree.new('new-spec-proj', {:author => "Some Author", :email => "author@example.com"})
9
9
  @tree << PluginTree.new({:data1 => "some_data" },resource_handle("core"))
10
10
 
11
- @base_tree = Set.new(%w(README Rakefile CHANGES lib lib/new-spec-proj lib/new_spec_proj.rb lib/new-spec-proj/version.rb lib/new-spec-proj/gemspec.rb lib/new-spec-proj/specification.rb))
11
+ @base_tree = Set.new(%w(README Rakefile CHANGES lib lib/new-spec-proj lib/new_spec_proj.rb lib/new-spec-proj/version.rb lib/new-spec-proj/gemspec.rb lib/new-spec-proj/specification.rb tasks tasks/announce.rake tasks/distribution.rake tasks/documentation.rake tasks/setup.rb))
12
12
 
13
13
  @before = Dir.pwd
14
14
  Dir.chdir(@working_dir)
@@ -27,7 +27,7 @@ describe Rabal::PluginTree do
27
27
  it "should allow for insertion into the Plugin Tree" do
28
28
  @tree << PluginTree.new({},resource_handle("test"),"test")
29
29
  @tree.process
30
- find_in('new-spec-proj').sort.should == (@base_tree + %w(test test/tasks test/tasks/testunit.rb test/test test/test/new_spec_proj_test.rb test/test/test_helper.rb)).sort
30
+ find_in('new-spec-proj').sort.should == (@base_tree + %w(test test/tasks test/tasks/testunit.rake test/test test/test/new_spec_proj_test.rb test/test/test_helper.rb)).sort
31
31
  end
32
32
 
33
33
  it "should allow for insertion into the Plugin Tree somewhere other than the root" do
@@ -37,7 +37,7 @@ describe Rabal::PluginTree do
37
37
  d1d2 = %w(misc misc/stuff)
38
38
 
39
39
  @tree.add_at_path("misc/stuff", PluginTree.new({},resource_handle("spec"),"subdir"))
40
- spec = %w(misc/stuff/subdir misc/stuff/subdir/spec/spec_helper.rb misc/stuff/subdir/spec/new_spec_proj_spec.rb misc/stuff/subdir/tasks/rspec.rb misc/stuff/subdir/spec misc/stuff/subdir/tasks)
40
+ spec = %w(misc/stuff/subdir misc/stuff/subdir/spec/spec_helper.rb misc/stuff/subdir/spec/new_spec_proj_spec.rb misc/stuff/subdir/tasks/rspec.rake misc/stuff/subdir/spec misc/stuff/subdir/tasks)
41
41
 
42
42
  @tree.process
43
43
  find_in('new-spec-proj').sort.should == (@base_tree + d1d2 + spec).sort
@@ -5,7 +5,7 @@ describe Rabal::Plugin::Spec do
5
5
  @working_dir = my_temp_dir
6
6
  @before = Dir.pwd
7
7
  @core = Rabal::Plugin::Core.new({:project => "new-spec-proj", :author => "Foo Bar", :email => "foobar@example.com"})
8
- @base_tree = Set.new(%w(README Rakefile CHANGES lib lib/new-spec-proj lib/new_spec_proj.rb lib/new-spec-proj/version.rb spec spec/new_spec_proj_spec.rb spec/spec_helper.rb lib/new-spec-proj/specification.rb lib/new-spec-proj/gemspec.rb tasks tasks/rspec.rb))
8
+ @base_tree = Set.new(%w(README Rakefile CHANGES lib lib/new-spec-proj lib/new_spec_proj.rb lib/new-spec-proj/version.rb spec spec/new_spec_proj_spec.rb spec/spec_helper.rb lib/new-spec-proj/specification.rb lib/new-spec-proj/gemspec.rb tasks tasks/rspec.rake tasks/announce.rake tasks/distribution.rake tasks/documentation.rake tasks/setup.rb))
9
9
  Dir.chdir(@working_dir)
10
10
  end
11
11
 
@@ -5,7 +5,7 @@ describe Rabal::Plugin::Test do
5
5
  @working_dir = my_temp_dir
6
6
  @before = Dir.pwd
7
7
  @core = Rabal::Plugin::Core.new({:project => "new-spec-proj", :author => "Foo Bar", :email => "foobar@example.com"})
8
- @base_tree = Set.new(%w(README Rakefile CHANGES lib lib/new-spec-proj lib/new_spec_proj.rb lib/new-spec-proj/version.rb test test/new_spec_proj_test.rb test/test_helper.rb lib/new-spec-proj/specification.rb lib/new-spec-proj/gemspec.rb tasks tasks/testunit.rb ))
8
+ @base_tree = Set.new(%w(README Rakefile CHANGES lib lib/new-spec-proj lib/new_spec_proj.rb lib/new-spec-proj/version.rb test test/new_spec_proj_test.rb test/test_helper.rb lib/new-spec-proj/specification.rb lib/new-spec-proj/gemspec.rb tasks tasks/testunit.rake tasks/announce.rake tasks/distribution.rake tasks/documentation.rake tasks/setup.rb ))
9
9
  Dir.chdir(@working_dir)
10
10
  end
11
11
 
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.4
3
3
  specification_version: 1
4
4
  name: rabal
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.1.0
7
- date: 2007-08-08 00:00:00 -06:00
6
+ version: 0.2.0
7
+ date: 2007-09-09 00:00:00 -06:00
8
8
  summary: A tool for bootstrapping project development
9
9
  require_paths:
10
10
  - lib
@@ -18,9 +18,9 @@ bindir: bin
18
18
  has_rdoc: true
19
19
  required_ruby_version: !ruby/object:Gem::Version::Requirement
20
20
  requirements:
21
- - - ">"
21
+ - - ">="
22
22
  - !ruby/object:Gem::Version
23
- version: 0.0.0
23
+ version: 1.8.5
24
24
  version:
25
25
  platform: ruby
26
26
  signing_key:
@@ -29,110 +29,120 @@ post_install_message:
29
29
  authors:
30
30
  - Jeremy Hinegardner
31
31
  files:
32
- - spec/plugin_tree_spec.rb
33
- - spec/core_plugin_spec.rb
32
+ - spec/action_tree_spec.rb
34
33
  - spec/application_spec.rb
35
- - spec/version_spec.rb
36
- - spec/test_plugin_spec.rb
37
34
  - spec/bin_plugin_spec.rb
35
+ - spec/core_plugin_spec.rb
38
36
  - spec/directory_tree_spec.rb
39
- - spec/action_tree_spec.rb
40
- - spec/utils_spec.rb
37
+ - spec/file_tree_spec.rb
41
38
  - spec/license_plugin_spec.rb
42
- - spec/spec_plugin_spec.rb
39
+ - spec/plugin_tree_spec.rb
40
+ - spec/project_tree_spec.rb
43
41
  - spec/spec_helper.rb
44
- - spec/file_tree_spec.rb
42
+ - spec/spec_plugin_spec.rb
43
+ - spec/test_plugin_spec.rb
45
44
  - spec/tree_spec.rb
46
- - spec/project_tree_spec.rb
45
+ - spec/utils_spec.rb
46
+ - spec/version_spec.rb
47
+ - CHANGES
48
+ - COPYING
49
+ - LICENSE
47
50
  - Rakefile
48
51
  - README
49
- - LICENSE
50
- - CHANGES
51
52
  - README.PLUGIN
52
- - COPYING
53
- - lib/rabal.rb
54
- - lib/rabal/specification.rb
55
- - lib/rabal/util.rb
53
+ - lib/rabal/action_tree.rb
54
+ - lib/rabal/application.rb
55
+ - lib/rabal/directory_tree.rb
56
+ - lib/rabal/error.rb
57
+ - lib/rabal/file_tree.rb
58
+ - lib/rabal/gemspec.rb
59
+ - lib/rabal/logger.rb
56
60
  - lib/rabal/plugin/bin.rb
57
- - lib/rabal/plugin/ext.rb
58
- - lib/rabal/plugin/license.rb
59
61
  - lib/rabal/plugin/core.rb
62
+ - lib/rabal/plugin/ext.rb
60
63
  - lib/rabal/plugin/foundation.rb
64
+ - lib/rabal/plugin/license.rb
61
65
  - lib/rabal/plugin/rubyforge.rb
62
66
  - lib/rabal/plugin/spec.rb
63
67
  - lib/rabal/plugin/test.rb
64
- - lib/rabal/directory_tree.rb
65
- - lib/rabal/gemspec.rb
66
- - lib/rabal/application.rb
67
- - lib/rabal/version.rb
68
- - lib/rabal/error.rb
68
+ - lib/rabal/plugin/website.rb
69
69
  - lib/rabal/plugin.rb
70
- - lib/rabal/file_tree.rb
71
- - lib/rabal/tree.rb
72
70
  - lib/rabal/plugin_tree.rb
73
- - lib/rabal/usage.rb
74
- - lib/rabal/logger.rb
75
71
  - lib/rabal/project_tree.rb
76
- - lib/rabal/action_tree.rb
72
+ - lib/rabal/specification.rb
73
+ - lib/rabal/tree.rb
74
+ - lib/rabal/usage.rb
75
+ - lib/rabal/util.rb
76
+ - lib/rabal/version.rb
77
+ - lib/rabal.rb
77
78
  - resources/trees
79
+ - resources/trees/bin
80
+ - resources/trees/bin/rabal.project
81
+ - resources/trees/core
82
+ - resources/trees/core/CHANGES.erb
83
+ - resources/trees/core/lib
84
+ - resources/trees/core/lib/rabal.project
85
+ - resources/trees/core/lib/rabal.project/gemspec.rb.erb
86
+ - resources/trees/core/lib/rabal.project/specification.rb.erb
87
+ - resources/trees/core/lib/rabal.project/version.rb.erb
88
+ - resources/trees/core/lib/rabal.project.rb.erb
89
+ - resources/trees/core/Rakefile.erb
90
+ - resources/trees/core/README.erb
91
+ - resources/trees/core/tasks
92
+ - resources/trees/core/tasks/announce.rake.erb
93
+ - resources/trees/core/tasks/distribution.rake.erb
94
+ - resources/trees/core/tasks/documentation.rake.erb
95
+ - resources/trees/core/tasks/setup.rb.erb
78
96
  - resources/trees/ext
79
97
  - resources/trees/ext/ext
80
98
  - resources/trees/ext/ext/rabal.project
81
99
  - resources/trees/ext/ext/rabal.project/ext
82
100
  - resources/trees/ext/ext/rabal.project/ext/mkrf_conf.rb.erb
83
101
  - resources/trees/ext/tasks
84
- - resources/trees/ext/tasks/extension.rb.erb
102
+ - resources/trees/ext/tasks/extension.rake.erb
103
+ - resources/trees/license
104
+ - resources/trees/license/COPYING.gpl
105
+ - resources/trees/license/COPYING.lgpl
106
+ - resources/trees/license/COPYING.ruby
107
+ - resources/trees/license/LICENSE.bsd
108
+ - resources/trees/license/LICENSE.mit
109
+ - resources/trees/license/LICENSE.ruby
110
+ - resources/trees/rubyforge
111
+ - resources/trees/rubyforge/tasks
112
+ - resources/trees/rubyforge/tasks/rubyforge.rake.erb
85
113
  - resources/trees/spec
86
114
  - resources/trees/spec/spec
87
- - resources/trees/spec/spec/spec_helper.rb.erb
88
115
  - resources/trees/spec/spec/rabal.project_spec.rb.erb
116
+ - resources/trees/spec/spec/spec_helper.rb.erb
89
117
  - resources/trees/spec/tasks
90
- - resources/trees/spec/tasks/rspec.rb.erb
118
+ - resources/trees/spec/tasks/rspec.rake.erb
91
119
  - resources/trees/test
120
+ - resources/trees/test/tasks
121
+ - resources/trees/test/tasks/testunit.rake.erb
92
122
  - resources/trees/test/test
93
123
  - resources/trees/test/test/rabal.project_test.rb.erb
94
124
  - resources/trees/test/test/test_helper.rb.erb
95
- - resources/trees/test/tasks
96
- - resources/trees/test/tasks/testunit.rb.erb
97
- - resources/trees/license
98
- - resources/trees/license/LICENSE.ruby
99
- - resources/trees/license/COPYING.ruby
100
- - resources/trees/license/LICENSE.mit
101
- - resources/trees/license/LICENSE.bsd
102
- - resources/trees/license/COPYING.gpl
103
- - resources/trees/license/COPYING.lgpl
104
- - resources/trees/core
105
- - resources/trees/core/Rakefile.erb
106
- - resources/trees/core/README.erb
107
- - resources/trees/core/CHANGES.erb
108
- - resources/trees/core/lib
109
- - resources/trees/core/lib/rabal.project
110
- - resources/trees/core/lib/rabal.project/version.rb.erb
111
- - resources/trees/core/lib/rabal.project/specification.rb.erb
112
- - resources/trees/core/lib/rabal.project/gemspec.rb.erb
113
- - resources/trees/core/lib/rabal.project.rb.erb
114
- - resources/trees/bin
115
- - resources/trees/bin/rabal.project
116
- - resources/trees/rubyforge
117
- - resources/trees/rubyforge/tasks
118
- - resources/trees/rubyforge/tasks/rubyforge.rb.erb
125
+ - resources/trees/website
126
+ - resources/trees/website/tasks
127
+ - resources/trees/website/tasks/site.rake.erb
128
+ - resources/trees/website/website
119
129
  - bin/rabal
120
130
  test_files:
121
- - spec/plugin_tree_spec.rb
122
- - spec/core_plugin_spec.rb
131
+ - spec/action_tree_spec.rb
123
132
  - spec/application_spec.rb
124
- - spec/version_spec.rb
125
- - spec/test_plugin_spec.rb
126
133
  - spec/bin_plugin_spec.rb
134
+ - spec/core_plugin_spec.rb
127
135
  - spec/directory_tree_spec.rb
128
- - spec/action_tree_spec.rb
129
- - spec/utils_spec.rb
136
+ - spec/file_tree_spec.rb
130
137
  - spec/license_plugin_spec.rb
131
- - spec/spec_plugin_spec.rb
138
+ - spec/plugin_tree_spec.rb
139
+ - spec/project_tree_spec.rb
132
140
  - spec/spec_helper.rb
133
- - spec/file_tree_spec.rb
141
+ - spec/spec_plugin_spec.rb
142
+ - spec/test_plugin_spec.rb
134
143
  - spec/tree_spec.rb
135
- - spec/project_tree_spec.rb
144
+ - spec/utils_spec.rb
145
+ - spec/version_spec.rb
136
146
  rdoc_options:
137
147
  - --line-numbers
138
148
  - --inline-source
@@ -141,12 +151,12 @@ rdoc_options:
141
151
  - --title
142
152
  - "'rabal -- A tool for bootstrapping project development'"
143
153
  extra_rdoc_files:
154
+ - CHANGES
155
+ - COPYING
156
+ - LICENSE
144
157
  - Rakefile
145
158
  - README
146
- - LICENSE
147
- - CHANGES
148
159
  - README.PLUGIN
149
- - COPYING
150
160
  executables:
151
161
  - rabal
152
162
  extensions: []
@@ -1,105 +0,0 @@
1
- require 'rubyforge'
2
-
3
- #-----------------------------------------------------------------------
4
- # Documentation - pushing documentation to rubyforge
5
- #-----------------------------------------------------------------------
6
- namespace :doc do
7
- desc "Deploy the RDoc documentation to rubyforge"
8
- task :deploy => :rerdoc do
9
- sh "rsync -zav --delete #{<%= project_name.camelize %>::SPEC.local_rdoc_dir}/ #{<%= project_name.camelize %>::SPEC.rubyforge_rdoc_dest}"
10
- end
11
- end
12
-
13
- #-----------------------------------------------------------------------
14
- # Packaging and Distribution - push to rubyforge
15
- #-----------------------------------------------------------------------
16
- namespace :dist do
17
- desc "Release files to rubyforge"
18
- task :release => [:clean, :package] do
19
-
20
- rubyforge = RubyForge.new
21
-
22
- # make sure this release doesn't already exist
23
- releases = rubyforge.autoconfig['release_ids']
24
- if releases.has_key?(<%= project_name.camelize %>::SPEC.name) and releases[<%= project_name.camelize %>::SPEC.name][<%= project_name.camelize %>::VERSION] then
25
- abort("Release #{<%= project_name.camelize %>::VERSION} already exists! Unable to release.")
26
- end
27
-
28
- config = rubyforge.userconfig
29
- config["release_notes"] = <%= project_name.camelize %>::SPEC.description
30
- config["release_changes"] = last_changeset
31
- config["Prefomatted"] = true
32
-
33
-
34
- puts "Uploading to rubyforge..."
35
- files = FileList[File.join("pkg","#{<%= project_name.camelize %>::SPEC.name}-#{<%= project_name.camelize %>::VERSION}.*")].to_a
36
- rubyforge.login
37
- rubyforge.add_release(<%= project_name.camelize %>::SPEC.rubyforge_project, <%= project_name.camelize %>::SPEC.name, <%= project_name.camelize %>::VERSION, *files)
38
- puts "done."
39
- end
40
- end
41
-
42
- #-----------------------------------------------------------------------
43
- # Announcements - Create an email text file, and post news to rubyforge
44
- #-----------------------------------------------------------------------
45
- def changes
46
- change_file = File.expand_path(File.join(File.basename(__FILE__),"..","CHANGES"))
47
- sections = File.read(change_file).split(/^(?===)/)
48
- end
49
- def last_changeset
50
- changes[1]
51
- end
52
-
53
- def announcement
54
- urls = " #{<%= project_name.camelize %>::SPEC.homepage}"
55
- subject = "#{<%= project_name.camelize %>::SPEC.name} #{<%= project_name.camelize %>::VERSION} Released"
56
- title = "#{<%= project_name.camelize %>::SPEC.name} version #{<%= project_name.camelize %>::VERSION} has been released."
57
- body = <<BODY
58
- #{<%= project_name.camelize %>::SPEC.description.rstrip}
59
-
60
- {{ Changelog for Version #{<%= project_name.camelize %>::VERSION} }}
61
-
62
- #{last_changeset.rstrip}
63
-
64
- BODY
65
-
66
- return subject, title, body, urls
67
- end
68
-
69
- namespace :announce do
70
- desc "create email for ruby-talk"
71
- task :email do
72
- subject, title, body, urls = announcement
73
-
74
- File.open("email.txt", "w") do |mail|
75
- mail.puts "From: #{<%= project_name.camelize %>::SPEC.author} <#{<%= project_name.camelize %>::SPEC.email}>"
76
- mail.puts "To: ruby-talk@ruby-lang.org"
77
- mail.puts "Date: #{Time.now.rfc2822}"
78
- mail.puts "Subject: [ANN] #{subject}"
79
- mail.puts
80
- mail.puts title
81
- mail.puts
82
- mail.puts urls
83
- mail.puts
84
- mail.puts body
85
- mail.puts
86
- mail.puts urls
87
- end
88
- puts "Created the following as email.txt:"
89
- puts "-" * 72
90
- puts File.read("email.txt")
91
- puts "-" * 72
92
- end
93
-
94
- CLOBBER << "email.txt"
95
-
96
- desc "Post news of #{<%= project_name.camelize %>::SPEC.name} to #{<%= project_name.camelize %>::SPEC.rubyforge_project} on rubyforge"
97
- task :post_news do
98
- subject, title, body, urls = announcement
99
- rubyforge = RubyForge.new
100
- rubyforge.login
101
- rubyforge.post_news(<%= project_name.camelize %>::SPEC.rubyforge_project, subject, "#{title}\n\n#{urls}\n\n#{body}")
102
- puts "Posted to rubyforge"
103
- end
104
-
105
- end