surrender 0.8.1 → 0.8.2

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.md ADDED
@@ -0,0 +1,17 @@
1
+ 2013-08-15 0.8.2
2
+ ================
3
+
4
+ * Fix arguments passed on the command line would error out
5
+ * Fix newline on filenames when reading from ARGF
6
+
7
+
8
+ 2013-08-15 0.8.1
9
+ ================
10
+
11
+ * Doc fixes
12
+
13
+
14
+ 2013-08-15 0.8.0
15
+ ================
16
+
17
+ * Initial release
data/bin/surrender CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
  require "surrender"
3
3
 
4
- options = ARGV.each_with_object(Surrender::DEFAULT_ARGUMENTS) do |arg, memo|
4
+ options = ARGV.each_with_object(Surrender::DEFAULT_ARGUMENTS.dup) do |arg, memo|
5
5
  case arg
6
6
  when /^--most-recent=(\d+)$/
7
7
  memo[:most_recent] = Integer($1)
@@ -11,9 +11,13 @@ options = ARGV.each_with_object(Surrender::DEFAULT_ARGUMENTS) do |arg, memo|
11
11
  memo[:monthly] = Integer($1)
12
12
  when /^--yearly=(\d+)$/
13
13
  memo[:yearly] = Integer($1)
14
+ else
15
+ raise ArgumentError, "Unknown option #{arg.inspect}"
14
16
  end
15
17
  end
16
18
 
19
+ ARGV.select{|arg| arg[0, 2] == "--"}.each{|arg| ARGV.delete(arg)}
20
+
17
21
  unprocessable, deleteable = Surrender.reject(ARGF, options)
18
22
  STDERR.puts unprocessable.map{|filename| "WARN: Filename #{filename.inspect} did not match the filter expression"}
19
23
  STDOUT.puts deleteable
@@ -1,3 +1,3 @@
1
1
  module Surrender
2
- VERSION = "0.8.1"
2
+ VERSION = "0.8.2"
3
3
  end
data/lib/surrender.rb CHANGED
@@ -28,7 +28,7 @@ module Surrender
28
28
  Surrender::YearlyPolicy.new(options.fetch(:yearly)),
29
29
  ]
30
30
 
31
- all_files = filenames.map(&:to_s)
31
+ all_files = filenames.map(&:to_s).map(&:chomp)
32
32
  valid_filenames = all_files.select{|fn| fn =~ BACKUP_RE}
33
33
  unprocessable = all_files - valid_filenames
34
34
  valid_filenames.each do |filename|
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: surrender
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 0.8.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -54,6 +54,7 @@ extra_rdoc_files: []
54
54
  files:
55
55
  - .gitignore
56
56
  - .travis.yml
57
+ - ChangeLog.md
57
58
  - Gemfile
58
59
  - LICENSE.txt
59
60
  - README.md
@@ -87,12 +88,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
87
88
  - - ! '>='
88
89
  - !ruby/object:Gem::Version
89
90
  version: '0'
91
+ segments:
92
+ - 0
93
+ hash: 1928710586624369307
90
94
  required_rubygems_version: !ruby/object:Gem::Requirement
91
95
  none: false
92
96
  requirements:
93
97
  - - ! '>='
94
98
  - !ruby/object:Gem::Version
95
99
  version: '0'
100
+ segments:
101
+ - 0
102
+ hash: 1928710586624369307
96
103
  requirements: []
97
104
  rubyforge_project:
98
105
  rubygems_version: 1.8.25