election_day 0.1.0 → 0.1.1

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: 97585098fe11bb7fe6cd704e9a2a77421ce7b7ce
4
- data.tar.gz: cd644e4652f7b13542f943b50112a785c7242579
3
+ metadata.gz: aedfe7d53827fe093a8ca037083c62c9291c38b6
4
+ data.tar.gz: 543856fbafce3365912cd4a2eb9a4f8b66c702ff
5
5
  SHA512:
6
- metadata.gz: 5bf47fda4864ddef0883018051b704aa307110d722d1e818143979a992b43122d39881f74f494b40a0e6bf3b70edb32ebf9e9843f5d35d99923b0d7283a60e1a
7
- data.tar.gz: 3952543a03527fcefe83ec06fd558322e724823f04de3571e5f2453b7d6c3776f66fab53a02aaaa89717d22e42c2a30b4bd1298bac02d991b02efff2b429831a
6
+ metadata.gz: 1fb8b5be860eea049d66e76be1a7561c76915abde32a831c86900250cee411eb27b74db9e2937d8ac99e8960e81f8d5845091eaa4c3ebd2c95387052c1c4b0a6
7
+ data.tar.gz: 664047f11d41020cec55745bdaf1af85e870a5212a80b7e2bbdceeda5cab136fbfe2ec5eb16d64fdb7cb4857a99660b8221c324287a9dc95ac2330758f1c5416
@@ -2,3 +2,6 @@ language: ruby
2
2
  rvm:
3
3
  - 2.3.0
4
4
  before_install: gem install bundler -v 1.11.2
5
+ addons:
6
+ code_climate:
7
+ repo_token: ac00023f67d815abde2c39f89e12445fb0f688c74a114d81598865711537a4e5
@@ -0,0 +1,7 @@
1
+ # Changelog
2
+
3
+ ## 0.1.1 (2016-10-16)
4
+ - Improve documentation for RubyDoc
5
+
6
+ ## 0.1.0 (2016-10-16)
7
+ - Initial release
data/README.md CHANGED
@@ -1,6 +1,9 @@
1
1
  # Election Day
2
2
 
3
+ [![Gem Version](https://badge.fury.io/rb/election_day.svg)](https://badge.fury.io/rb/election_day)
3
4
  [![Build Status](https://travis-ci.org/jcypret/election_day.svg?branch=master)](https://travis-ci.org/jcypret/election_day)
5
+ [![Code Climate](https://codeclimate.com/github/jcypret/election_day/badges/gpa.svg)](https://codeclimate.com/github/jcypret/election_day)
6
+ [![Test Coverage](https://codeclimate.com/github/jcypret/election_day/badges/coverage.svg)](https://codeclimate.com/github/jcypret/election_day/coverage)
4
7
 
5
8
  ## Installation
6
9
 
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
9
9
  spec.authors = ["Justin Cypret"]
10
10
  spec.email = ["jcypret@gmail.com"]
11
11
 
12
- spec.summary = %q{A library extracted from raisethemoney.com to calculate Election Day.}
12
+ spec.summary = %q{A library to calculate when U.S. Election Day occurs.}
13
13
  spec.homepage = "https://github.com/jcypret/election_day"
14
14
 
15
15
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
@@ -21,4 +21,5 @@ Gem::Specification.new do |spec|
21
21
  spec.add_development_dependency "rake", "~> 10.0"
22
22
  spec.add_development_dependency "rspec", "~> 3.0"
23
23
  spec.add_development_dependency "timecop", "~> 0.8.1"
24
+ spec.add_development_dependency "codeclimate-test-reporter"
24
25
  end
@@ -1,35 +1,52 @@
1
1
  require "election_day/version"
2
2
 
3
+ # A library to calculate when U.S. Election Day occurs.
4
+ #
3
5
  # "The Tuesday next after the first Monday in the month of November"
4
6
  # -- The 28th Congress (http://memory.loc.gov/ll/llsl/005/0700/07590721.tif)
5
7
  module ElectionDay
6
8
 
7
- # Returns `true` if current year is an election year.
9
+ # Checks whether year is an election year.
10
+ #
11
+ # @param year [Integer] the year to check
12
+ # @return [Boolean] whether year is an election year
8
13
  def self.election_year?(year = Date.today.year)
9
14
  year.even?
10
15
  end
11
16
 
12
- # Returns `true` if current year is a midterm election year.
17
+ # Checks whether year is a midterm election year.
18
+ #
19
+ # @param year [Integer] the year to check
20
+ # @return [Boolean] whether year is a midterm election year
13
21
  def self.midterm_election_year?(year = Date.today.year)
14
22
  (year + 2) % 4 == 0
15
23
  end
16
24
 
17
- # Returns `true` if current year is a presidential election year.
25
+ # Checks whether year is a presidential election year.
26
+ #
27
+ # @param year [Integer] the year to check
28
+ # @return [Boolean] whether year is a presidential election year
18
29
  def self.presidential_election_year?(year = Date.today.year)
19
30
  year % 4 == 0
20
31
  end
21
32
 
22
- # Returns the `Date` of the next election.
33
+ # Returns the date of the next election.
34
+ #
35
+ # @return [Date] the date of the next election
23
36
  def self.next_election
24
37
  get_next_election(&:election_year?)
25
38
  end
26
39
 
27
- # Returns the `Date` of the next midterm election.
40
+ # Returns the date of the next midterm election.
41
+ #
42
+ # @return [Date] the date of the next midterm election
28
43
  def self.next_midterm_election
29
44
  get_next_election(&:midterm_election_year?)
30
45
  end
31
46
 
32
- # Returns the `Date` of the next presidential election.
47
+ # Returns the date of the next presidential election.
48
+ #
49
+ # @return [Date] the date of the next presidential election
33
50
  def self.next_presidential_election
34
51
  get_next_election(&:presidential_election_year?)
35
52
  end
@@ -1,3 +1,3 @@
1
1
  module ElectionDay
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: election_day
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Cypret
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-10-16 00:00:00.000000000 Z
11
+ date: 2016-10-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -66,6 +66,20 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: 0.8.1
69
+ - !ruby/object:Gem::Dependency
70
+ name: codeclimate-test-reporter
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
69
83
  description:
70
84
  email:
71
85
  - jcypret@gmail.com
@@ -76,6 +90,7 @@ files:
76
90
  - ".gitignore"
77
91
  - ".rspec"
78
92
  - ".travis.yml"
93
+ - CHANGELOG.md
79
94
  - CODE_OF_CONDUCT.md
80
95
  - Gemfile
81
96
  - README.md
@@ -107,5 +122,5 @@ rubyforge_project:
107
122
  rubygems_version: 2.5.1
108
123
  signing_key:
109
124
  specification_version: 4
110
- summary: A library extracted from raisethemoney.com to calculate Election Day.
125
+ summary: A library to calculate when U.S. Election Day occurs.
111
126
  test_files: []