notes 0.1.0 → 0.1.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/CHANGELOG.rdoc CHANGED
@@ -1,3 +1,8 @@
1
+ == 0.1.1
2
+
3
+ * gracefully exit when a INT signal (Ctrl-C) is caught.
4
+ * [GH #4] silent error messages by default, add a verbosity option
5
+
1
6
  == 0.1.0
2
7
 
3
8
  * improve scanner and executable
data/README.rdoc CHANGED
@@ -87,6 +87,10 @@ The Notes module provides convenient methods.
87
87
  Notes can also extend an object to add a new method (see Notes#notes),
88
88
  or allow you to create your own scanner (see the Notes::Scanner).
89
89
 
90
+ For usage example of the library, you can have a look at the really basic
91
+ {Notes plugin}[http://github.com/v0n/redmine_notes] for Redmine, at:
92
+ http://github.com/v0n/redmine_notes
93
+
90
94
  == License
91
95
 
92
96
  That's free and friendly for sure! See the LICENSE file.
data/bin/notes CHANGED
@@ -6,9 +6,13 @@ require 'optparse'
6
6
  require 'paint'
7
7
  require 'find'
8
8
 
9
+ interrupted = false
10
+ verbose = false
9
11
  usage = 'Usage: notes [OPTION]... [FILE]...'
10
12
  tags = Notes::TAGS.dup
11
13
 
14
+ trap("INT") { interrupted = true }
15
+
12
16
  ARGV.options do |o|
13
17
  o.version = Notes::VERSION
14
18
  o.banner = usage
@@ -17,6 +21,7 @@ ARGV.options do |o|
17
21
  o.on( '--no-xxx', 'Do not search XXX tags') { tags -= ['XXX'] }
18
22
  o.on('-a', '--tag=TAG', 'Search TAG tags') { |tag| tags |= [tag] }
19
23
  o.on( '--no-color', 'Do not colorize ouput') { Paint.mode = 0 }
24
+ o.on('-v', '--verbose', 'Print more messages') { verbose = true }
20
25
  end
21
26
 
22
27
  begin
@@ -59,10 +64,11 @@ Find.find(*paths) do |path|
59
64
  begin
60
65
  scanner.scan_file(path)
61
66
  rescue Errno::ENOENT => e
62
- STDERR.puts "notes: #{e.message} (broken symlink?)"
67
+ STDERR.puts "notes: #{e.message} (broken symlink?)" if verbose
63
68
  rescue => e
64
- STDERR.puts "notes: #{path}: #{e.message}"
69
+ STDERR.puts "notes: #{path}: #{e.message}" if verbose
65
70
  end
71
+ exit if interrupted
66
72
  end
67
73
 
68
74
  exit
data/lib/notes/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Notes
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
4
4
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: notes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-05-02 00:00:00.000000000 Z
12
+ date: 2012-05-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: paint