gist-compile 1.0.0 → 1.0.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: 9c4bd9dbe5020d4965553e70a1ae39171088f5c0
4
- data.tar.gz: e6cd0f355096c1ed7671f8c9d780c7a258c8efa5
3
+ metadata.gz: 1817e65a64c0abf9f0c8720bd03f226d8d5817bc
4
+ data.tar.gz: 1d8a517d938cdb819e3e5db3485a417d2dfc22e1
5
5
  SHA512:
6
- metadata.gz: 1318a5500e9af65b993d955718713dcb2092fe4e33c5b02ca370dfd6f5ac2aea06e6439659507aa31745f6cdb0ee9e2e0b5e77a0b71bf72b8bd50fb13a028d33
7
- data.tar.gz: 4a8a222b148131033cb292642c06482d515ec4f79b32e90d9242b39e133a3da96debda8487720d9f77d77c4cee2d818ccbc9fc2287b363663850f1200e4025d7
6
+ metadata.gz: b03d9c95041da0c5506beafaedb8611de7e6f3230bd69b3822654ec88371435f81e0cc8ecdd616e68ecc697c7d4f7e548382a70707b243b7ed4a54269e086a9b
7
+ data.tar.gz: 7dba1f96ea74af6e8f8cd3d85672eeeb880fda6ce2d195da82a29c337d0bdf88378b5be48449d22beb3b9216b8a129116895a26989458f27c8cf6da3ce5a5c09
data/README.md CHANGED
@@ -39,4 +39,4 @@ A few rules:
39
39
  3. You must include a section and a subsection.
40
40
 
41
41
 
42
- [View the results here](https://github.com/claymcleod/gist-compile/tree/master/prod).
42
+ [View the results here](https://github.com/claymcleod/gist-compile/tree/master/gc_products).
data/bin/gist-compile CHANGED
@@ -38,21 +38,32 @@ class GistCompile < Thor
38
38
  username_urls = []
39
39
 
40
40
  usernames.each do |u|
41
- username_urls.push(URI::join(GIST_BASE_URL+'/', u.strip()).to_s)
41
+ begin
42
+ username_urls.push(URI::join(GIST_BASE_URL+'/', u.strip()).to_s)
43
+ rescue => e
44
+ puts "Uh oh! Could not find user with name: "+u.strip()
45
+ end
42
46
  end
43
47
 
44
48
  username_urls.each do |username_url|
45
49
  page = 1
46
50
  while page < 1000
47
- gist_url_current_page = URI::join(username_url+'/', "?page=#{page}").to_s
48
- raw_html = Nokogiri::HTML(RestClient.get(gist_url_current_page))
49
- new_elements = raw_html.css(GIST_XPATH_IDENTIFIER)
50
- if new_elements.length == 0
51
+ begin
52
+ gist_url_current_page = URI::join(username_url+'/', "?page=#{page}").to_s
53
+ raw_html = Nokogiri::HTML(RestClient.get(gist_url_current_page))
54
+ new_elements = raw_html.css(GIST_XPATH_IDENTIFIER)
55
+ if new_elements.length == 0
56
+ break
57
+ else
58
+ elements.concat(new_elements)
59
+ end
60
+ page = page + 1
61
+ rescue => e
62
+ if page == 1
63
+ puts "Error loading user: "+username_url.sub(GIST_BASE_URL, '').sub('/','')
64
+ end
51
65
  break
52
- else
53
- elements.concat(new_elements)
54
66
  end
55
- page = page + 1
56
67
  end
57
68
  end
58
69
 
data/gist-compile.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'gist-compile'
3
- s.version = '1.0.0'
3
+ s.version = '1.0.1'
4
4
  s.date = '2015-02-22'
5
5
  s.summary = "Gist-compile will compile Github gists into an intelligible, book like, form."
6
6
  s.description = ""
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gist-compile
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Clay McLeod