dyndoc-ruby 0.9.9 → 0.9.10

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: da77cb91f143261ef5cef6cf89d0f4016ec88580
4
- data.tar.gz: f3c3229874249cc9854e401ed4c504d92a9ff681
3
+ metadata.gz: c81dd8a9551bdc7f5a9c2a9983b7568a04177d1b
4
+ data.tar.gz: 0df86ae57457b9942c9bf95026a56508e278177e
5
5
  SHA512:
6
- metadata.gz: 655ae2027b9ad6ef19c9f911430db1e019d19631dcbc33018283b5246985a0393df95c4f673442c836f5d32fb5a30542c6cebc80e692a0527afd255513399e1a
7
- data.tar.gz: 23a84c99eb88da27b1a718f72042bbe4b89d3d102a77629d2604eefdaff312824a4b4203694837bd8c11e512770611d0b652ea177ce616f48e6b05c911e55c5c
6
+ metadata.gz: c077688cc61442b83de175fd70348ab8e647669c4fb65ed67f5d69618f9a012849566d3de8d4c2b2cd1300ab7b5cbaf63f6503f1800623c18d13ca29bba2e921
7
+ data.tar.gz: c747435c400a740f51968c0c9911a01de11b0fd3037c8c5ea48f7054e3e61cd716ca1c3e7e8a9e5046075c27ced825f3cbbb39ccd85f5849d3d5c711de650cdd
@@ -65,7 +65,7 @@ module Dyndoc
65
65
  ##p [:filename,filename]
66
66
  if [:changed,:new].include? event and File.extname(filename) == ".dyn"
67
67
  ##p [:filename_event,event,filename]
68
- if Dyndoc::Linter.check_file(filename).empty?
68
+ if (lint_error=Dyndoc::Linter.check_file(filename)).empty?
69
69
  ## find dyn_file (relative path from root)
70
70
  dyn_file="/"+Pathname(filename).relative_path_from(Pathname(dyn_root)).to_s
71
71
  opts_doc=Dyndoc::FileWatcher.get_dyn_html_info(filename,dyn_file,opts[:user])
@@ -94,7 +94,14 @@ ENDREFRESH
94
94
  end
95
95
  end
96
96
  else
97
- puts filename+" not well-formed!"
97
+ if RUBY_PLATFORM =~ /darwin/
98
+ p lint_error
99
+ cmd_to_display='display notification "' +lint_error.map{|e| e[0].to_s+") "+e[1].to_s}.join('" & "')+ '" with title "Lint Error:'+filename+'"'
100
+ p cmd_to_display
101
+ `osascript -e '#{cmd_to_display}'`
102
+ else
103
+ puts "Lint Error: "+filename+" with "+lint_error.inspect
104
+ end
98
105
  end
99
106
  end
100
107
  end
data/lib/dyndoc-linter.rb CHANGED
@@ -28,13 +28,17 @@ module Dyndoc
28
28
 
29
29
  end
30
30
 
31
+ def Linter.guess_bad_opentags(txt)
32
+ selected_opentags=txt.scan(/(?:\{[\#\@](?:[\w\:\|-]*[<>]?[=?!><]?(?:\.\w*)?)\})/).each_with_index.map{|e,i| [i+1,e] }
33
+ end
34
+
31
35
  def Linter.check_content(txt)
32
36
  Dyndoc::Linter.simplify_dyndoc_tags(Dyndoc::Linter.selected_tags(txt))
33
37
  end
34
38
 
35
39
  def Linter.check_file(file_to_lint)
36
40
  txt=File.read(file_to_lint)
37
- Dyndoc::Linter.check_content(txt)
41
+ Dyndoc::Linter.check_content(txt) + Dyndoc::Linter.guess_bad_opentags(txt)
38
42
  end
39
43
  end
40
44
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dyndoc-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.9
4
+ version: 0.9.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - RCqls
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-16 00:00:00.000000000 Z
11
+ date: 2016-12-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: R4rb