binman 3.0.0 → 3.0.1

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.
data/HISTORY.markdown CHANGED
@@ -1,90 +1,116 @@
1
+ ------------------------------------------------------------------------------
2
+ Version 3.0.1 (2012-02-02)
3
+ ------------------------------------------------------------------------------
4
+
5
+ Patch:
6
+
7
+ * BinMan.help(): ignore `-h` and `--help` options after standard `--` flag.
8
+
9
+ * BinMan.show(): write temp file because not all systems support `man -l`.
10
+
11
+ Other:
12
+
13
+ * HISTORY: group changes by version number components.
14
+
15
+ * README: add instructions on pre-building man pages.
16
+
17
+ * README: fix installation commands for development.
18
+
19
+ * bundler suggests moving all dev deps into gemspec.
20
+
1
21
  ------------------------------------------------------------------------------
2
22
  Version 3.0.0 (2012-01-09)
3
23
  ------------------------------------------------------------------------------
4
24
 
5
- Breaking changes:
25
+ Major:
26
+
27
+ * Removed the `binman/gemspec` helper library because it did not play well
28
+ with Bundler. Use the standard `add_runtime_dependency` method instead.
29
+ [This example][1] shows what work is involved in upgrading.
6
30
 
7
- * Removed the `binman/gemspec` helper library because it did not play well
8
- with Bundler. Use the standard `add_runtime_dependency` method instead.
31
+ Minor:
9
32
 
10
- External changes:
33
+ * The `binman/Rakefile` helper library now hooks into Bundler's Rake tasks.
34
+ Be sure to add the `man/**/*` files to your gemspec [accordingly][1].
11
35
 
12
- * The `binman/Rakefile` helper library now hooks into Bundler's Rake tasks.
36
+ [1]: https://github.com/sunaku/md2man/commit/75d7a0064fa86f1c98dd01391ad82245fd387c20
13
37
 
14
38
  ------------------------------------------------------------------------------
15
39
  Version 2.0.0 (2011-12-06)
16
40
  ------------------------------------------------------------------------------
17
41
 
18
- Breaking changes:
42
+ Major:
19
43
 
20
- * Removed the deprecated `binman/rake_tasks` helper library. Use
21
- `binman/rakefile` instead.
44
+ * Removed the deprecated `binman/rake_tasks` helper library. Use
45
+ `binman/rakefile` instead.
22
46
 
23
- External changes:
47
+ Patch:
24
48
 
25
- * Fixed infinite looping in the `binman/gemspec` helper library.
49
+ * Fixed infinite looping in the `binman/gemspec` helper library.
26
50
 
27
- Internal changes:
51
+ Other:
28
52
 
29
- * Upgraded to md2man v1 for Markdown to UNIX man page conversion.
53
+ * Upgraded to md2man v1 for Markdown to UNIX man page conversion.
30
54
 
31
- * Do not hard-code the version number in `binman/gemspec` helper.
55
+ * Do not hard-code the version number in `binman/gemspec` helper.
32
56
 
33
57
  ------------------------------------------------------------------------------
34
58
  Version 1.1.0 (2011-11-05)
35
59
  ------------------------------------------------------------------------------
36
60
 
37
- Compatible changes:
61
+ Alert:
38
62
 
39
- * The `binman/rake_tasks` library has been renamed (with deprecation) to
40
- `binman/rakefile`. The deprecation warning will be removed in the next
41
- major release.
63
+ * The `binman/rake_tasks` library has been renamed (with deprecation) to
64
+ `binman/rakefile`. The deprecation warning will be removed in the next
65
+ major release.
42
66
 
43
- New features:
67
+ Minor:
44
68
 
45
- * Add `binman/gemspec` packaging convenience library which automatically
46
- builds and includes your UNIX man page files in your gem packages and also
47
- adds binman as a runtime and development gem dependency.
69
+ * Add `binman/gemspec` packaging convenience library which automatically
70
+ builds and includes your UNIX man page files in your gem packages and also
71
+ adds binman as a runtime and development gem dependency.
48
72
 
49
73
  ------------------------------------------------------------------------------
50
74
  Version 1.0.0 (2011-10-13)
51
75
  ------------------------------------------------------------------------------
52
76
 
53
- Incompatible changes:
77
+ Major:
54
78
 
55
- * The `BinMan::dump()` method and corresponding `binman dump` command now
56
- extract the leading comment header from their input before returning the
57
- markdown to roff conversion thereof.
79
+ * The `BinMan::dump()` method and corresponding `binman dump` command now
80
+ extract the leading comment header from their input before returning the
81
+ markdown to roff conversion thereof.
58
82
 
59
- * The `BinMan::read()` method and corresponding `binman read` command have
60
- been renamed to `BinMan::load()` and `binman load` respectively.
83
+ * The `BinMan::read()` method and corresponding `binman read` command have
84
+ been renamed to `BinMan::load()` and `binman load` respectively.
61
85
 
62
- New features:
86
+ Minor:
63
87
 
64
- * Added `BinMan::conv()` method and corresponding `binman conv` command to
65
- encapsulate the markdown to roff conversion process.
88
+ * Added `BinMan::conv()` method and corresponding `binman conv` command to
89
+ encapsulate the markdown to roff conversion process.
66
90
 
67
- Bug fixes:
91
+ Patch:
68
92
 
69
- * Pre-built man pages included alongside a `bin/` script were not displayed.
70
- Instead, binman was (incorrectly) always trying to convert the leading
71
- comment header from the `bin/` script into a UNIX man page for display.
93
+ * Pre-built man pages included alongside a `bin/` script were not displayed.
94
+ Instead, binman was (incorrectly) always trying to convert the leading
95
+ comment header from the `bin/` script into a UNIX man page for display.
72
96
 
73
- Housekeeping:
97
+ Other:
74
98
 
75
- * README: explain dev deps and `man/` dir packaging.
99
+ * README: explain dev deps and `man/` dir packaging.
76
100
 
77
101
  ------------------------------------------------------------------------------
78
102
  Version 0.1.2 (2011-10-13)
79
103
  ------------------------------------------------------------------------------
80
104
 
81
- Housekeeping:
105
+ Minor:
106
+
107
+ * The [Redcarpet2] library is not a runtime gem dependency anymore.
82
108
 
83
- * Extracted `BinMan::Renderer` into [redcarpet-manpage] library.
109
+ Other:
84
110
 
85
- * The [Redcarpet2] library is not a runtime gem dependency anymore.
111
+ * Extracted `BinMan::Renderer` into [redcarpet-manpage] library.
86
112
 
87
- * Forgot to introduce leading comment headers in binman(1) man page.
113
+ * Forgot to introduce leading comment headers in binman(1) man page.
88
114
 
89
115
  [Redcarpet2]: https://github.com/tanoku/redcarpet
90
116
  [redcarpet-manpage]: http://rdoc.info/github/sunaku/redcarpet-manpage
@@ -93,29 +119,29 @@ Housekeeping:
93
119
  Version 0.1.1 (2011-10-13)
94
120
  ------------------------------------------------------------------------------
95
121
 
96
- New features:
122
+ Minor:
97
123
 
98
- * `BinMan.read()` now supports embedded document (=begin/=end) comments also.
99
- See binman(1) for the new, complete description of leading comment headers.
124
+ * `BinMan.read()` now supports embedded document (=begin/=end) comments
125
+ also. See binman(1) for the new description of leading comment headers.
100
126
 
101
- Bug fixes:
127
+ Patch:
102
128
 
103
- * Ignore encoding comment line after shebang line.
129
+ * Ignore encoding comment line after shebang line.
104
130
 
105
- * roff: fix first paragraphs inside list items.
131
+ * roff: fix first paragraphs inside list items.
106
132
 
107
- Housekeeping:
133
+ Other:
108
134
 
109
- * gemspec: build man page files before building gem.
135
+ * gemspec: build man page files before building gem.
110
136
 
111
- * binman: raise error and suggest --help option.
137
+ * binman: raise error and suggest --help option.
112
138
 
113
- * README: add link to example of binman markdown.
139
+ * README: add link to example of binman markdown.
114
140
 
115
- * README: add obligatory screenshot! >:-)
141
+ * README: add obligatory screenshot! >:-)
116
142
 
117
143
  ------------------------------------------------------------------------------
118
144
  Version 0.0.1 (2011-10-12)
119
145
  ------------------------------------------------------------------------------
120
146
 
121
- * First release! Happy birthday! Woohoo! :-)
147
+ First release! Happy birthday! Woohoo! :-)
data/README.markdown CHANGED
@@ -41,29 +41,21 @@ As a Ruby gem (with extra cheese and everything please):
41
41
 
42
42
  gem install binman --development
43
43
 
44
- As a Git clone:
44
+ ### Development
45
45
 
46
46
  git clone git://github.com/sunaku/binman
47
47
  cd binman
48
- bundle install
48
+ bundle install --binstubs=bundle_bin
49
+ bundle_bin/binman --help # run it directly
50
+ bundle exec rake -T # packaging tasks
49
51
 
50
52
  ------------------------------------------------------------------------------
51
- Invocation
53
+ Usage
52
54
  ------------------------------------------------------------------------------
53
55
 
54
- If installed as a Ruby gem:
55
-
56
- binman
57
-
58
- If installed as a Git clone:
59
-
60
- bundle exec ruby -Ilib bin/binman
61
-
62
- Just pass `--help` to see its man page.
56
+ ### At the command line
63
57
 
64
- ------------------------------------------------------------------------------
65
- Usage
66
- ------------------------------------------------------------------------------
58
+ binman --help
67
59
 
68
60
  ### In your bin/ scripts
69
61
 
@@ -79,24 +71,26 @@ Or, if you're on a diet:
79
71
 
80
72
  See the [API documentation][binman-api] for more delicious recipes.
81
73
 
82
- ### In your Rakefile
74
+ ### Pre-building man pages
83
75
 
84
- Add the following line to your `Rakefile` and you've got a `binman` task!
76
+ Add the following lines to your gemspec:
85
77
 
86
- require 'binman/rakefile'
78
+ s.files += Dir["man/**/*"]
79
+ s.add_development_dependency 'md2man', '~> 1'
87
80
 
88
- It will pre-build UNIX man page files for your `bin/` scripts into a `man/`
89
- directory so that your end-users do not need the markdown to roff converter
90
- installed in order to view your man pages!
81
+ Add the following line to your Rakefile:
91
82
 
92
- ### In your gemspec
83
+ require 'binman/rakefile'
93
84
 
94
- To automatically build and include your UNIX man page files in your gem
95
- packages, add the following line to the top of your `*.gemspec` file:
85
+ You now have a `rake binman` task that pre-builds UNIX man page files for your
86
+ `bin/` scripts into a `man/` directory so that your end-users do not need
87
+ [md2man] installed in order to view the man pages you've embedded therein!
96
88
 
97
- require 'binman/gemspec'
89
+ If you're using Bundler, this task also hooks into its gem packaging tasks and
90
+ ensures that your UNIX man page files are pre-built and included in your gem:
98
91
 
99
- Doing this also adds binman as a runtime and development gem dependency.
92
+ bundle exec rake build
93
+ gem spec pkg/*.gem | fgrep man/man
100
94
 
101
95
  ------------------------------------------------------------------------------
102
96
  License
data/bin/binman CHANGED
@@ -2,7 +2,7 @@
2
2
  # encoding: utf-8
3
3
  =begin
4
4
 
5
- BINMAN 1 "2012-01-09" "3.0.0"
5
+ BINMAN 1 "2012-02-02" "3.0.1"
6
6
  =============================
7
7
 
8
8
  NAME
data/binman.gemspec CHANGED
@@ -17,4 +17,5 @@ Gem::Specification.new do |s|
17
17
  s.require_paths = ["lib"]
18
18
 
19
19
  s.add_development_dependency "md2man", "~> 1"
20
+ s.add_development_dependency "rake", ">= 0.9.2.2", "< 1"
20
21
  end
data/lib/binman.rb CHANGED
@@ -55,16 +55,24 @@ module BinMan
55
55
 
56
56
  begin
57
57
  roff = conv(header)
58
- IO.popen('man -l -', 'w') {|man| man.puts roff }
58
+ require 'tempfile'
59
+ Tempfile.open 'binman' do |temp|
60
+ temp.write roff
61
+ temp.close
62
+ system 'man', temp.path
63
+ end
59
64
  rescue => error
60
65
  warn "binman: #{error}"
61
66
  puts header
62
67
  end
63
68
  end
64
69
 
65
- # Shows leading comment header from given source as UNIX man page and exits.
70
+ # Shows leading comment header from given source as UNIX man page and exits
71
+ # if the given argument vector contains '-h' or '--help', except after '--'.
66
72
  def help source=nil, argv=ARGV
67
- unless argv.grep(/^(-h|--help)$/).empty?
73
+ limit = argv.index('--') || argv.length
74
+ index = [argv.index('-h'), argv.index('--help')].compact.min
75
+ if index and index < limit
68
76
  show source
69
77
  exit
70
78
  end
@@ -1,3 +1,3 @@
1
1
  module BinMan
2
- VERSION = "3.0.0"
2
+ VERSION = "3.0.1"
3
3
  end
data/man/man1/binman.1 CHANGED
@@ -1,4 +1,4 @@
1
- .TH BINMAN 1 "2012\-01\-09" "3.0.0"
1
+ .TH BINMAN 1 "2012\-02\-02" "3.0.1"
2
2
  .SH NAME
3
3
  .PP
4
4
  binman \- UNIX man pages for Ruby \fB\fCbin/\fR scripts
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: binman
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-01-10 00:00:00.000000000 Z
12
+ date: 2012-02-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: md2man
16
- requirement: &17179080 !ruby/object:Gem::Requirement
16
+ requirement: &18830780 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,7 +21,21 @@ dependencies:
21
21
  version: '1'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *17179080
24
+ version_requirements: *18830780
25
+ - !ruby/object:Gem::Dependency
26
+ name: rake
27
+ requirement: &18829640 !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: 0.9.2.2
33
+ - - <
34
+ - !ruby/object:Gem::Version
35
+ version: '1'
36
+ type: :development
37
+ prerelease: false
38
+ version_requirements: *18829640
25
39
  description: ''
26
40
  email:
27
41
  - sunaku@gmail.com
@@ -54,12 +68,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
54
68
  - - ! '>='
55
69
  - !ruby/object:Gem::Version
56
70
  version: '0'
71
+ segments:
72
+ - 0
73
+ hash: 3512884628236364112
57
74
  required_rubygems_version: !ruby/object:Gem::Requirement
58
75
  none: false
59
76
  requirements:
60
77
  - - ! '>='
61
78
  - !ruby/object:Gem::Version
62
79
  version: '0'
80
+ segments:
81
+ - 0
82
+ hash: 3512884628236364112
63
83
  requirements: []
64
84
  rubyforge_project:
65
85
  rubygems_version: 1.8.11
@@ -67,4 +87,3 @@ signing_key:
67
87
  specification_version: 3
68
88
  summary: UNIX man pages for Ruby bin/ scripts
69
89
  test_files: []
70
- has_rdoc: