lomax 0.1.0 → 0.1.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
  SHA1:
3
- metadata.gz: c724d91995c1faf03826505e82c363464bf2395f
4
- data.tar.gz: e3cc2e1194fa4fad34d770aa33fa051ac4f864cc
3
+ metadata.gz: 5c2b275ee53a2bc299a82d2a3ba5fa6b4f474a36
4
+ data.tar.gz: 463b41afb3a8a3ff727610a4efca57cc5b52aa35
5
5
  SHA512:
6
- metadata.gz: b07dcf44cde5e450e3e19f3447e146413e5c7550994188e4480f533e1fa3a8b797f76aa480abf1c9c5c937952bc8369dc2798beee9b8ec0c10da083ac0b97e76
7
- data.tar.gz: cd70883df1ff16edb4ee343f0a1d5ab14fab437ecc1edb2dc5bb5d4a7f2647d0d1738081d966ad3f6cd881c3fe163a94f7a1650852e3f6abe9430c6e6bf9ffef
6
+ metadata.gz: bcf69844ce76782a0739e3aac2679138e62df450e0498e9e90973b1b35334b812b6c58ed1c25bbb48936ddc8ecbe7b0128c8df6936a1b8c4642856f25079a397
7
+ data.tar.gz: 4f90bb46a14b3cdfa727d106472719442e64175df89303fdabeaf215d479d1f30763c50be0962717076ab471c693b47c2ddcd800e288ba74d0a15850a19bbdd9
@@ -10,5 +10,5 @@ require "lomax"
10
10
  require "pry"
11
11
  Pry.start
12
12
 
13
- require "irb"
13
+ #require "irb"
14
14
  #IRB.start
@@ -12,7 +12,6 @@ class Lomax::CommandLineInterface
12
12
  def display_recordings(place)
13
13
  puts
14
14
  puts
15
- list_of_recordings = []
16
15
  recordings = Lomax::Scraper.get_recordings(place)
17
16
  recordings.each do |recording|
18
17
  puts recording.title, recording.date
@@ -36,7 +35,7 @@ class Lomax::CommandLineInterface
36
35
  return title
37
36
  end
38
37
 
39
- def user_validation
38
+ def place_validation
40
39
  puts
41
40
  display_places
42
41
  city_answer = gets.chomp #it is a string
@@ -44,7 +43,7 @@ class Lomax::CommandLineInterface
44
43
  choice = places_array.detect do |place|
45
44
  place.name.downcase == city_answer.downcase
46
45
  end
47
- return choice
46
+ return choice #is a place object
48
47
  end
49
48
 
50
49
 
@@ -61,9 +60,9 @@ class Lomax::CommandLineInterface
61
60
 
62
61
  flag = nil
63
62
  while flag == nil #these two lines basically say, "if everything remians as it now is..."
64
- flag = user_validation
63
+ flag = place_validation
65
64
  if flag != nil
66
- recordings = display_recordings(flag)
65
+ recordings = display_recordings(flag) #array of recording objects
67
66
  titles_array = recordings.collect do|recording|
68
67
  recording.title
69
68
  end
@@ -27,16 +27,13 @@ class Lomax::Scraper
27
27
 
28
28
  def self.get_recordings(place)
29
29
  doc = Nokogiri::HTML(open(place.url + "&c=150&st=list"))
30
- recordings_array = []
31
30
  doc.css(".search-results.list-view > li").each do |item|
32
31
  title = item.css("div.description h2 a").text.strip
33
32
  contributors = item.css("ul li.contributor span").text.strip
34
33
  date = item.css("ul li.date span").text.strip
35
- recordings_array << Lomax::Recording.new(title,contributors,date,place)
36
- end
37
- place.recordings = recordings_array
38
-
39
- return recordings_array
34
+ place.recordings << Lomax::Recording.new(title,contributors,date,place)
35
+ end
36
+ return place.recordings
40
37
  end
41
38
 
42
39
 
@@ -1,3 +1,3 @@
1
1
  module Lomax
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: lomax
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
  - nicolefederici
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-07-08 00:00:00.000000000 Z
11
+ date: 2016-07-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler