dbc_today 2.0.5 → 2.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 872881a17240d9c8b62125e12a8a778c6ddfba67
4
- data.tar.gz: 1d1ea3ee40aa22ffd9cf5583c8a9919c94a47963
3
+ metadata.gz: a845a25b6bc2af798044d250bb59a4211cb7c467
4
+ data.tar.gz: b5d8b220a4c1322f94a269784a4b9e811c12805c
5
5
  SHA512:
6
- metadata.gz: 318c5d54b2e294786f0c6dbe672a3bc94748ccf14c21be5535217f3873480174725d57a015d717e77ad8685b8f80aa5c9c70ef9d3b0d8cc1249cfd660b4f244c
7
- data.tar.gz: 7d3e15ab9c5e68fc533fbe2a114360fd329c435d868cc5b7207179c748559ce051b214c7100d7f57d9b57f535847a251b278e9628a86c8cdc175dc75a74635af
6
+ metadata.gz: 423b337a27e0859bef975a957d35309deb98f8cff29914bdaae84e77aedba72c3a21dc26b6e6d8fb25255b43d6e92d523f22d51d57beb839796277a623a94636
7
+ data.tar.gz: 2e6254eeafb03f2fecb81a95dbef6254df5a8e6093f6d77f410b59450d37dbb0bd8ca3b5828c58a5e9dea661080575f278336f954905238aac4eea73e822e5d8
@@ -9,9 +9,9 @@ class Event
9
9
  @phase = attributes.fetch(:phase)
10
10
  @week = attributes.fetch(:week)
11
11
  @day = attributes.fetch(:day)
12
- @description = attributes.fetch(:description, nil)
13
- @start_time = attributes.fetch(:start_time, nil)
14
- @end_time = attributes.fetch(:end_time, nil)
12
+ @description = attributes.fetch(:description)
13
+ @start_time = attributes.fetch(:start_time)
14
+ @end_time = attributes.fetch(:end_time)
15
15
  end
16
16
 
17
17
  def all_day?
@@ -47,22 +47,23 @@ class Event
47
47
  def self.where(args)
48
48
  all.select { |event|
49
49
  nil_or_match(event.phase, args[:phase]) &&
50
- nil_or_match(event.week, args[:week]) &&
51
- nil_or_match(event.day, args[:day])
50
+ nil_or_match(event.week, args[:week]) &&
51
+ nil_or_match(event.day, args[:day])
52
52
  }.sort_by { |e| e.start_time_military }
53
53
  end
54
54
 
55
55
  private
56
56
 
57
57
  def starts_at_day_start?
58
- start_time.start_with?('9:00a') ||
59
- start_time.start_with?('9a')
58
+ return false if start_time.nil?
59
+
60
+ start_time.start_with?('9:00a', '9a')
60
61
  end
61
62
 
62
63
  def ends_at_day_end?
63
- end_time.nil? ||
64
- end_time.start_with?('6:00p') ||
65
- end_time.start_with?('6p')
64
+ return false if end_time.nil?
65
+
66
+ end_time.start_with?('6:00p', '6p')
66
67
  end
67
68
 
68
69
  def self.nil_or_match(attribute_value, value_to_match)
@@ -26,12 +26,12 @@ class Topic
26
26
  def self.where(args)
27
27
  all.select { |topic|
28
28
  topic.phase == args[:phase] &&
29
- topic.week == args[:week] &&
30
- topic.day == args[:day]
29
+ topic.week == args[:week] &&
30
+ topic.day == args[:day]
31
31
  }
32
32
  end
33
33
 
34
34
  def self.current_directory
35
- File.expand_path File.dirname(__FILE__)
35
+ File.expand_path File.dirname(__FILE__)
36
36
  end
37
37
  end
@@ -1,3 +1,3 @@
1
1
  module DbcToday
2
- VERSION = "2.0.5"
2
+ VERSION = "2.0.6"
3
3
  end
@@ -3,7 +3,7 @@ require 'colorize'
3
3
  class EventsView
4
4
  def display(events)
5
5
  puts "\nSCHEDULE".bold
6
- puts "#{header_row}"
6
+ puts header_row
7
7
 
8
8
  events.each do |event|
9
9
  puts event_row(event)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dbc_today
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.5
4
+ version: 2.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Stewart