darkfish-rdoc 1.1.1 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. data/ChangeLog +52 -0
  2. data/README +14 -8
  3. data/Rakefile +18 -4
  4. data/lib/darkfish-rdoc.rb +1 -1
  5. data/lib/rdoc/generator/darkfish.rb +23 -6
  6. data/lib/rdoc/generator/template/darkfish/classpage.rhtml +276 -0
  7. data/lib/rdoc/generator/template/darkfish/filepage.rhtml +52 -0
  8. data/lib/rdoc/generator/template/darkfish/images/brick.png +0 -0
  9. data/lib/rdoc/generator/template/darkfish/images/brick_link.png +0 -0
  10. data/lib/rdoc/generator/template/darkfish/images/bullet_black.png +0 -0
  11. data/lib/rdoc/generator/template/darkfish/images/date.png +0 -0
  12. data/lib/rdoc/generator/template/darkfish/images/macFFBgHack.png +0 -0
  13. data/lib/rdoc/generator/template/darkfish/images/package.png +0 -0
  14. data/lib/rdoc/generator/template/darkfish/images/page_green.png +0 -0
  15. data/lib/rdoc/generator/template/darkfish/images/page_white_width.png +0 -0
  16. data/lib/rdoc/generator/template/darkfish/images/plugin.png +0 -0
  17. data/lib/rdoc/generator/template/darkfish/images/ruby.png +0 -0
  18. data/lib/rdoc/generator/template/darkfish/images/tag_green.png +0 -0
  19. data/lib/rdoc/generator/template/darkfish/images/wrench.png +0 -0
  20. data/lib/rdoc/generator/template/darkfish/images/wrench_orange.png +0 -0
  21. data/lib/rdoc/generator/template/darkfish/images/zoom.png +0 -0
  22. data/lib/rdoc/generator/template/darkfish/index.rhtml +48 -0
  23. data/lib/rdoc/generator/template/darkfish/js/darkfish.js +80 -0
  24. data/lib/rdoc/generator/template/darkfish/js/jquery.js +32 -0
  25. data/lib/rdoc/generator/template/darkfish/js/quicksearch.js +113 -0
  26. data/lib/rdoc/generator/template/darkfish/js/thickbox-compressed.js +10 -0
  27. data/lib/rdoc/generator/template/darkfish/rdoc.css +658 -0
  28. data/rake/helpers.rb +33 -1
  29. data/rake/publishing.rb +38 -36
  30. data/rake/rdoc.rb +2 -2
  31. data/rake/svn.rb +26 -6
  32. data/spec/rdoc/generator/darkfish_spec.rb +54 -0
  33. metadata +29 -6
@@ -108,7 +108,7 @@ def download( sourceuri, targetfile=nil )
108
108
  log "Downloading %s to %s" % [sourceuri, targetfile]
109
109
  targetpath.open( File::WRONLY|File::TRUNC|File::CREAT, 0644 ) do |ofh|
110
110
 
111
- url = URI.parse( sourceuri )
111
+ url = sourceuri.is_a?( URI ) ? sourceuri : URI.parse( sourceuri )
112
112
  downloaded = false
113
113
  limit = 5
114
114
 
@@ -279,6 +279,38 @@ def prompt_for_multiple_values( label, default=nil )
279
279
  end
280
280
 
281
281
 
282
+ ### Turn echo and masking of input on/off. Based on similar code in
283
+ ### Ruby-Password by Ian Macdonald <ian@caliban.org>.
284
+ def noecho( masked=false )
285
+ require 'termios'
286
+
287
+ rval = nil
288
+ term = Termios.getattr( $stdin )
289
+
290
+ begin
291
+ term.c_lflag &= ~Termios::ECHO
292
+ term.c_lflag &= ~Termios::ICANON if masked
293
+
294
+ rval = yield
295
+ ensure
296
+ term.c_lflag |= ( Termios::ECHO | Termios::ICANON )
297
+ Termios.setattr( $stdin, Termios::TCSANOW, term )
298
+ end
299
+
300
+ return rval
301
+ end
302
+
303
+
304
+ ### Prompt the user for her password, turning off echo if the 'termios' module is
305
+ ### available.
306
+ def prompt_for_password( prompt="Password: " )
307
+ return noecho( true ) do
308
+ $stderr.print( prompt )
309
+ ($stdin.gets || '').chomp
310
+ end
311
+ end
312
+
313
+
282
314
  ### Display a description of a potentially-dangerous task, and prompt
283
315
  ### for confirmation. If the user answers with anything that begins
284
316
  ### with 'y', yield to the block, else raise with an error.
@@ -101,14 +101,15 @@ begin
101
101
 
102
102
  namespace :release do
103
103
  task :default => [ 'svn:release', :publish, :announce, :project ]
104
+
105
+ desc "Re-publish the release with the current version number"
106
+ task :rerelease => [ :publish, :announce, :project ]
107
+
104
108
  task :test do
105
109
  $publish_privately = true
106
110
  end
107
- task :test => [ 'svn:release', :publish, :announce, :project ]
111
+ task :test => [ :rerelease ]
108
112
 
109
- desc "Re-publish the release with the current version number"
110
- task :rerelease => [ :publish, :announce, :project ]
111
-
112
113
 
113
114
  desc "Generate the release notes"
114
115
  task :notes => [RELEASE_NOTES_FILE]
@@ -126,18 +127,19 @@ begin
126
127
 
127
128
  edit task.name
128
129
  end
130
+ CLEAN.include( RELEASE_NOTES_FILE )
129
131
 
130
132
 
131
133
  task :project => [ :rdoc ] do
132
- when_writing( "Publishing docs to #{PROJECT_SCPURL}" ) do
133
- run 'ssh', PROJECT_HOST, "rm -rf #{PROJECT_DOCDIR}"
134
- run 'scp', '-qCr', 'docs', PROJECT_SCPURL
134
+ when_writing( "Publishing docs to #{PROJECT_SCPDOCURL}" ) do
135
+ run 'ssh', PROJECT_HOST, "rm -rf #{PROJECT_SCPDOCURL}"
136
+ run 'scp', '-qCr', 'docs', PROJECT_SCPDOCURL
135
137
  end
136
138
  when_writing( "Uploading packages") do
137
139
  pkgs = Pathname.glob( PKGDIR + "#{PKG_FILE_NAME}.{gem,tar.gz,tar.bz2,zip}" )
138
- log "Uploading %d packages to #{PROJECT_PUBURL}" % [ pkgs.length ]
140
+ log "Uploading %d packages to #{PROJECT_SCPPUBURL}" % [ pkgs.length ]
139
141
  pkgs.each do |pkgfile|
140
- run 'scp', '-qC', pkgfile, PROJECT_PUBURL
142
+ run 'scp', '-qC', pkgfile, PROJECT_SCPPUBURL
141
143
  end
142
144
  end
143
145
  end
@@ -178,6 +180,7 @@ begin
178
180
 
179
181
  edit task.name
180
182
  end
183
+ CLEAN.include( RELEASE_ANNOUNCE_FILE )
181
184
 
182
185
 
183
186
  desc 'Send out a release announcement'
@@ -249,33 +252,32 @@ begin
249
252
  # Make sure this release doesn't already exist
250
253
  releases = rf.autoconfig['release_ids']
251
254
  if releases.key?( GEMSPEC.name ) && releases[ GEMSPEC.name ].key?( PKG_VERSION )
252
- fail "Rubyforge seems to already have #{ PKG_FILE_NAME }"
253
- end
254
-
255
- config = rf.userconfig or
256
- fail "You apparently haven't set up your RubyForge credentials on this machine."
257
- config['release_notes'] = GEMSPEC.description
258
- config['release_changes'] = File.read( RELEASE_NOTES_FILE )
259
- config['preformatted'] = true
260
-
261
- files = FileList[ PKGDIR + GEM_FILE_NAME ]
262
- files.include PKGDIR + "#{PKG_FILE_NAME}.tar.gz"
263
- files.include PKGDIR + "#{PKG_FILE_NAME}.tar.bz2"
264
- files.include PKGDIR + "#{PKG_FILE_NAME}.zip"
265
-
266
- log "Releasing #{PKG_FILE_NAME}"
267
- when_writing do
268
- log "Publishing to RubyForge: \n",
269
- "\tproject: #{RUBYFORGE_GROUP}\n",
270
- "\tpackage: #{PKG_NAME.downcase}\n",
271
- "\tpackage version: #{PKG_VERSION}\n",
272
- "\tfiles: " + files.collect {|f| f.to_s }.join(', ') + "\n"
273
-
274
- ask_for_confirmation( "Publish to RubyForge?" ) do
275
- log 'Logging in...'
276
- rf.login
277
- log "Adding the new release to the '#{project}' project"
278
- rf.add_release( group_id, package_id, PKG_VERSION, *files )
255
+ log "Rubyforge seems to already have #{ PKG_FILE_NAME }"
256
+ else
257
+ config = rf.userconfig or
258
+ fail "You apparently haven't set up your RubyForge credentials on this machine."
259
+ config['release_notes'] = GEMSPEC.description
260
+ config['release_changes'] = File.read( RELEASE_NOTES_FILE )
261
+
262
+ files = FileList[ PKGDIR + GEM_FILE_NAME ]
263
+ files.include PKGDIR + "#{PKG_FILE_NAME}.tar.gz"
264
+ files.include PKGDIR + "#{PKG_FILE_NAME}.tar.bz2"
265
+ files.include PKGDIR + "#{PKG_FILE_NAME}.zip"
266
+
267
+ log "Releasing #{PKG_FILE_NAME}"
268
+ when_writing do
269
+ log "Publishing to RubyForge: \n",
270
+ "\tproject: #{RUBYFORGE_GROUP}\n",
271
+ "\tpackage: #{PKG_NAME.downcase}\n",
272
+ "\tpackage version: #{PKG_VERSION}\n",
273
+ "\tfiles: " + files.collect {|f| f.to_s }.join(', ') + "\n"
274
+
275
+ ask_for_confirmation( "Publish to RubyForge?" ) do
276
+ log 'Logging in...'
277
+ rf.login
278
+ log "Adding the new release to the '#{project}' project"
279
+ rf.add_release( group_id, package_id, PKG_VERSION, *files )
280
+ end
279
281
  end
280
282
  end
281
283
  end
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # RDoc Rake tasks for ThingFish
3
- # $Id: rdoc.rb 20 2008-08-07 15:50:54Z deveiant $
3
+ # $Id: rdoc.rb 28 2008-08-13 04:50:05Z deveiant $
4
4
  #
5
5
 
6
6
  require 'rake/rdoctask'
@@ -21,7 +21,7 @@ rescue LoadError => err
21
21
  end
22
22
 
23
23
  Rake::RDocTask.new do |rdoc|
24
- rdoc.rdoc_dir = 'docs'
24
+ rdoc.rdoc_dir = 'docs/html'
25
25
  rdoc.title = "#{PKG_NAME} - #{PKG_SUMMARY}"
26
26
  rdoc.options += RDOC_OPTIONS + [ '-f', 'darkfish' ] if $have_darkfish
27
27
 
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # Subversion Rake Tasks
3
- # $Id: svn.rb 22 2008-08-08 01:30:06Z deveiant $
3
+ # $Id: svn.rb 30 2008-08-13 23:31:25Z deveiant $
4
4
  #
5
5
  # Authors:
6
6
  # * Michael Granger <ged@FaerieMUD.org>
@@ -253,7 +253,13 @@ def make_svn_changelog( dir='.' )
253
253
  end
254
254
 
255
255
  date = Time.parse( entry.find_first('date').content )
256
- author = entry.find_first( 'author' ).content
256
+
257
+ # cvs2svn doesn't set 'author'
258
+ author = 'unknown'
259
+ if entry.find_first( 'author' )
260
+ author = entry.find_first( 'author' ).content
261
+ end
262
+
257
263
  msg = entry.find_first( 'msg' ).content
258
264
  rev = entry['revision']
259
265
 
@@ -313,11 +319,25 @@ namespace :svn do
313
319
  task :release do
314
320
  last_tag = get_latest_svn_timestamp_tag()
315
321
  svninfo = get_svn_info()
316
- svntrunk = svninfo['Repository Root'] + "/#{SVN_TRUNK_DIR}"
317
- svnrel = svninfo['Repository Root'] + "/#{SVN_RELEASES_DIR}"
322
+ svnroot = svninfo['Repository Root']
323
+ svntrunk = svnroot + "/#{SVN_TRUNK_DIR}"
324
+ svnrel = svnroot + "/#{SVN_RELEASES_DIR}"
318
325
  release = PKG_VERSION
319
326
  svnrelease = svnrel + '/' + release
320
327
 
328
+ topdirs = svn_ls( svnroot ).collect {|dir| dir.chomp('/') }
329
+ unless topdirs.include?( SVN_RELEASES_DIR )
330
+ trace "Top directories (%p) does not include %p" %
331
+ [ topdirs, SVN_RELEASES_DIR ]
332
+ log "Releases path #{svnrel} does not exist."
333
+ ask_for_confirmation( "To continue I'll need to create it." ) do
334
+ run 'svn', 'mkdir', svnrel, '-m', 'Creating releases/ directory'
335
+ end
336
+ else
337
+ trace "Found release dir #{SVN_RELEASES_DIR} in the top directories %p" %
338
+ [ topdirs ]
339
+ end
340
+
321
341
  releases = svn_ls( svnrel ).collect {|name| name.sub(%r{/$}, '') }
322
342
  trace "Releases: %p" % [releases]
323
343
  if releases.include?( release )
@@ -372,7 +392,7 @@ namespace :svn do
372
392
 
373
393
 
374
394
  desc "Check in all the changes in your current working copy"
375
- task :checkin => ['svn:update', 'coverage:verify', 'svn:fix_keywords', COMMIT_MSG_FILE] do
395
+ task :checkin => ['svn:update', 'test', 'svn:fix_keywords', COMMIT_MSG_FILE] do
376
396
  targets = get_target_args()
377
397
  $deferr.puts '---', File.read( COMMIT_MSG_FILE ), '---'
378
398
  ask_for_confirmation( "Continue with checkin?" ) do
@@ -382,7 +402,7 @@ namespace :svn do
382
402
  end
383
403
  task :commit => :checkin
384
404
  task :ci => :checkin
385
-
405
+
386
406
 
387
407
  task :clean do
388
408
  rm_f COMMIT_MSG_FILE
@@ -0,0 +1,54 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ BEGIN {
4
+ require 'pathname'
5
+ basedir = Pathname.new( __FILE__ ).dirname.parent.parent.parent
6
+
7
+ libdir = basedir + "lib"
8
+
9
+ $LOAD_PATH.unshift( libdir ) unless $LOAD_PATH.include?( libdir )
10
+ }
11
+
12
+ begin
13
+ require 'spec/runner'
14
+ require 'rdoc/generator/darkfish'
15
+ rescue LoadError
16
+ unless Object.const_defined?( :Gem )
17
+ require 'rubygems'
18
+ retry
19
+ end
20
+ raise
21
+ end
22
+
23
+
24
+ describe RDoc::Generator::Darkfish do
25
+
26
+ it "can create an instance via the generator factory method" do
27
+ RDoc::Generator::Darkfish.for( 'darkfish' ).
28
+ should be_an_instance_of( RDoc::Generator::Darkfish )
29
+ end
30
+
31
+
32
+ describe "an instance" do
33
+
34
+ before( :each ) do
35
+ @generator = RDoc::Generator::Darkfish.for( 'darkfish' )
36
+ end
37
+
38
+
39
+ it "generates the required subdirectories" do
40
+ @generator.outputdir.should_receive( :mkpath )
41
+ @generator.gen_sub_directories
42
+ end
43
+
44
+
45
+ it "copies static files over during #write_style_sheet" do
46
+ FileUtils.should_receive( :cp_r ).
47
+ with( an_instance_of(Pathname), '.', :verbose => $DEBUG ).
48
+ exactly( 3 ).times
49
+ @generator.write_style_sheet
50
+ end
51
+
52
+ end
53
+ end
54
+
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: darkfish-rdoc
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Granger
@@ -9,18 +9,18 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-08-07 00:00:00 -07:00
12
+ date: 2008-08-13 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
- name: "rdoc: >= 2.1.0"
16
+ name: rdoc
17
17
  type: :runtime
18
18
  version_requirement:
19
19
  version_requirements: !ruby/object:Gem::Requirement
20
20
  requirements:
21
21
  - - ">="
22
22
  - !ruby/object:Gem::Version
23
- version: "0"
23
+ version: 2.1.0
24
24
  version:
25
25
  description: A complete replacement for the default HTML generator for Rdoc, the API documentation-extraction system for Ruby.
26
26
  email: ged@FaerieMUD.org
@@ -35,6 +35,7 @@ files:
35
35
  - ChangeLog
36
36
  - README
37
37
  - LICENSE
38
+ - spec/rdoc/generator/darkfish_spec.rb
38
39
  - lib/darkfish-rdoc.rb
39
40
  - lib/rdoc/generator/darkfish.rb
40
41
  - rake/dependencies.rb
@@ -47,6 +48,28 @@ files:
47
48
  - rake/svn.rb
48
49
  - rake/testing.rb
49
50
  - rake/verifytask.rb
51
+ - lib/rdoc/generator/template/darkfish/rdoc.css
52
+ - lib/rdoc/generator/template/darkfish/classpage.rhtml
53
+ - lib/rdoc/generator/template/darkfish/filepage.rhtml
54
+ - lib/rdoc/generator/template/darkfish/index.rhtml
55
+ - lib/rdoc/generator/template/darkfish/images/brick.png
56
+ - lib/rdoc/generator/template/darkfish/images/brick_link.png
57
+ - lib/rdoc/generator/template/darkfish/images/bullet_black.png
58
+ - lib/rdoc/generator/template/darkfish/images/date.png
59
+ - lib/rdoc/generator/template/darkfish/images/macFFBgHack.png
60
+ - lib/rdoc/generator/template/darkfish/images/package.png
61
+ - lib/rdoc/generator/template/darkfish/images/page_green.png
62
+ - lib/rdoc/generator/template/darkfish/images/page_white_width.png
63
+ - lib/rdoc/generator/template/darkfish/images/plugin.png
64
+ - lib/rdoc/generator/template/darkfish/images/ruby.png
65
+ - lib/rdoc/generator/template/darkfish/images/tag_green.png
66
+ - lib/rdoc/generator/template/darkfish/images/wrench.png
67
+ - lib/rdoc/generator/template/darkfish/images/wrench_orange.png
68
+ - lib/rdoc/generator/template/darkfish/images/zoom.png
69
+ - lib/rdoc/generator/template/darkfish/js/darkfish.js
70
+ - lib/rdoc/generator/template/darkfish/js/jquery.js
71
+ - lib/rdoc/generator/template/darkfish/js/quicksearch.js
72
+ - lib/rdoc/generator/template/darkfish/js/thickbox-compressed.js
50
73
  - Rakefile.local
51
74
  has_rdoc: true
52
75
  homepage: http://deveiate.org/projects/Darkfish-Rdoc/
@@ -82,5 +105,5 @@ rubygems_version: 1.2.0
82
105
  signing_key:
83
106
  specification_version: 2
84
107
  summary: A pretty (different) Rdoc HTML generator
85
- test_files: []
86
-
108
+ test_files:
109
+ - spec/rdoc/generator/darkfish_spec.rb