mmcopyrights 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -4,8 +4,8 @@ Add copyrights to your source files.
4
4
 
5
5
  == Copyrights (I know this is a bit recursive)
6
6
 
7
- Copyright © 2009 Micah Martin.
8
- MM Copyrights and all included source files are distributed under terms of the GNU LGPL.
7
+ Copyright © 2012 Micah Martin.
8
+ MM Copyrights and all included source files are distributed under terms of the MIT License.
9
9
 
10
10
  == Install
11
11
 
data/lib/mmcopyrights.rb CHANGED
@@ -1,15 +1,15 @@
1
- #- Copyright © 2009 Micah Martin.
2
- #- MM Copyrights and all included source files are distributed under terms of the GNU LGPL.
1
+ #- Copyright (C) 2012 Micah Martin.
2
+ #- MM Copyrights and all included source files are distributed under terms of the MIT License.
3
3
 
4
4
  module MM
5
5
  module Copyrights
6
-
6
+
7
7
  class <<self
8
8
  attr_accessor :verbose
9
9
  end
10
-
10
+
11
11
  self.verbose = true
12
-
12
+
13
13
  ENDL = $/
14
14
 
15
15
  class SourceFile
@@ -48,15 +48,15 @@ module MM
48
48
  copyright_header = text.split(/^/).inject([]) do |header,line|
49
49
  header << "#@comment_prefix #{line}"
50
50
  end
51
- @lines.unshift ENDL unless @lines.first.strip.empty?
51
+ @lines.unshift ENDL unless @lines.first.nil? || @lines.first.strip.empty?
52
52
  @lines = copyright_header + [ENDL] + @lines
53
53
  end
54
54
 
55
55
  def save!
56
- File.open(@filename, "w"){ |f| f.print @lines }
56
+ File.open(@filename, "w"){ |f| f.print @lines.join() }
57
57
  end
58
58
  end
59
-
59
+
60
60
  def self.process(dir, ext, prefix, copyright)
61
61
  Dir.glob(File.join(dir, "**", "*.#{ext}")).each do |filename|
62
62
  source_file = SourceFile.new(filename, prefix)
@@ -72,13 +72,13 @@ module MM
72
72
  else
73
73
  say "missing copyright: #{filename}"
74
74
  source_file.add_copyright(copyright)
75
- source_file.save!
75
+ source_file.save!
76
76
  end
77
77
  end
78
78
  end
79
79
 
80
80
  private
81
-
81
+
82
82
  def self.say(thing)
83
83
  puts thing if @verbose
84
84
  end
@@ -1,8 +1,8 @@
1
- #- Copyright © 2009 Micah Martin.
2
- #- MM Copyrights and all included source files are distributed under terms of the GNU LGPL.
1
+ #- Copyright (C) 2012 Micah Martin.
2
+ #- MM Copyrights and all included source files are distributed under terms of the MIT License.
3
3
 
4
4
  require 'rubygems'
5
- require 'spec'
5
+ require 'rspec'
6
6
  require File.expand_path(File.dirname(__FILE__) + "/../lib/mmcopyrights")
7
7
  require 'fileutils'
8
8
 
metadata CHANGED
@@ -1,65 +1,50 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: mmcopyrights
3
- version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 1
7
- - 1
8
- - 0
9
- version: 1.1.0
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.2.0
5
+ prerelease:
10
6
  platform: ruby
11
- authors:
7
+ authors:
12
8
  - Micah Martin
13
9
  autorequire:
14
10
  bindir: bin
15
11
  cert_chain: []
16
-
17
- date: 2010-04-06 00:49:53 -05:00
18
- default_executable:
12
+ date: 2012-08-15 00:00:00.000000000 Z
19
13
  dependencies: []
20
-
21
14
  description: Add copyright comments to all your source files
22
15
  email: micah@8thlight.com
23
16
  executables: []
24
-
25
17
  extensions: []
26
-
27
- extra_rdoc_files:
18
+ extra_rdoc_files:
28
19
  - README.rdoc
29
- files:
20
+ files:
30
21
  - README.rdoc
31
22
  - lib/mmcopyrights.rb
32
23
  - spec/mmcopyrights_spec.rb
33
- has_rdoc: true
34
24
  homepage: http://github.com/slagyr/mmcopyrights
35
25
  licenses: []
36
-
37
26
  post_install_message:
38
- rdoc_options:
27
+ rdoc_options:
39
28
  - --inline-source
40
29
  - --charset=UTF-8
41
- require_paths:
30
+ require_paths:
42
31
  - lib
43
- required_ruby_version: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - ">="
46
- - !ruby/object:Gem::Version
47
- segments:
48
- - 0
49
- version: "0"
50
- required_rubygems_version: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - ">="
53
- - !ruby/object:Gem::Version
54
- segments:
55
- - 0
56
- version: "0"
32
+ required_ruby_version: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ required_rubygems_version: !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
57
44
  requirements: []
58
-
59
45
  rubyforge_project:
60
- rubygems_version: 1.3.6
46
+ rubygems_version: 1.8.24
61
47
  signing_key:
62
48
  specification_version: 2
63
49
  summary: MM Copyrights
64
50
  test_files: []
65
-