copyrighter 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +12 -18
- data/.hound.yml +2 -0
- data/.rubocop.yml +1 -0
- data/.ruby-style.yml +1260 -0
- data/.travis.yml +4 -0
- data/CODE_OF_CONDUCT.md +13 -0
- data/Gemfile +1 -1
- data/README.md +21 -8
- data/Rakefile +16 -1
- data/copyrighter.gemspec +26 -14
- data/lib/copyrighter.rb +4 -3
- data/lib/copyrighter/helpers.rb +7 -7
- data/lib/copyrighter/railtie.rb +3 -2
- data/lib/copyrighter/version.rb +1 -1
- metadata +117 -15
data/.travis.yml
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
# Contributor Code of Conduct
|
2
|
+
|
3
|
+
As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
|
4
|
+
|
5
|
+
We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.
|
6
|
+
|
7
|
+
Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
|
8
|
+
|
9
|
+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
|
10
|
+
|
11
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
|
12
|
+
|
13
|
+
This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,17 +1,30 @@
|
|
1
1
|
# Copyrighter
|
2
2
|
|
3
|
+
[![Gem Version](http://img.shields.io/gem/v/copyrighter.svg)](https://rubygems.org/gems/copyrighter)
|
4
|
+
[![Dependency Status](https://gemnasium.com/farski/copyrighter.svg)](https://gemnasium.com/farski/copyrighter)
|
5
|
+
[![Build Status](https://travis-ci.org/farski/copyrighter.svg)](https://travis-ci.org/farski/copyrighter)
|
6
|
+
[![Code Climate](https://codeclimate.com/github/farski/copyrighter/badges/gpa.svg)](https://codeclimate.com/github/farski/copyrighter)
|
7
|
+
[![Coverage Status](https://coveralls.io/repos/farski/copyrighter/badge.svg?branch=master&service=github)](https://coveralls.io/github/farski/copyrighter?branch=master)
|
8
|
+
|
3
9
|
Handy way to print out copyright dates, like in a footer.
|
4
10
|
|
5
|
-
|
11
|
+
### Examples
|
12
|
+
|
13
|
+
The following examples assume it's 2012
|
6
14
|
|
7
|
-
|
15
|
+
© 2012
|
16
|
+
=> "2012"
|
8
17
|
|
9
|
-
|
18
|
+
This will automatically change to "2012 – 2013" next year!
|
10
19
|
|
11
|
-
|
20
|
+
# © will take an integer
|
21
|
+
© 1999
|
22
|
+
=> "1999 – 2012"
|
23
|
+
# or a range
|
24
|
+
© 1492..1566
|
25
|
+
=> "1492 – 1566"
|
12
26
|
|
13
|
-
You can also provide an optional second argument, which
|
27
|
+
You can also provide an optional second argument, which will be used to join the string
|
14
28
|
|
15
|
-
© 1999,
|
16
|
-
|
17
|
-
© 1999, ':' => "1999:2012"
|
29
|
+
© 1999, " to "
|
30
|
+
=> "1999 to 2012"
|
data/Rakefile
CHANGED
@@ -1,2 +1,17 @@
|
|
1
|
-
#!/usr/bin/env rake
|
2
1
|
require "bundler/gem_tasks"
|
2
|
+
require "rake/testtask"
|
3
|
+
|
4
|
+
Rake::TestTask.new(:test) do |t|
|
5
|
+
t.libs << "test"
|
6
|
+
t.libs << "lib"
|
7
|
+
t.test_files = FileList["test/**/*_test.rb"]
|
8
|
+
end
|
9
|
+
|
10
|
+
task :console do
|
11
|
+
require "pry"
|
12
|
+
require "copyrighter"
|
13
|
+
ARGV.clear
|
14
|
+
Pry.start
|
15
|
+
end
|
16
|
+
|
17
|
+
task default: :test
|
data/copyrighter.gemspec
CHANGED
@@ -1,17 +1,29 @@
|
|
1
|
-
#
|
2
|
-
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path("../lib", __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require "copyrighter/version"
|
3
5
|
|
4
|
-
Gem::Specification.new do |
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
gem.homepage = 'https://github.com/farski/copyrighter'
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "copyrighter"
|
8
|
+
spec.version = Copyrighter::VERSION
|
9
|
+
spec.authors = ["Chris Kalafarski"]
|
10
|
+
spec.email = ["chris@farski.com"]
|
10
11
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
12
|
+
spec.summary = "Conveniently output copyright date ranges"
|
13
|
+
spec.description = "Helper method for printed copyright dates, like `Copyright 1999-2012`"
|
14
|
+
spec.homepage = "https://github.com/farski/copyrighter"
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
18
|
+
spec.bindir = "exe"
|
19
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
20
|
+
spec.require_paths = ["lib"]
|
21
|
+
|
22
|
+
spec.add_development_dependency "bundler", "~> 1.10"
|
23
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
24
|
+
spec.add_development_dependency "minitest", "~> 5.8"
|
25
|
+
spec.add_development_dependency "coveralls", "~> 0"
|
26
|
+
spec.add_development_dependency "pry", "~> 0.10"
|
27
|
+
spec.add_development_dependency "dotenv", "~> 2.0"
|
28
|
+
spec.add_development_dependency "rubocop", "~> 0.34"
|
17
29
|
end
|
data/lib/copyrighter.rb
CHANGED
@@ -1,8 +1,9 @@
|
|
1
|
-
#
|
1
|
+
# coding: utf-8
|
2
2
|
|
3
|
-
require
|
3
|
+
require "copyrighter/version"
|
4
4
|
|
5
|
-
require
|
5
|
+
require "copyrighter/helpers"
|
6
|
+
require "copyrighter/railtie" if defined?(Rails)
|
6
7
|
|
7
8
|
module Copyrighter
|
8
9
|
end
|
data/lib/copyrighter/helpers.rb
CHANGED
@@ -1,14 +1,14 @@
|
|
1
|
-
#
|
1
|
+
# coding: utf-8
|
2
2
|
|
3
3
|
module Copyrighter
|
4
4
|
module Helpers
|
5
|
-
def ©(period, joiner = " – ")
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
5
|
+
def ©(period = Time.now.year, joiner = " – ")
|
6
|
+
case period
|
7
|
+
when Range then [period.begin, period.end]
|
8
|
+
when Time.now.year then [period]
|
9
|
+
else [period, Time.now.year]
|
10
10
|
end.compact.join(joiner)
|
11
11
|
end
|
12
|
-
|
12
|
+
alias_method :copyright, :©
|
13
13
|
end
|
14
14
|
end
|
data/lib/copyrighter/railtie.rb
CHANGED
data/lib/copyrighter/version.rb
CHANGED
metadata
CHANGED
@@ -1,24 +1,126 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: copyrighter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
5
|
-
prerelease:
|
4
|
+
version: 1.0.1
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Chris Kalafarski
|
9
8
|
autorequire:
|
10
|
-
bindir:
|
9
|
+
bindir: exe
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
13
|
-
dependencies:
|
14
|
-
|
11
|
+
date: 2015-10-28 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.10'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.10'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: minitest
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '5.8'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '5.8'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: coveralls
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: pry
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0.10'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0.10'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: dotenv
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '2.0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '2.0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rubocop
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0.34'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0.34'
|
111
|
+
description: Helper method for printed copyright dates, like `Copyright 1999-2012`
|
15
112
|
email:
|
16
113
|
- chris@farski.com
|
17
114
|
executables: []
|
18
115
|
extensions: []
|
19
116
|
extra_rdoc_files: []
|
20
117
|
files:
|
21
|
-
- .gitignore
|
118
|
+
- ".gitignore"
|
119
|
+
- ".hound.yml"
|
120
|
+
- ".rubocop.yml"
|
121
|
+
- ".ruby-style.yml"
|
122
|
+
- ".travis.yml"
|
123
|
+
- CODE_OF_CONDUCT.md
|
22
124
|
- Gemfile
|
23
125
|
- LICENSE
|
24
126
|
- README.md
|
@@ -29,27 +131,27 @@ files:
|
|
29
131
|
- lib/copyrighter/railtie.rb
|
30
132
|
- lib/copyrighter/version.rb
|
31
133
|
homepage: https://github.com/farski/copyrighter
|
32
|
-
licenses:
|
134
|
+
licenses:
|
135
|
+
- MIT
|
136
|
+
metadata: {}
|
33
137
|
post_install_message:
|
34
138
|
rdoc_options: []
|
35
139
|
require_paths:
|
36
140
|
- lib
|
37
141
|
required_ruby_version: !ruby/object:Gem::Requirement
|
38
|
-
none: false
|
39
142
|
requirements:
|
40
|
-
- -
|
143
|
+
- - ">="
|
41
144
|
- !ruby/object:Gem::Version
|
42
145
|
version: '0'
|
43
146
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
44
|
-
none: false
|
45
147
|
requirements:
|
46
|
-
- -
|
148
|
+
- - ">="
|
47
149
|
- !ruby/object:Gem::Version
|
48
150
|
version: '0'
|
49
151
|
requirements: []
|
50
152
|
rubyforge_project:
|
51
|
-
rubygems_version:
|
153
|
+
rubygems_version: 2.4.5.1
|
52
154
|
signing_key:
|
53
|
-
specification_version:
|
54
|
-
summary:
|
155
|
+
specification_version: 4
|
156
|
+
summary: Conveniently output copyright date ranges
|
55
157
|
test_files: []
|