macaw-ruby 0.0.29 → 0.0.30

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: fa40f1c6c1298238c15a6f7659d1b3838e7e11f0
4
- data.tar.gz: 5d35d13ef99d835cc3dd6c28227cfe98596bf4a8
3
+ metadata.gz: b37d407a208c6f6fd19358b3275935fd01445419
4
+ data.tar.gz: bcbd2cff8f1c99b9497249561c3095c907b6a396
5
5
  SHA512:
6
- metadata.gz: 75622f2efcc1066198e9cdce20208a522ff15734ae149e2e0d7276987b952262c37081b11e3b3041aaa6a27101fd9ac17d0450c92b35372af68e5438114b1f04
7
- data.tar.gz: c094b5f8f2f52ea9f26a3abc229eba26bedb187c11d5f45333c9ab80d06c3a8c8ee286d20a398c8702d8eea4ce5024835db3eaa5754569d32af307cf0d198dfe
6
+ metadata.gz: d960ad2e088d5c6a41b1a796b33676308fbbf979a8cd9b686a4a5ed98e423c4194f105bbc7266713aa32414cd140fb6eb988bc0f1ca9a9d1dedac55045e62bb4
7
+ data.tar.gz: 516000ca6d8a6d59a7e87e5f055b14bebd1f53642590cf37092347dbdaafca02e2a70deae340316200bb3d06673027d033b4e050d53ea574719b5a2f853a3978
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- macaw-ruby (0.0.29)
4
+ macaw-ruby (0.0.30)
5
5
  i18n
6
6
  json_pure
7
7
  os
data/bin/macaw CHANGED
@@ -61,7 +61,7 @@ def options!
61
61
  options[:language] = lang.intern
62
62
  rescue I18n::InvalidLocale
63
63
  if !dryrun
64
- puts "#{lang.inspect} is not among the supported languages #{I18n.available_locales.inspect}"
64
+ puts I81n.t('error.InvalidLanguageConfigurationFile', languages: I18n.available_locales.collect{|l| l.to_s}.join(', '))
65
65
  exit
66
66
  end
67
67
  end
@@ -177,14 +177,21 @@ class Macaw
177
177
  error("No filename to process") if ARGV.size == 0
178
178
  error("Expected exactly one filename to process #{ARGV.inspect}") if ARGV.size != 1
179
179
  tex = File.file?(ARGV[0]) ? ARGV[0] : ARGV[0] + '.tex'
180
- error("#{ARGV[0].inspect} does not exist") if !File.exists?(tex)
180
+ error(I18n.t('error.FileDoesNotExist', file: tex)) if !File.exists?(tex)
181
181
 
182
182
  Macaw.load_rules
183
+
184
+ puts I18n.t('log.ProcessingFile', file: tex)
185
+
183
186
  macaw = Macaw.new(tex)
184
187
  @@log = File.open(macaw.base + '.log', 'w') if @@options.log
185
188
 
186
- IO.readlines(tex).each{|line|
189
+ executed = 0
190
+ IO.readlines(tex).each_with_index{|line, lineno|
191
+ @@lineno = lineno + 1
192
+
187
193
  next unless line =~ /^% arara: /
194
+ executed += 1
188
195
  line.strip!
189
196
  line.sub!(/^%\s+arara\s*:\s*/, '')
190
197
  data = line.split(':', 2).collect{|v| v.strip}
@@ -218,6 +225,12 @@ class Macaw
218
225
  puts "\n** #{line} **\n"
219
226
  macaw.send(cmd, *accept.collect{|k, v| params[v.to_s]})
220
227
  }
228
+
229
+ if executed == 0
230
+ puts I18n.t('log.NoDirectivesFound', file: tex)
231
+ else
232
+ puts I18n.t('log.Done')
233
+ end
221
234
  end
222
235
 
223
236
  def self.log(line, force=false)
@@ -13,7 +13,7 @@ en:
13
13
  Progress: print dots for progress
14
14
  log:
15
15
  WelcomeMessage: Welcome to arara %{0}!
16
- ProcessingFile: Processing file ''%{0}'', please wait.
16
+ ProcessingFile: Processing file '%{file}', please wait.
17
17
  Done: Done.
18
18
  ExceptionRaised: 'Arara raised an exception with the following message:'
19
19
  ReadyToRunCommands: Ready to run commands.
@@ -31,7 +31,7 @@ en:
31
31
  Slogan: The cool TeX automation tool
32
32
  AllRightsReserved: All rights reserved.
33
33
  msg:
34
- NoDirectivesFound: I didn''t find any directives in ''%{0}'', and so didn''t do
34
+ NoDirectivesFound: I didn''t find any directives in '%{file}', and so didn't do
35
35
  anything. Is that what you really wanted?
36
36
  SpecialThanks: A special thanks goes to %{contributors}, and many others for making this humble tool possible.
37
37
  RunningCommand: Running %{0}...
@@ -43,14 +43,14 @@ en:
43
43
  Problem: 'Problem: %{0}'
44
44
  ErrorLocation: Error found in line %{0}, column %{1}.
45
45
  error:
46
- FileDoesNotExistWithExtensionsList: I''m sorry, but the file ''%{0} %{1}'' does
46
+ FileDoesNotExistWithExtensionsList: I'm sorry, but the file '%{0} %{1}' does
47
47
  not exist. Note that when you provide only the basename (i.e, the filename without
48
48
  the extension) or with an unknown extension, arara will try to look for files
49
49
  ending with the predefined extensions %{1} in that order. You can override the
50
50
  order, the search pattern or even add support for new extensions through the
51
51
  configuration file. Please refer to the arara manual to learn more about this
52
52
  feature.
53
- FileDoesNotExist: File ''%{0}'' does not exist.
53
+ FileDoesNotExist: File '%{file}' does not exist.
54
54
  CommandNotFound: "\\nI''m sorry, but the command from the ''%{0}'' task could
55
55
  not be found. Are you sure the command ''%{1}'' is correct, or even accessible
56
56
  from the system path?"
@@ -63,7 +63,7 @@ en:
63
63
  a proper configuration file is provided.
64
64
  InvalidLanguageConfigurationFile: 'Houston, we have a problem. Sadly, the language
65
65
  set in the configuration file is not valid. Currently, arara can provide support
66
- for the following languages: %{0}. Make sure to choose a valid language or remove
66
+ for the following languages: %{languages}. Make sure to choose a valid language or remove
67
67
  the entry from the configuration file (the field is optional), otherwise arara
68
68
  cannot proceed.'
69
69
  InvalidFiletypesConfigurationFile: I'm sorry, but it seems your configuration
@@ -0,0 +1,10 @@
1
+ require 'process'
2
+ # sumatrapdf rule for arara
3
+ class Macaw
4
+ def sumatrapdf
5
+ Macaw.log('spawning sumatrapdf...')
6
+
7
+ pdf = ~"#{@base}.pdf"
8
+ Process.spawn "sumatrapdf -reuse-instance #{pdf}"
9
+ end
10
+ end
data/lib/macaw/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class Macaw
2
- VERSION = "0.0.29"
2
+ VERSION = "0.0.30"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: macaw-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.29
4
+ version: 0.0.30
5
5
  platform: ruby
6
6
  authors:
7
7
  - Emiliano Heyns
@@ -159,6 +159,7 @@ files:
159
159
  - lib/macaw/rules/ps2pdf.rb
160
160
  - lib/macaw/rules/sketch.rb
161
161
  - lib/macaw/rules/songidx.rb
162
+ - lib/macaw/rules/sumatrapdf.rb
162
163
  - lib/macaw/rules/tex.rb
163
164
  - lib/macaw/rules/xdvipdfmx.rb
164
165
  - lib/macaw/rules/xelatex.rb