soa_codeschool 0.0.4 → 0.0.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: e64770ef944689c46dccb5b02dcc50309253ea52
4
- data.tar.gz: 66d9cd841e1f4eb5adc1789b17ffbe761a00cffb
3
+ metadata.gz: 337ab046dbd442251ed32be1955f6b384eae02bb
4
+ data.tar.gz: 69f14b363171e9760af89df3bb52230aeb9d0bf9
5
5
  SHA512:
6
- metadata.gz: d9a02d0407af6e6344083e71907ab1d60629c2a21ebf4acec82564e2fe560728ee71f9aed81a7fe1d060d0c0bd121d168e9169e850fb36cbd07bf918f2bc7ae3
7
- data.tar.gz: e0a73d30eb9a4dd1cc1a046106ca40fec308325f7114d6bf1b374297943a4a1cd9fe09f25ba0855fcd9649becaff110c36a97e79835cb3a70cb089b25c9f04db
6
+ metadata.gz: 6106af1dd432061780943391b1a49999e70b6852e14529e0a66cfd77705e632985923c5843301ba131685c162f6ae8a1e58dcfe61c9ba1586beec062604c34cc
7
+ data.tar.gz: d38426ce2ac80551766ef830dd1556d993481e259105a6bb04e6d4f6de0063d1966df2cb430d5c162b99271a0411538a70ff0db4fdb329d741e390bf3d88e453
data/README.md CHANGED
@@ -15,7 +15,7 @@ gem install soa_codeschool
15
15
  ### Command line usage
16
16
 
17
17
  ```
18
- soa_codeschool # Puts JSON array of code school courses and teachers to command line
18
+ codeschool # Puts JSON array of code school courses and teachers to command line
19
19
  ```
20
20
 
21
21
  ### Usage in ruby code
@@ -5,6 +5,8 @@ require 'json'
5
5
  # Scraper for CodeSchool website
6
6
  module CodeSchool
7
7
  COURSES = 'https://www.codeschool.com/courses'
8
+ COURSE_NAMES_XPATH = '//h2/a'
9
+ TEACHER_NAMES_XPATH = '//h3/a'
8
10
 
9
11
  # Gets array of courses
10
12
  def courses
@@ -18,7 +20,7 @@ module CodeSchool
18
20
 
19
21
  # Get an array of course names
20
22
  def course_names
21
- courses.xpath('//h2/a').map(&:text)
23
+ courses.xpath(COURSE_NAMES_XPATH).map(&:text)
22
24
  end
23
25
 
24
26
  # Change course names to urls
@@ -33,7 +35,7 @@ module CodeSchool
33
35
  # Get teachar's name by visiting each course page
34
36
  def teacher_names
35
37
  course_urls.map do |course_url|
36
- teacher(course_url).xpath('//h3/a').map(&:text)
38
+ teacher(course_url).xpath(TEACHER_NAMES_XPATH).map(&:text)
37
39
  end
38
40
  end
39
41
 
@@ -1,5 +1,5 @@
1
1
  # Gem info
2
2
  module CodeSchool
3
- VERSION = '0.0.4'
3
+ VERSION = '0.0.5'
4
4
  DATE = '2015-10-24'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: soa_codeschool
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - stozuka