github-copywriter 1.2.3 → 1.2.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 413a429d2bd1b9a2d129990d1bc2cc5eeae1cd4e
4
- data.tar.gz: e43c891f1821f7df04641889caa47484a3546c0a
3
+ metadata.gz: 866ea8fd4ae24c3bbfef341fe187e3bb63812dac
4
+ data.tar.gz: 09cd9dcea3875d2fda00b26f4010dc0b49bcfd9b
5
5
  SHA512:
6
- metadata.gz: 18c47551046cd9f5d22b457ff2afb180855f0726aac7d447432744fa93846acc9637a6eb0a8fbc8c2c137e6cda54d4eac04608e0b621b857c218335c911c1163
7
- data.tar.gz: 147564090c870d832638d3253196f8f7d77611a18a627939d158b9962d28e6f596b4802d879bccc90e2cfd1778917e98541a72727fa9b45a60dc2b6887f5d715
6
+ metadata.gz: 6712b4eef61d46b591c0726f59a2f6792f789750fe66dc2d0cd3b03a0eceb26c3028e63b8e9af577d103b01dbf53a736bc97ea4b17e07593d306de9cffa816a8
7
+ data.tar.gz: bbf207de4211f381239ebd7306a88e362b015fead89663f07a8e085c1f0fdc4dc5a744d157732d5a6deb4de55a1f0ff285fa32202605e809e9dde21e1b982671
@@ -43,12 +43,17 @@ Usage: #{executable_name} [repos...]
43
43
  options[:skip_forks] = true
44
44
  end
45
45
 
46
+ opts.on("-n", "--dry-run", "Don't actually write to any repos.") do
47
+ options[:dry_run] = true
48
+ end
49
+
46
50
  opts.on("-b", "--branches branch1,branch2", "Update specific branches only.") do |comma_separated_branches|
47
51
  options[:branches] = comma_separated_branches.split(",").map(&:strip)
48
52
  end
49
53
 
50
54
  opts.on_tail("-h","--help", "Show this message.") do
51
55
  puts opts
56
+ puts ""
52
57
  exit
53
58
  end
54
59
 
@@ -41,6 +41,7 @@ class Copywriter
41
41
  options = {
42
42
  all_repos: false,
43
43
  skip_forks: false,
44
+ dry_run: false,
44
45
  year: nil,
45
46
  branches: nil
46
47
  }.merge(options)
@@ -139,8 +140,10 @@ class Copywriter
139
140
  else
140
141
  print " Committing #{@modified_files.size} files..."
141
142
  end
143
+
142
144
  commit_files(repo_name, ref, "100644", @modified_files, COMMIT_MSG)
143
- puts " done!"
145
+
146
+ puts " done! #{options[:dry_run] ? '(dry run)' : ''}"
144
147
  else
145
148
  puts " No files needed to be commited."
146
149
  end
@@ -60,7 +60,7 @@ class Copywriter
60
60
  old_content.force_encoding "utf-8"
61
61
 
62
62
  # All teh regex
63
- prefix = /([Cc]opyright( \([Cc]\)| ©)?|\([Cc]\)|©) /
63
+ prefix = /(copyright( \(c\)| ©)?|\(c\)|©) /i
64
64
  suffix = /(\.| |$)/
65
65
  comma_sep = /((\d{4},|\d{4}-\d{4},)*)/
66
66
  regexs = [
@@ -8,6 +8,6 @@ class Copywriter
8
8
 
9
9
  # Current version
10
10
  # @return [String]
11
- VERSION = "1.2.3".freeze
11
+ VERSION = "1.2.4".freeze
12
12
 
13
13
  end
@@ -59,7 +59,15 @@ copyrights = [
59
59
  {
60
60
  :old => "This is my paragraph. Blah blah blah... Copyright 2001.\nCopyright (C) 2001,2003,2006,2008,2010-2013\n",
61
61
  :new => "This is my paragraph. Blah blah blah... Copyright 2014.\nCopyright (C) 2001,2003,2006,2008,2010-2014\n"
62
- }
62
+ },
63
+
64
+ # Case-insensitive-ness tests
65
+ { :old => "COPYRIGHT (C) 2010", :new => "COPYRIGHT (C) 2014" },
66
+ { :old => "copyright (C) 2010", :new => "copyright (C) 2014" },
67
+ { :old => "CoPyRiGhT (C) 2010", :new => "CoPyRiGhT (C) 2014" },
68
+ { :old => "cOpYrIgHt (C) 2010", :new => "cOpYrIgHt (C) 2014" },
69
+ { :old => "COPYright (C) 2010", :new => "COPYright (C) 2014" },
70
+ { :old => "copyRIGHT (C) 2010", :new => "copyRIGHT (C) 2014" }
63
71
  ]
64
72
 
65
73
  garbage_text = [
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: github-copywriter
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.3
4
+ version: 1.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Jacobs
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-23 00:00:00.000000000 Z
11
+ date: 2016-01-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -141,7 +141,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
141
141
  version: '0'
142
142
  requirements: []
143
143
  rubyforge_project:
144
- rubygems_version: 2.2.2
144
+ rubygems_version: 2.5.1
145
145
  signing_key:
146
146
  specification_version: 4
147
147
  summary: github-copywriter updates your copyrights... so you don't have to!