vimgolf-finder 0.1.7 → 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 6fd87f3f5ed7b54a5fdeb59471f459c8adaf5c25
4
- data.tar.gz: 4ef16b6b09136fc84c125423f748fd12933ed9c0
2
+ SHA256:
3
+ metadata.gz: ecdf37d25dccd847f35afad840a47dc22c2f6cc149cddbc06613e6ac089e55a5
4
+ data.tar.gz: 19d602c1423e6c8f78f609d3981ecbed0cabcec5691f449261ac0a8b6c1977c7
5
5
  SHA512:
6
- metadata.gz: f4676df92fd79796cd6d46f66dd1af1ed0f7996442c9847ae01cf02ed4ca6a8cdb413f74ba5e7eab4089a885b006d7000e627cda0e894d9b9499dbdad0b2442b
7
- data.tar.gz: e9502cf5fe1db1d4b814d588b98ba5e2a1be19e199dff6580b5312a3057d5e76e9aa13907daf387be0b0238175178ed7ed51c056e918dc465587975c8116eedc
6
+ metadata.gz: 8b9edd0609ab95167e65c79481df886d6478d534abbd05d0ba954f8a1d9f1bd3c1a2f12265fbb80fac8e694bbcfb94f5080400d7f0d7b48ac85c0a11b14f520c
7
+ data.tar.gz: 64dadc65b6e7588265c914acf241803a3132fc81862107f1cbcfd933d5cdbe8bc6d9f1b5fff287ba827bb81d962eefb9c8384ddb86e9d47595ff980378ea4100
@@ -37,7 +37,7 @@ module VimGolfFinder
37
37
  end
38
38
 
39
39
  file.readlines.each do |line|
40
- if line.strip.eql?(self.id)
40
+ if line.eql?(self.id)
41
41
  return true
42
42
  end
43
43
  end
@@ -54,7 +54,7 @@ module VimGolfFinder
54
54
 
55
55
  number = VimGolfFinder.ui.ask 'Choose challenge number.'
56
56
  number = number.to_i
57
- if number.instance_of? Fixnum
57
+ if number.instance_of? Integer
58
58
  if number < 1 or number > limit
59
59
  VimGolfFinder.ui.error 'Invalid number'
60
60
  return
@@ -94,7 +94,7 @@ module VimGolfFinder
94
94
 
95
95
  number = VimGolfFinder.ui.ask 'Choose challenge number.'
96
96
  number = number.to_i
97
- if number.instance_of? Fixnum
97
+ if number.instance_of? Integer
98
98
  if number < 1 or number > solved_challenges.count
99
99
  VimGolfFinder.ui.error 'Invalid number'
100
100
  return
@@ -124,7 +124,10 @@ module VimGolfFinder
124
124
  result = VimGolfFinder.ui.ask 'Do you want to play? (y/n)'
125
125
 
126
126
  if result.eql?('y') || result.eql?('yes')
127
- system("vimgolf put #{id}")
127
+ if system("vimgolf put #{id}") == nil
128
+ VimGolfFinder.ui.error 'You need to install vimgolf. e.g. `gem install vimgolf`.'
129
+ return
130
+ end
128
131
 
129
132
  solves = VimGolfFinder.ui.ask 'Solves? (y/n)'
130
133
 
@@ -5,7 +5,7 @@ module VimGolfFinder
5
5
  def fetch_challenges
6
6
  challenges = []
7
7
 
8
- doc = Nokogiri::HTML(open(BASE_URL))
8
+ doc = Nokogiri::HTML(URI.open(BASE_URL))
9
9
  doc.css('.grid_7 > div').each do |div|
10
10
  challengeDOM = div.at_css('h5.challenge')
11
11
  aTAG = challengeDOM.at_css('a')
@@ -22,7 +22,7 @@ module VimGolfFinder
22
22
  def get_challenge(id)
23
23
  challenge = VimGolfFinder::Challenge.new
24
24
 
25
- doc = Nokogiri::HTML(open("#{BASE_URL}/challenges/#{id}", 'Accept' => 'text/html'))
25
+ doc = Nokogiri::HTML(URI.open("#{BASE_URL}/challenges/#{id}", 'Accept' => 'text/html'))
26
26
 
27
27
  doc.css('.grid_7:not(#about)').each do |dom|
28
28
  challenge.id = id
@@ -30,7 +30,7 @@ module VimGolfFinder
30
30
  challenge.description = dom.at_css('p').content
31
31
  challenge.start_file = dom.at_css('.prettyprint').content
32
32
  challenge.end_file = dom.css('.prettyprint')[1].content
33
- challenge.view_diff = dom.at_css('pre.diff').content
33
+ challenge.view_diff = dom.at_css('pre#diff').content
34
34
  end
35
35
 
36
36
  challenge
@@ -1,3 +1,3 @@
1
1
  module VimGolfFinder
2
- VERSION = '0.1.7'
2
+ VERSION = '0.1.8'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vimgolf-finder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lee Sun-Hyoup
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-01 00:00:00.000000000 Z
11
+ date: 2021-11-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -123,7 +123,7 @@ homepage: https://github.com/kciter/vimgolf-finder
123
123
  licenses:
124
124
  - MIT
125
125
  metadata: {}
126
- post_install_message:
126
+ post_install_message:
127
127
  rdoc_options: []
128
128
  require_paths:
129
129
  - lib
@@ -138,9 +138,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
138
138
  - !ruby/object:Gem::Version
139
139
  version: '0'
140
140
  requirements: []
141
- rubyforge_project:
142
- rubygems_version: 2.5.2
143
- signing_key:
141
+ rubygems_version: 3.1.2
142
+ signing_key:
144
143
  specification_version: 4
145
144
  summary: VimGolf challenge finder.
146
145
  test_files: []