copyrighter 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in copyrighter.gemspec
4
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2012 Chris Kalafarski
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,17 @@
1
+ # Copyrighter
2
+
3
+ Handy way to print out copyright dates, like in a footer.
4
+
5
+ Assuming it's 2012,
6
+
7
+ © 2012 will print "2012"
8
+
9
+ Next year it will automatically change to "2012 - 2013"
10
+
11
+ You can give it either an integer or a range of integers.
12
+
13
+ You can also provide an optional second argument, which is what will join the start and end of the range
14
+
15
+ © 1999, '-' => "1999-2012"
16
+ © 1999, ' - ' => "1999 - 2012"
17
+ © 1999, ':' => "1999:2012"
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env rake
2
+ require "bundler/gem_tasks"
@@ -0,0 +1,17 @@
1
+ # -*- encoding: utf-8 -*-
2
+ require File.expand_path('../lib/copyrighter/version', __FILE__)
3
+
4
+ Gem::Specification.new do |gem|
5
+ gem.authors = ["Chris Kalafarski"]
6
+ gem.email = ["chris@farski.com"]
7
+ gem.description = %q{Conveniently output copyright date ranges}
8
+ gem.summary = %q{}
9
+ gem.homepage = ""
10
+
11
+ gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
12
+ gem.files = `git ls-files`.split("\n")
13
+ gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
14
+ gem.name = "copyrighter"
15
+ gem.require_paths = ["lib"]
16
+ gem.version = Copyrighter::VERSION
17
+ end
@@ -0,0 +1,13 @@
1
+ # -*- coding: utf-8 -*-
2
+
3
+ module Copyrighter
4
+ module Helpers
5
+ def ©(period, joiner = " – ")
6
+ return case period
7
+ when Range then [period.begin, period.end]
8
+ when Time.now.year then [period]
9
+ else [period, Time.now.year]
10
+ end.compact.join(joiner)
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,8 @@
1
+ require './copyrighter/helpers'
2
+ module Copyrighter
3
+ class Railtie < Rails::Railtie
4
+ initializer "copyrighter.helpers" do
5
+ ActionView::Base.send :include, Helpers
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,3 @@
1
+ module Copyrighter
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,15 @@
1
+ # -*- coding: utf-8 -*-
2
+
3
+ require './copyrighter/version'
4
+
5
+ require './copyrighter/railtie' if defined?(Rails)
6
+
7
+ module Copyrighter
8
+ def ©(period, joiner = " – ")
9
+ return case period
10
+ when Range then [period.begin, period.end]
11
+ when Time.now.year then [period]
12
+ else [period, Time.now.year]
13
+ end.compact.join(joiner)
14
+ end
15
+ end
metadata ADDED
@@ -0,0 +1,55 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: copyrighter
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Chris Kalafarski
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-01-25 00:00:00.000000000 Z
13
+ dependencies: []
14
+ description: Conveniently output copyright date ranges
15
+ email:
16
+ - chris@farski.com
17
+ executables: []
18
+ extensions: []
19
+ extra_rdoc_files: []
20
+ files:
21
+ - .gitignore
22
+ - Gemfile
23
+ - LICENSE
24
+ - README.md
25
+ - Rakefile
26
+ - copyrighter.gemspec
27
+ - lib/copyrighter.rb
28
+ - lib/copyrighter/helpers.rb
29
+ - lib/copyrighter/railtie.rb
30
+ - lib/copyrighter/version.rb
31
+ homepage: ''
32
+ licenses: []
33
+ post_install_message:
34
+ rdoc_options: []
35
+ require_paths:
36
+ - lib
37
+ required_ruby_version: !ruby/object:Gem::Requirement
38
+ none: false
39
+ requirements:
40
+ - - ! '>='
41
+ - !ruby/object:Gem::Version
42
+ version: '0'
43
+ required_rubygems_version: !ruby/object:Gem::Requirement
44
+ none: false
45
+ requirements:
46
+ - - ! '>='
47
+ - !ruby/object:Gem::Version
48
+ version: '0'
49
+ requirements: []
50
+ rubyforge_project:
51
+ rubygems_version: 1.8.11
52
+ signing_key:
53
+ specification_version: 3
54
+ summary: ''
55
+ test_files: []