octodown 1.5.1 → 1.5.2

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
2
  SHA1:
3
- metadata.gz: 126e123df867f9960f1825a8ec461574bf0dceaa
4
- data.tar.gz: 3ff055a9a976e85c70704b96e2b5d21be370c0ea
3
+ metadata.gz: b2014389d722bdf1f9a125def2450eeb22cb4e76
4
+ data.tar.gz: 219cdb334a1035a0b4b334ded79c0ee8255f6d70
5
5
  SHA512:
6
- metadata.gz: 95f0e275044ae65f247b73143ec1e5cf2cb78240caae2f5d6ce54819eeb5d0cbeb06d8fd3a461ef79584945533953245d53a67d79b848dda9ebd70ec2d1ec55a
7
- data.tar.gz: 57c8b33b28591e9edb9025dc5e4c221c3bca593243b6e84d044f214fbcc06983f63b25370d997ed71062fd9726c0e31c8bd923bb0122281554dc9c6ba7d3757c
6
+ metadata.gz: d47c9da8f49e13660920ed5de23a360dcb13025514faee44fa57124fe0324b148bcd2db5b74bb5a6d4e208d13982ac09f9559ff26a04d270d90285de81573dfe
7
+ data.tar.gz: 716449ed4fbb3df0e2a34873cee0bbfa6cf5a4046bd14e9626a2716ce5f680df3b58cf97a75f7ce3e84d215ba338f44002bf8d592b543bd62ea3e41a301c5c48
@@ -20,11 +20,13 @@ module Octodown
20
20
  if file == STDIN
21
21
  buffer = file.read
22
22
  else
23
- File.open(file.path, 'r') do |f|
24
- buffer = f.read
23
+ begin
24
+ File.open(file.path, 'r') { |f| buffer = f.read }
25
+ rescue Errno::ENOENT
26
+ puts '[WARN] something went wrong when trying to open the file'
25
27
  end
26
28
  end
27
- pipeline.call(buffer)[:output].to_s
29
+ pipeline.call(buffer ||= 'could not read changes')[:output].to_s
28
30
  end
29
31
 
30
32
  private
@@ -8,8 +8,8 @@ module Octodown
8
8
  path = File.dirname(File.expand_path(file.path))
9
9
  regex = Regexp.new("^#{File.basename(file.path)}$")
10
10
 
11
- @listener ||= Listen.to(path, only: regex) do
12
- listener_callback.call
11
+ @listener ||= Listen.to(path, only: regex) do |modified, added, _rm|
12
+ listener_callback.call if modified.any? || added.any?
13
13
  end
14
14
 
15
15
  @listener.start
@@ -1,3 +1,3 @@
1
1
  module Octodown
2
- VERSION = '1.5.1'.freeze
2
+ VERSION = '1.5.2'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: octodown
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.1
4
+ version: 1.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ian Ker-Seymer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-09-21 00:00:00.000000000 Z
11
+ date: 2017-09-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: github-markup