guard-pdflatex 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/{LICENSE.txt → LICENSE} +0 -0
- data/guard-pdflatex.gemspec +12 -9
- data/lib/guard/pdflatex.rb +21 -4
- data/lib/guard/pdflatex/templates/Guardfile +3 -0
- data/lib/guard/pdflatex/version.rb +7 -2
- metadata +44 -7
data/{LICENSE.txt → LICENSE}
RENAMED
File without changes
|
data/guard-pdflatex.gemspec
CHANGED
@@ -1,23 +1,26 @@
|
|
1
1
|
# ~*~ encoding: utf-8 ~*~
|
2
|
-
|
3
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
2
|
+
$:.push File.expand_path('../lib', __FILE__)
|
4
3
|
require 'guard/pdflatex/version'
|
5
4
|
|
6
5
|
Gem::Specification.new do |gem|
|
7
6
|
|
8
|
-
gem.name =
|
7
|
+
gem.name = 'guard-pdflatex'
|
9
8
|
gem.version = Guard::Pdflatex::VERSION
|
10
|
-
gem.
|
11
|
-
gem.
|
12
|
-
gem.
|
13
|
-
gem.
|
14
|
-
gem.
|
9
|
+
gem.platform = Gem::Platform::RUBY
|
10
|
+
gem.authors = ['Jiunn Haur Lim']
|
11
|
+
gem.email = ['codex.is.poetry@gmail.com']
|
12
|
+
gem.description = %q{Guard gem for PDFLatex}
|
13
|
+
gem.summary = %q{Guard::Pdflatex automatically generates your PDF files from your Latex files}
|
14
|
+
gem.homepage = 'http://github.com/jimjh/guard-pdflatex'
|
15
15
|
|
16
16
|
gem.files = `git ls-files`.split($/)
|
17
17
|
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
18
18
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
19
|
-
gem.
|
19
|
+
gem.require_path = 'lib'
|
20
20
|
|
21
21
|
gem.add_dependency 'guard', '~> 1.6.2'
|
22
22
|
|
23
|
+
gem.add_development_dependency 'bundler'
|
24
|
+
gem.add_development_dependency 'rake'
|
25
|
+
|
23
26
|
end
|
data/lib/guard/pdflatex.rb
CHANGED
@@ -3,13 +3,30 @@ require 'guard/guard'
|
|
3
3
|
|
4
4
|
module Guard
|
5
5
|
|
6
|
+
# The PDFLatex Guard automatically compiles your latex files with pdflatex.
|
6
7
|
class Pdflatex < Guard
|
7
8
|
|
9
|
+
OPTIONS = {
|
10
|
+
title: 'PDFLatex'
|
11
|
+
}
|
12
|
+
|
13
|
+
# Gets called when all files should be regenerated.
|
14
|
+
# @raise [:task_has_failed] when stop has failed
|
15
|
+
def run_all
|
16
|
+
run_on_changes(Watcher.match_files(self, Dir.glob('**{,/*/**}/*.tex')))
|
17
|
+
end
|
18
|
+
|
19
|
+
# @param [Array<String>] paths of changed paths and files
|
20
|
+
# @raise [:task_has_failed] when stop has failed
|
8
21
|
def run_on_changes(paths)
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
22
|
+
failed = false
|
23
|
+
paths.each do |path|
|
24
|
+
unless system *%W[/usr/bin/env pdflatex -halt-on-error -output-directory=#{File.dirname path}], path
|
25
|
+
::Guard::Notifier.notify "PDFLatex halted on an error in #{path}", OPTIONS.merge(:image => :failed)
|
26
|
+
failed = true
|
27
|
+
end
|
28
|
+
end
|
29
|
+
throw :task_has_failed if failed
|
13
30
|
end
|
14
31
|
|
15
32
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: guard-pdflatex
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-03-
|
12
|
+
date: 2013-03-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: guard
|
@@ -27,7 +27,39 @@ dependencies:
|
|
27
27
|
- - ~>
|
28
28
|
- !ruby/object:Gem::Version
|
29
29
|
version: 1.6.2
|
30
|
-
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: bundler
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
type: :development
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: rake
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
description: Guard gem for PDFLatex
|
31
63
|
email:
|
32
64
|
- codex.is.poetry@gmail.com
|
33
65
|
executables: []
|
@@ -36,14 +68,14 @@ extra_rdoc_files: []
|
|
36
68
|
files:
|
37
69
|
- .gitignore
|
38
70
|
- Gemfile
|
39
|
-
- LICENSE
|
71
|
+
- LICENSE
|
40
72
|
- README.md
|
41
73
|
- Rakefile
|
42
74
|
- guard-pdflatex.gemspec
|
43
75
|
- lib/guard/pdflatex.rb
|
44
76
|
- lib/guard/pdflatex/templates/Guardfile
|
45
77
|
- lib/guard/pdflatex/version.rb
|
46
|
-
homepage:
|
78
|
+
homepage: http://github.com/jimjh/guard-pdflatex
|
47
79
|
licenses: []
|
48
80
|
post_install_message:
|
49
81
|
rdoc_options: []
|
@@ -55,17 +87,22 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
55
87
|
- - ! '>='
|
56
88
|
- !ruby/object:Gem::Version
|
57
89
|
version: '0'
|
90
|
+
segments:
|
91
|
+
- 0
|
92
|
+
hash: -846784840641240167
|
58
93
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
59
94
|
none: false
|
60
95
|
requirements:
|
61
96
|
- - ! '>='
|
62
97
|
- !ruby/object:Gem::Version
|
63
98
|
version: '0'
|
99
|
+
segments:
|
100
|
+
- 0
|
101
|
+
hash: -846784840641240167
|
64
102
|
requirements: []
|
65
103
|
rubyforge_project:
|
66
104
|
rubygems_version: 1.8.24
|
67
105
|
signing_key:
|
68
106
|
specification_version: 3
|
69
|
-
summary:
|
107
|
+
summary: Guard::Pdflatex automatically generates your PDF files from your Latex files
|
70
108
|
test_files: []
|
71
|
-
has_rdoc:
|