berklee-valencia 0.3.0 → 0.3.1

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
  SHA256:
3
- metadata.gz: c48bdb68e6a29bd188073d0788a71b4bf943983b1b9558fa4f143f85f6c5e735
4
- data.tar.gz: 1a597db768565282bf7f205ce6ca887fbcff6bb1901e528cbd1b73024a807399
3
+ metadata.gz: deb5ed95768b350233449f1e7045a1fec6f61fe8b7665039625d5c9a4b9a1385
4
+ data.tar.gz: 7c8d363e267243df2e4d87b5d040f1091db965bd0c2ec9be22807b6d1632b053
5
5
  SHA512:
6
- metadata.gz: bc127b52a598c66dacd15c926dcdaa82a8c23540e0a080a96a329e64996e7d9ea9b6ca6a1b55c1fa0b2825ab8e86b51f9bdd1763a6c2cc19074216ae9d56bd70
7
- data.tar.gz: 63874aaad8ac760e927625589c1d89fefb46bbb2c8aff4723696c9e211c74bf2725ca929ff22a5a6f2223c8cb71aa2dda1639c4e9761de2dd8cdad8f58a6cd48
6
+ metadata.gz: 3f77060a9c068d176654f879f353fdefdcc70e2b02746e0aae2a14137b48fd1255367bf1540c7df3a11751d211aa7575165d03e582e2ced016eb67eace0d3254
7
+ data.tar.gz: 072cd06abb62f1e8667935db52e6c16cc214080310d20a785bfd48e0dbfede49f31734becf5ad9ce6fd7583f74b0ad9a5e348a025921e4b5eb7d1cd9064d1f54
@@ -35,6 +35,7 @@ class BerkleeValencia::CLI
35
35
  input = gets.strip.downcase
36
36
  if input.to_i.between?(1,2)
37
37
  please_wait
38
+ # case statement chosen over if statement for easy future extension
38
39
  case input
39
40
  when "1"
40
41
  list_article_categories
@@ -47,6 +48,9 @@ class BerkleeValencia::CLI
47
48
  end
48
49
 
49
50
  def list_article_categories
51
+ # if statement used so scrape only happens when necessary
52
+ # (it is necessary when a) a user wishes to view the articles and
53
+ # b) the articles have not already been scraped)
50
54
  if BerkleeValencia::ARTICLE.all == []
51
55
  BerkleeValencia::SCRAPER.make_articles
52
56
  end
@@ -1,5 +1,4 @@
1
1
  class Formatter
2
-
3
2
  def self.wrap(text, width=80)
4
3
  text.gsub(/(.{1,#{width}})(\s+|\Z)/, "\\1\n")
5
4
  end
@@ -64,7 +63,7 @@ class Formatter
64
63
  puts "#{urlwrap(" Visit #{(article.related_links.shift)}")}"
65
64
  puts "#{urlwrap(" Visit #{(article.related_links.shift)}")}"
66
65
  puts " - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -"
67
- elsif paragraph.match(/watch|listen/i) && paragraph.match(/:\s?\z/)
66
+ elsif paragraph.match(/^Watch|^Listen/i)
68
67
  puts " - - - - - - - - - - - - - - - - - Media - - - - - - - - - - - - - - - - - - -"
69
68
  puts "#{wrap(paragraph)}"
70
69
  puts "#{urlwrap(" Visit #{(article.related_links.shift)}")}"
@@ -1,3 +1,3 @@
1
1
  module BerkleeValencia
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: berklee-valencia
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gingertonic