apt_finder 0.1.4 → 0.1.5

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: c02f49e75636efa046dcf29daa98b00187921fcc
4
- data.tar.gz: a3c90e3078976b786c4304a11398e7f993505cb5
3
+ metadata.gz: 7cab558514168d8ca455378db6dbedcc975aa935
4
+ data.tar.gz: 836d301d2de286f0a4a09c3681f8de5fe768e6eb
5
5
  SHA512:
6
- metadata.gz: bc0fb4e7f08f9ecc645cbc0717f233347bd2ae85e2890763978259be87f0911aed528660ec36ccb14fa8bac0ad9f070cf7384bedd427b7cb275ccfd285004ca5
7
- data.tar.gz: 7d42ecb9e323ceb849ef05d9ed2e9896432c003ad40c8bf94891b9ad6baf0731f304b7451a4c7325743a260a18316a2a7fd83c94f317905965b4d05b3026e296
6
+ metadata.gz: cfafb4706fbcd70b7955382654af61ab8752e00da339b5e2717061a36541157fec6b4ed3afcc1f2cf8eecf060b273de39d663dc049419f442f409e9261919540
7
+ data.tar.gz: 7fe837200194e245429cbad7cf613c1023503ff2480d631bf363d3052f14f578eef117849ad7da998b293b400d5dc85078e95bd42a797750221ca3605360592e
data/README.md CHANGED
@@ -20,7 +20,9 @@ Or install it yourself as:
20
20
 
21
21
  ## Usage
22
22
 
23
- TODO: Write usage instructions here
23
+ After installing the gem
24
+
25
+ $ apt_finder
24
26
 
25
27
  ## Development
26
28
 
@@ -30,7 +32,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
30
32
 
31
33
  ## Contributing
32
34
 
33
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/apt_finder. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
35
+ Bug reports and pull requests are welcome on GitHub at https://github.com/yeungn/apt-finder-cli-gem. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
34
36
 
35
37
 
36
38
  ## License
Binary file
@@ -1,7 +1,6 @@
1
1
  class AptFinder::CLI
2
2
  def call
3
3
  puts "Welcome to Apt Finder"
4
-
5
4
  listings
6
5
  menu
7
6
  end
@@ -29,31 +28,34 @@ class AptFinder::CLI
29
28
  puts "-----------------------------------------------"
30
29
  puts doc.css('section.description').text.strip.gsub(/\n|\r/, '').gsub(/\s+/, ' ')
31
30
  puts ""
32
- puts "Enter the number of bedrooms:"
31
+ puts "Enter the number of bedroom(s) that you would like more info on:"
32
+ puts "0 = studio | 1 = one bedrooom | 2 = two bedroom"
33
33
  bedrooms = gets.strip
34
34
 
35
- if bedrooms >= "2"
36
- puts "not available"
37
- elsif bedrooms == "0"
38
- if doc.css('div.name')[0].text.downcase.strip.include?("studio")
39
- puts doc.css('div.name')[0].text.strip
40
- puts doc.css('#lease-terms .length')[0].text.strip
41
- puts doc.css('div.rent')[0].text.strip
42
- puts doc.css('div.available-now')[0].text.strip
43
- else
44
- puts "not available"
45
- end
35
+ if bedrooms == "0"
36
+ doc.css('div.name')[0] != nil
37
+ # doc.css('div.name')[0].text.downcase.strip.include?("studio")
38
+ puts doc.css('div.name')[0].text.strip
39
+ # puts doc.css('#lease-terms .length')[0].text.strip
40
+ puts doc.css('div.rent')[0].text.strip
41
+ puts doc.css('div.available-now')[0].text.strip
46
42
  elsif bedrooms == "1"
47
- if doc.css('div.name')[4].text.downcase.strip.include?("1 bedroom")
48
- puts doc.css('div.name')[4].text.strip
49
- puts doc.css('#lease-terms .length').text.strip
50
- puts doc.css('div.rent')[4].text.strip
51
- puts doc.css('div.available-now')[4].text.strip
52
- else
53
- puts "not available"
54
- end
43
+ doc.css('div.name')[4] != nil
44
+ # doc.css('div.name')[4].text.downcase.strip.include?("1 bedroom")
45
+ puts doc.css('div.name')[4].text.strip
46
+ # puts doc.css('#lease-terms .length').text.strip
47
+ puts doc.css('div.rent')[4].text.strip
48
+ puts doc.css('div.available-now')[4].text.strip
49
+ elsif bedrooms == "2"
50
+ doc.css('div.name')[9] != nil
51
+ # doc.css('div.name')[9].text.downcase.strip.include?("studio")
52
+ puts doc.css('div.name')[9].text.strip
53
+ # puts doc.css('#lease-terms .length')[9].text.strip
54
+ puts doc.css('div.rent')[9].text.strip
55
+ puts doc.css('div.available-now')[9].text.strip
56
+ else
57
+ puts "not available"
55
58
  end
56
-
57
59
  elsif input == "list"
58
60
  listings
59
61
  elsif input == "exit"
@@ -5,7 +5,7 @@ class AptFinder::Listings
5
5
  def self.listings
6
6
  doc = Nokogiri::HTML(open("http://www.apartmentfinder.com/New-York/New-York-Apartments"))
7
7
 
8
- doc.css('div.listingContent')[0..10].each_with_index do |list, index|
8
+ doc.css('div.listingContent')[0..9].each_with_index do |list, index|
9
9
  title = list.css('div.listingTitle').text.strip
10
10
  price = list.css('span.altRentDisplay').text.strip
11
11
  link = list.css('div.listingTitle a').attr('href').value
@@ -1,3 +1,3 @@
1
1
  module AptFinder
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: apt_finder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - yeungn
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-21 00:00:00.000000000 Z
11
+ date: 2016-09-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -96,6 +96,7 @@ files:
96
96
  - LICENSE.txt
97
97
  - README.md
98
98
  - Rakefile
99
+ - apt_finder-0.1.4.gem
99
100
  - apt_finder.gemspec
100
101
  - bin/apt_finder
101
102
  - bin/console