hoe-manns 1.0.0

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.
Files changed (67) hide show
  1. checksums.yaml +7 -0
  2. checksums.yaml.gz.sig +0 -0
  3. data/.autotest +25 -0
  4. data/.gemnasium.yml +5 -0
  5. data/.idea/hoe-manns.iml +91 -0
  6. data/.idea/misc.xml +14 -0
  7. data/.idea/modules.xml +8 -0
  8. data/.idea/vcs.xml +6 -0
  9. data/.idea/workspace.xml +795 -0
  10. data/.index +173 -0
  11. data/.rspec +2 -0
  12. data/.rubocop.yml +39 -0
  13. data/.scrutinizer.yml +17 -0
  14. data/.travis.yml +28 -0
  15. data/CODE_OF_CONDUCT.md +17 -0
  16. data/CONTRIBUTING.md +33 -0
  17. data/Gemfile +37 -0
  18. data/Gemfile.lock +186 -0
  19. data/History.rdoc +7 -0
  20. data/LICENSE.rdoc +24 -0
  21. data/Manifest.txt +62 -0
  22. data/README.rdoc +114 -0
  23. data/Rakefile +104 -0
  24. data/VERSION +1 -0
  25. data/config.reek +111 -0
  26. data/etc/hoe-manns.cfg +1 -0
  27. data/lib/hoe/manns.rb +128 -0
  28. data/manual/layouts/default.erb +87 -0
  29. data/manual/lib/api-filter.rb +96 -0
  30. data/manual/lib/editorial-filter.rb +59 -0
  31. data/manual/lib/examples-filter.rb +230 -0
  32. data/manual/lib/links-filter.rb +111 -0
  33. data/manual/resources/css/manual.css +764 -0
  34. data/manual/resources/css/reset.css +112 -0
  35. data/manual/resources/fonts/GraublauWeb.otf +0 -0
  36. data/manual/resources/fonts/GraublauWebBold.otf +0 -0
  37. data/manual/resources/fonts/Inconsolata.otf +0 -0
  38. data/manual/resources/images/arrow_225_small.png +0 -0
  39. data/manual/resources/images/arrow_315_small.png +0 -0
  40. data/manual/resources/images/arrow_skip.png +0 -0
  41. data/manual/resources/images/cc-by.png +0 -0
  42. data/manual/resources/images/dialog-error.png +0 -0
  43. data/manual/resources/images/dialog-information.png +0 -0
  44. data/manual/resources/images/dialog-warning.png +0 -0
  45. data/manual/resources/images/emblem-important.png +0 -0
  46. data/manual/resources/images/help.png +0 -0
  47. data/manual/resources/images/information.png +0 -0
  48. data/manual/resources/images/magnifier.png +0 -0
  49. data/manual/resources/images/magnifier_left.png +0 -0
  50. data/manual/resources/images/page_white_code.png +0 -0
  51. data/manual/resources/images/page_white_copy.png +0 -0
  52. data/manual/resources/images/printer.png +0 -0
  53. data/manual/resources/images/question.png +0 -0
  54. data/manual/resources/images/scripts_code.png +0 -0
  55. data/manual/resources/images/wrap.png +0 -0
  56. data/manual/resources/images/wrapping.png +0 -0
  57. data/manual/resources/js/jquery-1.4.4.min.js +167 -0
  58. data/manual/resources/js/manual.js +30 -0
  59. data/manual/resources/js/sh.js +580 -0
  60. data/manual/resources/swf/clipboard.swf +0 -0
  61. data/manual/src/apidocs.page +17 -0
  62. data/manual/src/index.page +70 -0
  63. data/test/manns_spec.rb +54 -0
  64. data/test/spec_helper.rb +16 -0
  65. data.tar.gz.sig +0 -0
  66. metadata +542 -0
  67. metadata.gz.sig +0 -0
data/README.rdoc ADDED
@@ -0,0 +1,114 @@
1
+ = hoe-manns
2
+
3
+ home :: http://saigkill.github.io
4
+ code :: http://github.com/saigkill/hoe-manns
5
+ rdoc :: http://www.rubydoc.info/gems/hoe-manns
6
+ docu :: http://saigkill.github.io/docs/hoemanns/index.html
7
+ bugs :: http://saigkill-bugs.myjetbrains.com/youtrack/issues
8
+ last public version :: {<img src="https://badge.fury.io/rb/hoe-manns.png" alt="Last Version" />}[http://rubygems.org/gems/hoe-manns]
9
+ downloads latest :: {<img src="https://img.shields.io/gem/dtv/hoe-manns.svg" alt="Downloads latest version" />}[http://rubygems.org/gems/hoe-manns]
10
+ downloads all :: {<img src="https://img.shields.io/gem/dt/hoe-manns.svg" alt="Downloads all versions" />}[http://rubygems.org/gems/hoe-manns]
11
+ continuous integration :: {<img src="https://secure.travis-ci.org/saigkill/hoe-manns.png?branch=master" alt="Build Status" />}[https://secure.travis-ci.org/saigkill/hoe-manns]
12
+ continuous integration :: {<img src="https://scrutinizer-ci.com/g/saigkill/hoe-manns/badges/build.png?b=master" alt="Build Status" />}[https://scrutinizer-ci.com/g/saigkill/hoe-manns/build-status/master]
13
+ continuous integration :: {<img src="http://saigkill.ddns.net:8111/app/rest/builds/buildType:(id:hoe-manns_Build)/statusIcon" alt="Build Status" />}[http://saigkill.ddns.net:8111/viewType.html?buildTypeId=hoe-manns_Build&guest=1]
14
+ test coverage :: {<img src="https://coveralls.io/repos/saigkill/hoe-manns/badge.png?branch=master" alt="Test Coverage" />}[https://coveralls.io/r/saigkill/hoe-manns?branch=master]
15
+ code quality :: {<img src="https://codeclimate.com/github/saigkill/hoe-manns.png" alt="Code Quality" />}[https://codeclimate.com/github/saigkill/hoe-manns]
16
+ code quality :: {<img src="https://scrutinizer-ci.com/g/saigkill/hoe-manns/badges/quality-score.png?b=master" alt="Code Quality" />}[https://scrutinizer-ci.com/g/saigkill/hoe-manns/?branch=master]
17
+ dependency check :: {<img src="https://gemnasium.com/saigkill/hoe-manns.png" alt="Dependency Check" />}[https://gemnasium.com/saigkill/hoe-manns]
18
+ still maintained? :: {<img src="http://stillmaintained.com/saigkill/hoe-manns.png" alt="Still maintained?" />}[http://stillmaintained.com/saigkill/hoe-manns]
19
+ documentation quality :: {<img src="http://inch-ci.org/github/saigkill/hoe-manns.svg?branch=master" alt="Documentation Quality" />}[http://inch-ci.org/github/saigkill/hoe-manns]
20
+ donations :: {<img src="https://pledgie.com/campaigns/30268.png?skin_name=chrome" alt="Donations" />}[https://pledgie.com/campaigns/FIX]
21
+ donations :: {<img src="http://img.shields.io/gratipay/saigkill.svg" alt="Donations" />}[https://gratipay.com/~saigkill/]
22
+ donations :: {<img src="http://tsv-neuss.de/cms/upload/News-Bilder/amazon1.png" alt="Donations" />}[http://www.amazon.de/registry/wishlist/D75HOEQ00BDD]
23
+
24
+
25
+ == DESCRIPTION:
26
+
27
+ hoe-manns is a small collection of my personal used rake tasks for using with hoe. Actually it includes that tasks:
28
+
29
+ * update_gemfile_lock
30
+ * remove_pre_gemspec
31
+ * update_workspace
32
+ * update_index
33
+ * copy_manuals
34
+ * run_before_release
35
+ * run_after_release
36
+ * clean_pkg
37
+
38
+ == FEATURES/PROBLEMS:
39
+
40
+ * Updates the Gemfile.lock
41
+ * Removes the old *.gemspec created in test cases
42
+ * It adds .idea/ to git, does a commit for all stacked changes and pushs it before rake release
43
+ * Does a index --using VERSION Index.yml if you use the indexer from Rubyworks
44
+ * copies your manuals to your docpath.
45
+ * runs the rake tasks before release: git:manifest, bundler:gemfile, update_gemfile_lock, update_index,
46
+ remove_pre_gemspec and update_workspace
47
+ * runs after release: send_email version:bump
48
+ * Cleans up the pkg dir
49
+
50
+ For a detailed information please visit: http://saigkill.github.io/docs/hoemanns/index.html
51
+ If you like this piece of software don't forget to give the github repo a star.
52
+
53
+ == SYNOPSIS:
54
+
55
+ Use in your Rakefile:
56
+
57
+ Hoe.plugin :manns
58
+
59
+ Hoe.spec 'yourproject' do
60
+ ...
61
+ end
62
+
63
+ Also add hoe-manns to your requirements and recreate your Gemfile.
64
+
65
+ == REQUIREMENTS:
66
+
67
+ * rake
68
+ * hoe
69
+ * parseconfig
70
+
71
+ == INSTALL:
72
+
73
+ * gem install hoe-manns
74
+ * cd /path/to/gem (In case of using RVM anything like ~/.rvm/gems/ruby-2.2.1/gems/hoe-manns)
75
+ * rake setup
76
+
77
+ 'rake setup' installs a config file in $HOME/.hoe-manns/hoe-manns.cfg. If you would like to use copy_manuals so you
78
+ have to place in the config your docpath.
79
+
80
+ == DEVELOPERS:
81
+
82
+ After checking out the source, run:
83
+
84
+ $ rake newb
85
+
86
+ This task will install any missing dependencies, run the tests/specs,
87
+ and generate the RDoc.
88
+
89
+ Read https://github.com/saigkill/hoe-manns/blob/master/CONTRIBUTING.md
90
+
91
+ == LICENSE:
92
+
93
+ (The MIT License)
94
+
95
+ Copyright (c) 2015 Sascha Manns <samannsml@directbox.com>
96
+
97
+ Permission is hereby granted, free of charge, to any person obtaining
98
+ a copy of this software and associated documentation files (the
99
+ 'Software'), to deal in the Software without restriction, including
100
+ without limitation the rights to use, copy, modify, merge, publish,
101
+ distribute, sublicense, and/or sell copies of the Software, and to
102
+ permit persons to whom the Software is furnished to do so, subject to
103
+ the following conditions:
104
+
105
+ The above copyright notice and this permission notice shall be
106
+ included in all copies or substantial portions of the Software.
107
+
108
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
109
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
110
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
111
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
112
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
113
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
114
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/Rakefile ADDED
@@ -0,0 +1,104 @@
1
+ # -*- ruby -*-
2
+ # Release:
3
+ # * Enable Hoe.plugin :deveiate
4
+ # * Generate new apidocs
5
+ # * Update pages
6
+ # * regenerate pages
7
+ # * rake copy_manuals
8
+ # * Disable Hoe.plugin :deveiate
9
+
10
+ require 'rubygems'
11
+ require 'hoe'
12
+
13
+ Hoe.plugin :bundler
14
+ #Hoe.plugin :deveiate # Enable deveiate plugin for generating manuals and send_email
15
+ Hoe.plugin :doofus
16
+ Hoe.plugin :email
17
+ Hoe.plugin :gemspec
18
+ # Hoe.plugin :gem_prelude_sucks
19
+ Hoe.plugin :git
20
+ Hoe.plugin :history
21
+ Hoe.plugin :highline
22
+ #Hoe.plugin :inline
23
+ Hoe.plugin :manualgen
24
+ Hoe.plugin :manifest
25
+ Hoe.plugin :manns
26
+ # Hoe.plugin :mercurial
27
+ #Hoe.plugin :perforce
28
+ # Hoe.plugin :racc
29
+ # Hoe.plugin :rcov
30
+ Hoe.plugin :reek
31
+ Hoe.plugin :rdoc
32
+ Hoe.plugin :rubocop
33
+ Hoe.plugin :rubygems
34
+ #Hoe.plugin :seattlerb
35
+ Hoe.plugin :travis
36
+ Hoe.plugin :version
37
+ Hoe.plugin :website
38
+ Hoe.plugin :yard
39
+
40
+ ###########################################DEVELOPING ZONE##############################################################
41
+ # rubocop:disable Metrics/LineLength
42
+ Hoe.spec 'hoe-manns' do
43
+ developer('Sascha Manns', 'samannsml@directbox.com')
44
+ license 'MIT' # this should match the license in the README
45
+ require_ruby_version '>= 2.2.0'
46
+
47
+ #email_to << 'ruby-talk@ruby-lang.org'
48
+ email_to << 'Sascha.Manns@directbox.com'
49
+
50
+ dependency 'setup', '~> 5.2'
51
+ dependency 'parseconfig', '~> 1.0'
52
+
53
+ extra_dev_deps << ['coveralls', '~> 0.8']
54
+ extra_dev_deps << ['gem-release', '~> 0.7']
55
+ extra_dev_deps << ['hoe-bundler', '~> 1.2']
56
+ extra_dev_deps << ['hoe-deveiate', '~> 0.7']
57
+ extra_dev_deps << ['hoe-doofus', '~> 1.0']
58
+ extra_dev_deps << ['hoe-gemspec', '~> 1.0']
59
+ extra_dev_deps << ['hoe-git', '~> 1.6']
60
+ extra_dev_deps << ['hoe-highline', '~> 0.2']
61
+ extra_dev_deps << ['hoe-manifest', '~> 0.1']
62
+ extra_dev_deps << ['hoe-manns', '~> 1.0']
63
+ extra_dev_deps << ['hoe-manualgen', '~> 0.3']
64
+ extra_dev_deps << ['hoe-reek', '~> 1.0']
65
+ extra_dev_deps << ['hoe-rubocop', '~> 0.1']
66
+ extra_dev_deps << ['hoe-rubygems', '~> 1.0']
67
+ extra_dev_deps << ['hoe-seattlerb', '~> 1.3']
68
+ extra_dev_deps << ['hoe-travis', '~> 1.2']
69
+ extra_dev_deps << ['hoe-version', '~> 1.2']
70
+ extra_dev_deps << ['hoe-yard', '~> 0.1']
71
+ extra_dev_deps << ['indexer', '~> 0.3']
72
+ extra_dev_deps << ['rake', '~> 10.0']
73
+ extra_dev_deps << ['reek', '~> 3.3']
74
+ extra_dev_deps << ['rspec', '~> 3.2']
75
+ extra_dev_deps << ['rubocop', '~> 0.34']
76
+ extra_dev_deps << ['simplecov', '~> 0.10']
77
+ extra_dev_deps << ['ZenTest', '~> 4.11']
78
+
79
+ self.history_file = 'History.rdoc'
80
+ self.readme_file = 'README.rdoc'
81
+ self.extra_rdoc_files = FileList['*.rdoc'].to_a
82
+ self.post_install_message = '*** Run rake setup to finish the installation *** Please file bugreports and feature requests on: http://saigkill-bugs.myjetbrains.com/youtrack/issues'
83
+ end
84
+
85
+ require 'fileutils'
86
+ require File.expand_path(File.join(File.dirname(__FILE__), 'lib/hoe/manns'))
87
+ desc 'Prepares for release'
88
+ task :make_release => %w(run_before_release) do
89
+
90
+ system("rake release VERSION=#{Hoe::Manns::VERSION}")
91
+
92
+ Rake::Task['run_after_release']
93
+ end
94
+
95
+ ##################################################SETUP ZONE############################################################
96
+ require 'setup'
97
+ task :setup do
98
+ system('setup.rb uninstall --force')
99
+ system('setup.rb config --sysconfdir=$HOME/.hoe-manns')
100
+ system('setup.rb install')
101
+ end
102
+
103
+
104
+ # vim: syntax=ruby
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 1.0.0
data/config.reek ADDED
@@ -0,0 +1,111 @@
1
+ ---
2
+ Attribute:
3
+ enabled: false
4
+ exclude: []
5
+ BooleanParameter:
6
+ enabled: true
7
+ exclude: []
8
+ ClassVariable:
9
+ enabled: true
10
+ exclude: []
11
+ ControlParameter:
12
+ enabled: true
13
+ exclude: []
14
+ DataClump:
15
+ enabled: true
16
+ exclude: []
17
+ max_copies: 2
18
+ min_clump_size: 2
19
+ DuplicateMethodCall:
20
+ enabled: true
21
+ exclude: []
22
+ max_calls: 3
23
+ allow_calls: []
24
+ FeatureEnvy:
25
+ enabled: true
26
+ exclude: []
27
+ IrresponsibleModule:
28
+ enabled: true
29
+ exclude: []
30
+ LongParameterList:
31
+ enabled: true
32
+ exclude: []
33
+ max_params: 3
34
+ overrides:
35
+ initialize:
36
+ max_params: 5
37
+ LongYieldList:
38
+ enabled: true
39
+ exclude: []
40
+ max_params: 3
41
+ ModuleInitialize:
42
+ enabled: true
43
+ exclude: []
44
+ NestedIterators:
45
+ enabled: true
46
+ exclude: []
47
+ max_allowed_nesting: 1
48
+ ignore_iterators: []
49
+ NilCheck:
50
+ enabled: true
51
+ exclude: []
52
+ PrimaDonnaMethod:
53
+ enabled: true
54
+ exclude: []
55
+ RepeatedConditional:
56
+ enabled: true
57
+ exclude: []
58
+ max_ifs: 2
59
+ TooManyInstanceVariables:
60
+ enabled: true
61
+ exclude: []
62
+ max_instance_variables: 9
63
+ TooManyMethods:
64
+ enabled: true
65
+ exclude: []
66
+ max_methods: 25
67
+ TooManyStatements:
68
+ enabled: true
69
+ exclude:
70
+ - initialize
71
+ max_statements: 15
72
+ UncommunicativeMethodName:
73
+ enabled: true
74
+ exclude: []
75
+ reject:
76
+ - !ruby/regexp /^[a-z]$/
77
+ - !ruby/regexp /[0-9]$/
78
+ - !ruby/regexp /[A-Z]/
79
+ accept: []
80
+ UncommunicativeModuleName:
81
+ enabled: true
82
+ exclude: []
83
+ reject:
84
+ - !ruby/regexp /^.$/
85
+ - !ruby/regexp /[0-9]$/
86
+ accept:
87
+ - Inline::C
88
+ UncommunicativeParameterName:
89
+ enabled: true
90
+ exclude: []
91
+ reject:
92
+ - !ruby/regexp /^.$/
93
+ - !ruby/regexp /[0-9]$/
94
+ - !ruby/regexp /[A-Z]/
95
+ - !ruby/regexp /^_/
96
+ accept: []
97
+ UncommunicativeVariableName:
98
+ enabled: true
99
+ exclude: []
100
+ reject:
101
+ - !ruby/regexp /^.$/
102
+ - !ruby/regexp /[0-9]$/
103
+ - !ruby/regexp /[A-Z]/
104
+ accept:
105
+ - _
106
+ UnusedParameters:
107
+ enabled: true
108
+ exclude: []
109
+ UtilityFunction:
110
+ enabled: true
111
+ exclude: []
data/etc/hoe-manns.cfg ADDED
@@ -0,0 +1 @@
1
+ docpath = "/home/sascha/RubymineProjects/saigkill.github.com/docs/"
data/lib/hoe/manns.rb ADDED
@@ -0,0 +1,128 @@
1
+ #!/usr/bin/env ruby
2
+ # @encoding: utf-8
3
+ # @author: Sascha Manns
4
+ # @abstract: hoe-manns is a small collection of my personal used rake tasks for using with hoe
5
+ #
6
+ # Copyright (c) 2015 Sascha Manns <samannsml@directbox.com>
7
+ # License: MIT
8
+
9
+ # Dependencies
10
+
11
+ # empty main class
12
+ class Hoe; end
13
+
14
+ # Main module for hoe-manns
15
+ module Hoe::Manns
16
+ # Version constant for HOE::Manns
17
+ VERSION = '1.0.0'
18
+
19
+ attr_accessor :update_gemfile_lock
20
+ attr_accessor :remove_pre_gemspec
21
+ attr_accessor :update_workspace
22
+ attr_accessor :update_index
23
+ attr_accessor :copy_manuals
24
+ attr_accessor :run_before_release
25
+ attr_accessor :run_after_release
26
+ attr_accessor :clean_pkg
27
+
28
+ def initialize_manns
29
+ require 'yaml'
30
+ require 'fileutils'
31
+ require 'rainbow/ext/string'
32
+ end
33
+
34
+ def define_manns_tasks
35
+
36
+ desc 'Update Gemfile.lock'
37
+ task :update_gemfile_lock do
38
+ Hoe::Manns.update_gemfile_lock_method
39
+ end
40
+
41
+ desc 'Remove Pre-Gemspec'
42
+ task :remove_pre_gemspec do
43
+ Hoe::Manns.remove_pre_gemspec_method
44
+ end
45
+
46
+ desc 'Update Workspace'
47
+ task :update_workspace do
48
+ Hoe::Manns.update_workspace_method
49
+ end
50
+
51
+ desc 'Update .index'
52
+ task :update_index do
53
+ Hoe::Manns.update_index_method
54
+ end
55
+
56
+ require 'parseconfig'
57
+ desc 'Copy manuals'
58
+ task :copy_manuals do
59
+ Hoe::Manns.copy_manuals_method
60
+ end
61
+
62
+ desc 'Run all tasks before rake release'
63
+ task :run_before_release => %w(git:manifest bundler:gemfile update_gemfile_lock update_index remove_pre_gemspec
64
+ update_workspace) do
65
+ puts 'Ready to run rake release VERSION=x.y.z'.color(:green)
66
+ end
67
+
68
+ desc 'Run all tasks after rake release'
69
+ task :run_after_release => %w(send_email version:bump) do
70
+ puts 'Release finished'.color (:green)
71
+ end
72
+
73
+ desc 'Clean pkg'
74
+ task :clean_pkg do
75
+ Hoe::Manns.clean_pkg_method
76
+ end
77
+ end
78
+
79
+ require 'rainbow/ext/string'
80
+ # Method for updating Gemfile.lock
81
+ def self.update_gemfile_lock_method
82
+ puts 'Updating Gemfile.lock'.color(:yellow)
83
+ system('bundle update')
84
+ puts 'Updated Gemfile.lock'.color(:green)
85
+ end
86
+
87
+ # Method for removing prerelease gemspec
88
+ def self.remove_pre_gemspec_method
89
+ puts 'Removing pre version of gemspec'.color(:yellow)
90
+ File.delete(*Dir.glob('*.gemspec'))
91
+ puts 'Removed'.color(:green)
92
+ end
93
+
94
+ # Method for updating workspace
95
+ def self.update_workspace_method
96
+ puts 'Updating workspace'.color(:yellow)
97
+ system('git add .idea/*')
98
+ system('git add Manifest.txt Gemfile Gemfile.lock')
99
+ system('git commit -m "Updated workspace"')
100
+ system('git push')
101
+ puts 'Updated workspace'.color(:green)
102
+ end
103
+
104
+ # Method for updating .index
105
+ def self.update_index_method
106
+ puts 'Updating .index. Have you changed your VERSION file?'.color(:yellow)
107
+ system('index --using VERSION Index.yml')
108
+ system('git add .index')
109
+ puts '.index updated'.color(:green)
110
+ end
111
+
112
+ # Method for copying the manuals to a target directory
113
+ def self.copy_manuals_method
114
+ puts 'Copying manual pages to target'.color(:yellow)
115
+ pnameraw = File.open(*Dir.glob('README.*')) {|f| f.readline}
116
+ project = pnameraw.gsub(/[^0-9A-Za-z]/, '')
117
+ config = ParseConfig.new(File.join("#{Dir.home}/.hoe-manns/hoe-manns.cfg"))
118
+ docpath = config['docpath'].to_s
119
+ FileUtils.cp_r('manual/output', "#{docpath}/#{project}")
120
+ end
121
+
122
+ # Method for cleanup the pkg
123
+ def self.clean_pkg_method
124
+ puts 'Cleaning pkg'.color(:yellow)
125
+ FileUtils.rm_rf('pkg') if Dir.exist?('pkg')
126
+ puts 'Cleanup succeed'.color(:green)
127
+ end
128
+ end
@@ -0,0 +1,87 @@
1
+ <!DOCTYPE html>
2
+ <!--
3
+
4
+ Main Manual Layout
5
+ $Id: default.erb.erb,v 8077c9cdbac9 2011/01/26 02:15:09 ged $
6
+
7
+ Author: Michael Granger <ged@FaerieMUD.org>
8
+ Two column fluid layout adapted from Matthew James Taylor's "Perfect 'Left Menu'
9
+ 2 Column Liquid Layout":
10
+ http://matthewjamestaylor.com/blog/perfect-2-column-left-menu.htm
11
+
12
+ -->
13
+ <html lang="en">
14
+ <head>
15
+ <meta charset="utf-8">
16
+ <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
17
+
18
+ <title>hoe-manns Manual — <%= page.config['title'] || "untitled" %></title>
19
+
20
+ <link rel="stylesheet" href="css/manual.css">
21
+
22
+ <script src="js/jquery-1.4.4.min.js"></script>
23
+ <script src="js/sh.js"></script>
24
+ <script src="js/manual.js"></script>
25
+
26
+ </head>
27
+ <body>
28
+ <div id="page">
29
+
30
+ <header>
31
+ <hgroup>
32
+ <a href="/">
33
+ <h1>hoe-manns</h1>
34
+ </a>
35
+ <% if metadata.version %><h2 class="version"><%= metadata.version %></h2><% end %>
36
+ <% if page.config['tagline'] %><h2 class="tagline"><%= page.config['tagline'] %></h2><% end %>
37
+ </hgroup>
38
+ </header>
39
+
40
+ <div class="colmask leftmenu">
41
+ <div class="colleft">
42
+
43
+ <section id="content" class="col1">
44
+ <!-- Generated content -->
45
+ <%= content %>
46
+ <!-- end of generated content -->
47
+ </section>
48
+
49
+ <aside id="sidebar" class="col2">
50
+ <nav>
51
+ <%
52
+ @catalog.traverse_page_hierarchy( self ) do |type, title, path|
53
+ case type
54
+ when :section
55
+ %>
56
+ <div class="section">
57
+ <h3><a href="<%= self.basepath + path %>/"><%= title %></a></h3>
58
+ <ul class="index-section">
59
+ <% when :current_section %>
60
+ <div class="section current-section">
61
+ <h3><a href="<%= self.basepath + path %>/"><%= title %></a></h3>
62
+ <ul class="index-section current-index-section">
63
+ <% when :section_end, :current_section_end %>
64
+ </ul>
65
+ </div>
66
+ <% when :entry %>
67
+ <li><a href="<%= self.basepath + path %>.html"><%= title %></a></li>
68
+ <% when :current_entry %>
69
+ <li class="current-entry"><%= title %></li>
70
+ <% end
71
+ end
72
+ %>
73
+ </nav>
74
+ </aside>
75
+
76
+ </div>
77
+ </div>
78
+
79
+ <footer>
80
+ <div class="copyright">Copyright &copy; 2008-<%= Time.now.year %> Sascha Manns.</div>
81
+ <div class="vcsrev">Rev: $Revision: 8077c9cdbac9 $</div>
82
+ <div class="timestamp">Built: <%= Time.now.strftime("%Y%m%d %H:%M:%S %Z") %></div>
83
+ </footer>
84
+
85
+ </body>
86
+ </html>
87
+
@@ -0,0 +1,96 @@
1
+ #!/usr/bin/ruby
2
+ #
3
+ # A manual filter to generate links from the Darkfish API.
4
+ #
5
+ # Authors:
6
+ # * Michael Granger <ged@FaerieMUD.org>
7
+ # * Mahlon E. Smith <mahlon@martini.nu>
8
+ #
9
+
10
+
11
+ ### A filter for generating links from the generated API documentation. This allows you to refer
12
+ ### to class documentation by simply referencing a class name.
13
+ ###
14
+ ### Links are XML processing instructions. Pages can be referenced as such:
15
+ ###
16
+ ### <?api Class::Name ?>
17
+ ### <?api Class::Name#instance_method ?>
18
+ ### <?api Class::Name.class_method ?>
19
+ ###
20
+ ### Link text can be overridden, too:
21
+ ###
22
+ ### <?api "click here":Class::Name ?>
23
+ ### <?api "click here":Class::Name#instance_method ?>
24
+ ###
25
+ class Hoe::ManualGen::APIFilter < Hoe::ManualGen::PageFilter
26
+
27
+ # PI ::= '<?' PITarget (S (Char* - (Char* '?>' Char*)))? '?>'
28
+ ApiPI = %r{
29
+ <\?
30
+ api # Instruction Target
31
+ \s+
32
+ (?:"
33
+ (.*?) # Optional link text [$1]
34
+ ":)?
35
+ (.*?) # Class name [$2]
36
+ ([\.#].*?)? # Method anchor [$3]
37
+ \s+
38
+ \?>
39
+ }x
40
+
41
+
42
+ ######
43
+ public
44
+ ######
45
+
46
+ ### Process the given +source+ for <?api ... ?> processing-instructions, calling out
47
+ def process( source, page, metadata )
48
+
49
+ apipath = metadata.api_dir or
50
+ raise "The API output directory is not defined in the manual task."
51
+
52
+ return source.gsub( ApiPI ) do |match|
53
+ # Grab the tag values
54
+ link_text = $1
55
+ classname = $2
56
+ methodname = $3
57
+
58
+ self.generate_link( page, apipath, classname, methodname, link_text )
59
+ end
60
+ end
61
+
62
+
63
+ ### Create an HTML link fragment from the parsed ApiPI.
64
+ def generate_link( current_page, apipath, classname, methodname=nil, link_text=nil )
65
+
66
+ classpath = "%s.html" % [ classname.gsub('::', '/') ]
67
+ classfile = apipath + classpath
68
+ classuri = current_page.basepath + 'api' + classpath
69
+
70
+ if classfile.exist?
71
+ return %{<a href="%s%s">%s</a>} % [
72
+ classuri,
73
+ make_anchor( methodname ),
74
+ link_text || (classname + (methodname || ''))
75
+ ]
76
+ else
77
+ link_text ||= classname
78
+ error_message = "Could not find a link for class '%s'" % [ classname ]
79
+ $stderr.puts( error_message )
80
+ return %{<a href="#" title="#{error_message}" class="broken-link">#{link_text}</a>}
81
+ end
82
+ end
83
+
84
+
85
+ ### Attach a method anchor.
86
+ def make_anchor( methodname )
87
+ return '' unless methodname
88
+
89
+ method_type = methodname[ 0, 1 ]
90
+ return "#method-%s-%s" % [
91
+ ( method_type == '#' ? 'i' : 'c' ),
92
+ methodname[ 1..-1 ]
93
+ ]
94
+ end
95
+ end
96
+