omgtex 0.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: a6d52445a398c7c8586ce71dbd8ccd61e8e0bd2c
4
+ data.tar.gz: 7adcfda8b3c48c30a1c833bfb843482527fb2ea4
5
+ SHA512:
6
+ metadata.gz: 7670780db8db77a2e0156cda6b33a5b176e680dd06ab7ac625cd7c94d8bb80ad053a60557484ebf979984bc0628d350a885bc30ca73554b13763f17849afa561
7
+ data.tar.gz: 73ba20b1c0029bb618b8837de25901363aa7da1325469cc8fa09bdf3176fe6fe966d251190710bdf983e8adb23b0d242fa3b46108bc969db93cc434ac6f89864
data/.document ADDED
@@ -0,0 +1,5 @@
1
+ lib/**/*.rb
2
+ bin/*
3
+ -
4
+ features/**/*.feature
5
+ LICENSE.txt
data/Gemfile ADDED
@@ -0,0 +1,15 @@
1
+ source "http://rubygems.org"
2
+ # Add dependencies required to use your gem here.
3
+ # Example:
4
+ # gem "activesupport", ">= 2.3.5"
5
+
6
+ # Add dependencies to develop your gem here.
7
+ # Include everything needed to run rake, tests, features, etc.
8
+ group :development do
9
+ gem "minitest", ">= 0"
10
+ gem "yard", "~> 0.7"
11
+ gem "rdoc", "~> 3.12"
12
+ gem "bundler", "~> 1.0"
13
+ gem "jeweler", "~> 2.0.1"
14
+ gem "simplecov", ">= 0"
15
+ end
data/Gemfile.lock ADDED
@@ -0,0 +1,67 @@
1
+ GEM
2
+ remote: http://rubygems.org/
3
+ specs:
4
+ addressable (2.3.8)
5
+ builder (3.2.2)
6
+ descendants_tracker (0.0.4)
7
+ thread_safe (~> 0.3, >= 0.3.1)
8
+ docile (1.1.5)
9
+ faraday (0.9.1)
10
+ multipart-post (>= 1.2, < 3)
11
+ git (1.2.9.1)
12
+ github_api (0.12.3)
13
+ addressable (~> 2.3)
14
+ descendants_tracker (~> 0.0.4)
15
+ faraday (~> 0.8, < 0.10)
16
+ hashie (>= 3.3)
17
+ multi_json (>= 1.7.5, < 2.0)
18
+ nokogiri (~> 1.6.3)
19
+ oauth2
20
+ hashie (3.4.1)
21
+ highline (1.7.2)
22
+ jeweler (2.0.1)
23
+ builder
24
+ bundler (>= 1.0)
25
+ git (>= 1.2.5)
26
+ github_api
27
+ highline (>= 1.6.15)
28
+ nokogiri (>= 1.5.10)
29
+ rake
30
+ rdoc
31
+ json (1.8.2)
32
+ jwt (1.4.1)
33
+ mini_portile (0.6.2)
34
+ minitest (5.6.1)
35
+ multi_json (1.11.0)
36
+ multi_xml (0.5.5)
37
+ multipart-post (2.0.0)
38
+ nokogiri (1.6.6.2)
39
+ mini_portile (~> 0.6.0)
40
+ oauth2 (1.0.0)
41
+ faraday (>= 0.8, < 0.10)
42
+ jwt (~> 1.0)
43
+ multi_json (~> 1.3)
44
+ multi_xml (~> 0.5)
45
+ rack (~> 1.2)
46
+ rack (1.6.0)
47
+ rake (10.4.2)
48
+ rdoc (3.12.2)
49
+ json (~> 1.4)
50
+ simplecov (0.10.0)
51
+ docile (~> 1.1.0)
52
+ json (~> 1.8)
53
+ simplecov-html (~> 0.10.0)
54
+ simplecov-html (0.10.0)
55
+ thread_safe (0.3.5)
56
+ yard (0.8.7.6)
57
+
58
+ PLATFORMS
59
+ ruby
60
+
61
+ DEPENDENCIES
62
+ bundler (~> 1.0)
63
+ jeweler (~> 2.0.1)
64
+ minitest
65
+ rdoc (~> 3.12)
66
+ simplecov
67
+ yard (~> 0.7)
data/LICENSE.txt ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2015 Lucas Jenss
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,9 @@
1
+ # omgtex
2
+
3
+ Building LaTeX has never been easier™. A revolutionary, awesome and amazing tool to run `pdflatex` three times in a row.
4
+
5
+ ## Copyright
6
+
7
+ Copyright (c) 2015 Lucas Jenss. See LICENSE.txt for
8
+ further details.
9
+
data/Rakefile ADDED
@@ -0,0 +1,45 @@
1
+ # encoding: utf-8
2
+
3
+ require 'rubygems'
4
+ require 'bundler'
5
+ begin
6
+ Bundler.setup(:default, :development)
7
+ rescue Bundler::BundlerError => e
8
+ $stderr.puts e.message
9
+ $stderr.puts "Run `bundle install` to install missing gems"
10
+ exit e.status_code
11
+ end
12
+ require 'rake'
13
+
14
+ require 'jeweler'
15
+ Jeweler::Tasks.new do |gem|
16
+ # gem is a Gem::Specification... see http://guides.rubygems.org/specification-reference/ for more options
17
+ gem.name = "omgtex"
18
+ gem.homepage = "http://github.com/x3ro/omgtex"
19
+ gem.license = "MIT"
20
+ gem.summary = %Q{Basically runs pdflatex for you.}
21
+ gem.description = %Q{Builds your LaTeX files by running pdflatex an appropriate* amount of times.}
22
+ gem.email = "lucas@x3ro.de"
23
+ gem.authors = ["Lucas Jenss"]
24
+ gem.executables = ["omgtex"]
25
+ # dependencies defined in Gemfile
26
+ end
27
+ Jeweler::RubygemsDotOrgTasks.new
28
+
29
+ require 'rake/testtask'
30
+ Rake::TestTask.new(:test) do |test|
31
+ test.libs << 'lib' << 'test'
32
+ test.pattern = 'test/**/test_*.rb'
33
+ test.verbose = true
34
+ end
35
+
36
+ desc "Code coverage detail"
37
+ task :simplecov do
38
+ ENV['COVERAGE'] = "true"
39
+ Rake::Task['test'].execute
40
+ end
41
+
42
+ task :default => :test
43
+
44
+ require 'yard'
45
+ YARD::Rake::YardocTask.new
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.0.0
data/bin/omgtex ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ lib = File.expand_path(File.dirname(__FILE__) + '/../lib')
4
+ $LOAD_PATH.unshift(lib) if File.directory?(lib) && !$LOAD_PATH.include?(lib)
5
+
6
+ require 'omgtex'
7
+
8
+ Omgtex::Runner.run!
@@ -0,0 +1,46 @@
1
+ require 'optparse'
2
+
3
+ module Omgtex
4
+ class Options
5
+
6
+ def self.parse!
7
+ options = {:latexOptions => [ ]}
8
+
9
+ optparse = OptionParser.new do|opts|
10
+ opts.banner = "Usage: omgtex [options] file.tex"
11
+
12
+ options[:openpdf] = false
13
+ opts.on('-o', '--open', 'Open PDF file after rendering') do
14
+ options[:openpdf] = true
15
+ end
16
+
17
+ options[:bibtex] = false
18
+ opts.on('-b', '--bibtex', 'Run BibTeX as well') do
19
+ options[:bibtex] = true
20
+ end
21
+
22
+ options[:glossary] = false
23
+ opts.on('-g', '--glossary', 'Generate glossary file') do
24
+ options[:glossary] = true
25
+ end
26
+
27
+ opts.on('-e', '--shell-escape', 'Shell escape-ish') do
28
+ options[:latexOptions].push("-shell-escape")
29
+ end
30
+
31
+ opts.on('-h', '--help', 'Display this message') do
32
+ puts opts
33
+ exit
34
+ end
35
+
36
+ opts.on('-l COMMAND', '--latex', 'Command to be passed to LateX command') do |l|
37
+ options[:latexOptions].push(l)
38
+ end
39
+
40
+ end
41
+ optparse.parse!
42
+ options
43
+
44
+ end
45
+ end
46
+ end
@@ -0,0 +1,35 @@
1
+ module Omgtex
2
+ class Runner
3
+
4
+ def self.run!
5
+ options = Options.parse!
6
+
7
+ abort("A single input file must be specified") if ARGV.length != 1
8
+ file = ARGV.shift
9
+
10
+ abort("No .tex file was specified") if ( file =~ /(.*?)(\.tex)/ ).nil?
11
+ filename = $1
12
+ filetype = $2
13
+
14
+ latexCommand = "pdflatex #{options[:latexOptions].join(' ')}"
15
+
16
+ file = "'#{file}'"
17
+ pdffile = "'#{filename}.pdf'"
18
+ auxfile = "'#{filename}.aux'"
19
+
20
+ cmd = " if [ -e '#{auxfile}' ]; then HASH=$(md5 -q #{auxfile}); fi"
21
+ cmd += " && #{latexCommand} #{file}"
22
+ cmd += " && makeglossaries #{filename}" if options[:glossary]
23
+ cmd += " && if [ \"$HASH\" != \"$(md5 -q #{auxfile})\" ]; then "
24
+ cmd += " echo ''" # Dummy so that the following &&s dont break
25
+ cmd += " && bibtex #{filename}" if options[:bibtex]
26
+ cmd += " && #{latexCommand} #{file}"
27
+ cmd += " && #{latexCommand} #{file} ;"
28
+ cmd += " fi"
29
+ cmd += " && open #{pdffile}" if options[:openpdf]
30
+
31
+ Kernel.exec(cmd)
32
+ end
33
+
34
+ end
35
+ end
data/lib/omgtex.rb ADDED
@@ -0,0 +1,2 @@
1
+ require 'omgtex/options'
2
+ require 'omgtex/runner'
data/omgtex.gemspec ADDED
@@ -0,0 +1,70 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
+ # -*- encoding: utf-8 -*-
5
+ # stub: omgtex 0.0.0 ruby lib
6
+
7
+ Gem::Specification.new do |s|
8
+ s.name = "omgtex"
9
+ s.version = "0.0.0"
10
+
11
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
+ s.require_paths = ["lib"]
13
+ s.authors = ["Lucas Jenss"]
14
+ s.date = "2015-05-17"
15
+ s.description = "Builds your LaTeX files by running pdflatex an appropriate* amount of times."
16
+ s.email = "lucas@x3ro.de"
17
+ s.executables = ["omgtex"]
18
+ s.extra_rdoc_files = [
19
+ "LICENSE.txt",
20
+ "README.md"
21
+ ]
22
+ s.files = [
23
+ ".document",
24
+ "Gemfile",
25
+ "Gemfile.lock",
26
+ "LICENSE.txt",
27
+ "README.md",
28
+ "Rakefile",
29
+ "VERSION",
30
+ "bin/omgtex",
31
+ "lib/omgtex.rb",
32
+ "lib/omgtex/options.rb",
33
+ "lib/omgtex/runner.rb",
34
+ "omgtex.gemspec",
35
+ "test/helper.rb",
36
+ "test/test_omgtex.rb"
37
+ ]
38
+ s.homepage = "http://github.com/x3ro/omgtex"
39
+ s.licenses = ["MIT"]
40
+ s.rubygems_version = "2.2.2"
41
+ s.summary = "Basically runs pdflatex for you."
42
+
43
+ if s.respond_to? :specification_version then
44
+ s.specification_version = 4
45
+
46
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
47
+ s.add_development_dependency(%q<minitest>, [">= 0"])
48
+ s.add_development_dependency(%q<yard>, ["~> 0.7"])
49
+ s.add_development_dependency(%q<rdoc>, ["~> 3.12"])
50
+ s.add_development_dependency(%q<bundler>, ["~> 1.0"])
51
+ s.add_development_dependency(%q<jeweler>, ["~> 2.0.1"])
52
+ s.add_development_dependency(%q<simplecov>, [">= 0"])
53
+ else
54
+ s.add_dependency(%q<minitest>, [">= 0"])
55
+ s.add_dependency(%q<yard>, ["~> 0.7"])
56
+ s.add_dependency(%q<rdoc>, ["~> 3.12"])
57
+ s.add_dependency(%q<bundler>, ["~> 1.0"])
58
+ s.add_dependency(%q<jeweler>, ["~> 2.0.1"])
59
+ s.add_dependency(%q<simplecov>, [">= 0"])
60
+ end
61
+ else
62
+ s.add_dependency(%q<minitest>, [">= 0"])
63
+ s.add_dependency(%q<yard>, ["~> 0.7"])
64
+ s.add_dependency(%q<rdoc>, ["~> 3.12"])
65
+ s.add_dependency(%q<bundler>, ["~> 1.0"])
66
+ s.add_dependency(%q<jeweler>, ["~> 2.0.1"])
67
+ s.add_dependency(%q<simplecov>, [">= 0"])
68
+ end
69
+ end
70
+
data/test/helper.rb ADDED
@@ -0,0 +1,35 @@
1
+ require 'simplecov'
2
+
3
+ module SimpleCov::Configuration
4
+ def clean_filters
5
+ @filters = []
6
+ end
7
+ end
8
+
9
+ SimpleCov.configure do
10
+ clean_filters
11
+ load_adapter 'test_frameworks'
12
+ end
13
+
14
+ ENV["COVERAGE"] && SimpleCov.start do
15
+ add_filter "/.rvm/"
16
+ end
17
+ require 'rubygems'
18
+ require 'bundler'
19
+ begin
20
+ Bundler.setup(:default, :development)
21
+ rescue Bundler::BundlerError => e
22
+ $stderr.puts e.message
23
+ $stderr.puts "Run `bundle install` to install missing gems"
24
+ exit e.status_code
25
+ end
26
+ require 'minitest/unit'
27
+
28
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
29
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
30
+ require 'omgtex'
31
+
32
+ class MiniTest::Unit::TestCase
33
+ end
34
+
35
+ MiniTest::Unit.autorun
@@ -0,0 +1,7 @@
1
+ require 'helper'
2
+
3
+ class TestOmgtex < MiniTest::Unit::TestCase
4
+ def test_something_for_real
5
+ flunk "hey buddy, you should probably rename this file and start testing for real"
6
+ end
7
+ end
metadata ADDED
@@ -0,0 +1,145 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: omgtex
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Lucas Jenss
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-05-17 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: minitest
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: yard
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '0.7'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '0.7'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rdoc
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '3.12'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '3.12'
55
+ - !ruby/object:Gem::Dependency
56
+ name: bundler
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '1.0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '1.0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: jeweler
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: 2.0.1
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: 2.0.1
83
+ - !ruby/object:Gem::Dependency
84
+ name: simplecov
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ description: Builds your LaTeX files by running pdflatex an appropriate* amount of
98
+ times.
99
+ email: lucas@x3ro.de
100
+ executables:
101
+ - omgtex
102
+ extensions: []
103
+ extra_rdoc_files:
104
+ - LICENSE.txt
105
+ - README.md
106
+ files:
107
+ - ".document"
108
+ - Gemfile
109
+ - Gemfile.lock
110
+ - LICENSE.txt
111
+ - README.md
112
+ - Rakefile
113
+ - VERSION
114
+ - bin/omgtex
115
+ - lib/omgtex.rb
116
+ - lib/omgtex/options.rb
117
+ - lib/omgtex/runner.rb
118
+ - omgtex.gemspec
119
+ - test/helper.rb
120
+ - test/test_omgtex.rb
121
+ homepage: http://github.com/x3ro/omgtex
122
+ licenses:
123
+ - MIT
124
+ metadata: {}
125
+ post_install_message:
126
+ rdoc_options: []
127
+ require_paths:
128
+ - lib
129
+ required_ruby_version: !ruby/object:Gem::Requirement
130
+ requirements:
131
+ - - ">="
132
+ - !ruby/object:Gem::Version
133
+ version: '0'
134
+ required_rubygems_version: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
139
+ requirements: []
140
+ rubyforge_project:
141
+ rubygems_version: 2.2.2
142
+ signing_key:
143
+ specification_version: 4
144
+ summary: Basically runs pdflatex for you.
145
+ test_files: []