parliament-grom-decorators 0.1.7 → 0.1.8

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: c1f63912e3e943808a3c19b71aaf4d91e4779392
4
- data.tar.gz: 23e7cab82e27341e5cc054d0afacf314caa4c4bf
3
+ metadata.gz: f9eccfea6e21b092fc52ea3e1aed8c56ab194829
4
+ data.tar.gz: 2b48179a06242dec5bc249562e1b6e9883afc8d8
5
5
  SHA512:
6
- metadata.gz: 2b007328ad5f76db1d2ac219f527c1ab00986841d92a9f092b8e74898209889eb57bd8085087400d97a036bf1cdd90928409c912bed25de258836d40c450d4ad
7
- data.tar.gz: af910edb99fced421aa1953972010fca15fc63df8f9e5413f8250abc77a83d20f5daad9e4997d636001ee3295f2be4fb58e04ef48ee62c8dfbf89b4e45de5370
6
+ metadata.gz: b608664eeb2bd36f722fd16e197f51945ebf9f23156dc5caac4cdb5e5243af42e644fab1e115f5cb0b5c89d7f77d3a5a5034e753131213b8642d6cc8a8074d92
7
+ data.tar.gz: 6445598cb56db9c5e48c70e7b8a7a843c2f2ef1c68ad8685d0deea0414602cdb6cbb54730012cbcb208041d40ca142979517da1eeee269115c566c00df4268ba
@@ -39,6 +39,13 @@ module Parliament
39
39
  def previous_parliament?
40
40
  respond_to?(:parliamentPeriodHasImmediatelyPreviousParliamentPeriod)
41
41
  end
42
+
43
+ # Checks if Grom::Node is current - ie. it has a start date in the past or today and an end date which is nil, today or in the future.
44
+ #
45
+ # @return [Boolean] a boolean depending on whether or not the Grom::Node is current.
46
+ def current?
47
+ (!start_date.nil? && start_date <= Date.today) && (end_date.nil? || end_date >= Date.today)
48
+ end
42
49
  end
43
50
  end
44
51
  end
@@ -1,7 +1,7 @@
1
1
  module Parliament
2
2
  module Grom
3
3
  module Decorator
4
- VERSION = '0.1.7'.freeze
4
+ VERSION = '0.1.8'.freeze
5
5
  end
6
6
  end
7
7
  end
@@ -29,5 +29,5 @@ Gem::Specification.new do |spec|
29
29
  spec.add_development_dependency 'webmock', '~> 2.3'
30
30
  spec.add_development_dependency 'parliament-ruby'
31
31
  spec.add_development_dependency 'parliament-ntriple', '~> 0.1'
32
- spec.add_development_dependency 'pry'
32
+ spec.add_development_dependency 'timecop', '~> 0.8'
33
33
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: parliament-grom-decorators
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rebecca Appleyard
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-06-05 00:00:00.000000000 Z
11
+ date: 2017-06-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -137,19 +137,19 @@ dependencies:
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0.1'
139
139
  - !ruby/object:Gem::Dependency
140
- name: pry
140
+ name: timecop
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
- - - ">="
143
+ - - "~>"
144
144
  - !ruby/object:Gem::Version
145
- version: '0'
145
+ version: '0.8'
146
146
  type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
- - - ">="
150
+ - - "~>"
151
151
  - !ruby/object:Gem::Version
152
- version: '0'
152
+ version: '0.8'
153
153
  description: Parliamentary Grom decorator
154
154
  email:
155
155
  - rklappleyard@gmail.com
@@ -209,7 +209,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
209
209
  version: '0'
210
210
  requirements: []
211
211
  rubyforge_project:
212
- rubygems_version: 2.6.12
212
+ rubygems_version: 2.6.11
213
213
  signing_key:
214
214
  specification_version: 4
215
215
  summary: Parliamentary Grom decorator