condom 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/{CHANGELOG → CHANGELOG.rdoc} +6 -4
- data/README.rdoc +83 -0
- data/bin/condom +12 -7
- metadata +6 -6
- data/README +0 -85
@@ -1,9 +1,11 @@
|
|
1
|
-
0.1.
|
2
|
-
|
1
|
+
== 0.1.1
|
2
|
+
|
3
|
+
Made the executable prettier (confirmation and help).
|
4
|
+
|
5
|
+
== 0.1.0
|
3
6
|
|
4
7
|
Added the language option. This option should be a LaTeX language. Default is 'francais'.
|
5
8
|
|
6
|
-
0.0.1
|
7
|
-
=====
|
9
|
+
== 0.0.1
|
8
10
|
|
9
11
|
Initial version of Condom gem.
|
data/README.rdoc
ADDED
@@ -0,0 +1,83 @@
|
|
1
|
+
= Condom
|
2
|
+
|
3
|
+
A Ruby lib to create a skeleton for a LaTeX document.
|
4
|
+
|
5
|
+
== Installation
|
6
|
+
|
7
|
+
$ gem install condom
|
8
|
+
|
9
|
+
== Usage
|
10
|
+
|
11
|
+
For the usage of the lib, see the documentation (gem server for example).
|
12
|
+
|
13
|
+
Condom gem provides a condom shell command.
|
14
|
+
|
15
|
+
$ condom --help
|
16
|
+
Usage: condom [options] [destination]
|
17
|
+
Available options:
|
18
|
+
-m, --math Math packages
|
19
|
+
-l, --listings Listings package
|
20
|
+
-f, --fancyhdr Fancyhdr package
|
21
|
+
-p, --pdf PDF config
|
22
|
+
-g, --graphics Images packages
|
23
|
+
-n, --filename=FILENAME Define a file name
|
24
|
+
-a, --author=AUTHOR Define the author
|
25
|
+
-t, --title=TITLE Define the title
|
26
|
+
-d, --date=DATE Define the date
|
27
|
+
-c, --class=CLASS Define the document class
|
28
|
+
-L, --language=LANGUAGE Define the language
|
29
|
+
-P, --package=PACKAGE Add another package
|
30
|
+
-v, --version Print version
|
31
|
+
destination:
|
32
|
+
/home/v0n (current directory)
|
33
|
+
|
34
|
+
In generated files, there is a Makefile.
|
35
|
+
Just use your document (from the source folder) like below.
|
36
|
+
|
37
|
+
compile with:
|
38
|
+
$ make
|
39
|
+
or compile and open with:
|
40
|
+
$ make view
|
41
|
+
clean sources (remove .out, .toc, etc. files) with:
|
42
|
+
$ make clean
|
43
|
+
archive the whole document with:
|
44
|
+
$ make archive
|
45
|
+
|
46
|
+
== Technique
|
47
|
+
|
48
|
+
The following command:
|
49
|
+
$ condom -mlfpg -t "Condom makes LaTeX easier" here
|
50
|
+
|
51
|
+
will generate:
|
52
|
+
$ tree here/
|
53
|
+
here/
|
54
|
+
├── fig
|
55
|
+
├── fig.tex
|
56
|
+
├── inc
|
57
|
+
│ ├── colors.tex
|
58
|
+
│ ├── commands.tex
|
59
|
+
│ ├── lst-conf.tex
|
60
|
+
│ └── packages.tex
|
61
|
+
├── main.tex
|
62
|
+
├── Makefile
|
63
|
+
└── src
|
64
|
+
|
65
|
+
=== fig/
|
66
|
+
This is the folder where you should put your images.
|
67
|
+
|
68
|
+
=== inc/
|
69
|
+
This folder has all configuration tex files:
|
70
|
+
* colors.tex - customized colors
|
71
|
+
* commands.tex - customized commands
|
72
|
+
* lst-conf.tex - configuration file for the listings package
|
73
|
+
* packages - all needed packages
|
74
|
+
|
75
|
+
=== main.tex
|
76
|
+
The main tex file. If you specify a filename with -n option, then the generated pdf file will have this name, not the main tex file.
|
77
|
+
|
78
|
+
=== Makefile
|
79
|
+
Makefile to manage your document sources easily (see the usage above).
|
80
|
+
|
81
|
+
=== src/
|
82
|
+
This is the folder where to put listings (a result of -l option).
|
83
|
+
|
data/bin/condom
CHANGED
@@ -7,14 +7,13 @@
|
|
7
7
|
|
8
8
|
require 'condom'
|
9
9
|
require 'optparse'
|
10
|
-
require 'yaml'
|
10
|
+
#require 'yaml'
|
11
11
|
|
12
12
|
ops = Condom::Document::DEFAULT_OPTIONS
|
13
13
|
|
14
14
|
ARGV.options do |o|
|
15
15
|
o.banner = "Usage: #{File.basename $0} [options] [destination]\n"
|
16
|
-
o.on_head("
|
17
|
-
|
16
|
+
o.on_head("\nAvailable options:")
|
18
17
|
o.on("-m", "--math", "Math packages") { ops[:math] = true }
|
19
18
|
o.on("-l", "--listings", "Listings package") { ops[:listings] = true }
|
20
19
|
o.on("-f", "--fancyhdr", "Fancyhdr package") { ops[:fancyhdr] = true }
|
@@ -28,8 +27,6 @@ ARGV.options do |o|
|
|
28
27
|
o.on("-L", "--language=LANGUAGE", String, "Define the language") { |v| ops[:language] = v }
|
29
28
|
o.on("-P", "--package=PACKAGE", String, "Add another package") { |v| ops[:packages].push v }
|
30
29
|
#o.on("-v", "--version", "Print version") { puts "Condom lib: version #{Condom::VERSION}" ; exit }
|
31
|
-
|
32
|
-
o.on_tail("destination:\n " << ops[:outputdir] + (ops[:outputdir] == Dir.getwd ? " (current directory)" : ""))
|
33
30
|
end
|
34
31
|
|
35
32
|
begin
|
@@ -41,7 +38,15 @@ begin
|
|
41
38
|
end
|
42
39
|
|
43
40
|
# Ask for confirmation
|
44
|
-
|
41
|
+
ops.each do |key, val|
|
42
|
+
value = case val
|
43
|
+
when true: "yes"
|
44
|
+
when false: "no"
|
45
|
+
when Array: val.join(", ")
|
46
|
+
else val
|
47
|
+
end
|
48
|
+
printf "%-15s=> %s\n", key, value
|
49
|
+
end
|
45
50
|
print "\nContinue [Y/n/h]? "
|
46
51
|
case STDIN.gets.strip
|
47
52
|
when 'Y', 'y', ''
|
@@ -56,7 +61,7 @@ begin
|
|
56
61
|
doc = Condom::Document.new(ops)
|
57
62
|
doc.create
|
58
63
|
|
59
|
-
puts "
|
64
|
+
puts "Document created in #{doc.outputdir}."
|
60
65
|
rescue => e
|
61
66
|
STDERR.puts "error: #{e}"
|
62
67
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: condom
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 25
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 1
|
10
|
+
version: 0.1.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Vivien Didelot
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-08-
|
18
|
+
date: 2010-08-12 00:00:00 +10:00
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|
@@ -38,8 +38,8 @@ files:
|
|
38
38
|
- lib/views/Makefile.erb
|
39
39
|
- lib/views/commands.tex.erb
|
40
40
|
- lib/condom.rb
|
41
|
-
- README
|
42
|
-
- CHANGELOG
|
41
|
+
- README.rdoc
|
42
|
+
- CHANGELOG.rdoc
|
43
43
|
- bin/condom
|
44
44
|
has_rdoc: true
|
45
45
|
homepage:
|
data/README
DELETED
@@ -1,85 +0,0 @@
|
|
1
|
-
Condom
|
2
|
-
------
|
3
|
-
|
4
|
-
A Ruby lib to create a skeleton for a LaTeX document.
|
5
|
-
|
6
|
-
Installation
|
7
|
-
------------
|
8
|
-
|
9
|
-
$ gem install condom
|
10
|
-
|
11
|
-
Usage
|
12
|
-
-----
|
13
|
-
|
14
|
-
For the usage of the lib, see the documentation (gem server for example).
|
15
|
-
|
16
|
-
Condom gem provides a condom shell command.
|
17
|
-
|
18
|
-
$ condom --help
|
19
|
-
Usage: condom [options] [destination]
|
20
|
-
Available options:
|
21
|
-
-m, --math Math packages
|
22
|
-
-l, --listings Listings package
|
23
|
-
-f, --fancyhdr Fancyhdr package
|
24
|
-
-p, --pdf PDF config
|
25
|
-
-g, --graphics Images packages
|
26
|
-
-n, --filename=FILENAME Define a file name
|
27
|
-
-a, --author=AUTHOR Define the author
|
28
|
-
-t, --title=TITLE Define the title
|
29
|
-
-d, --date=DATE Define the date
|
30
|
-
-c, --class=CLASS Define the document class
|
31
|
-
-P, --package=PACKAGE Add another package
|
32
|
-
-v, --version Print version
|
33
|
-
destination:
|
34
|
-
/home/v0n (current directory)
|
35
|
-
|
36
|
-
In generated files, there is a Makefile.
|
37
|
-
Just use your document this way (from the source folder):
|
38
|
-
- compile with:
|
39
|
-
$ make
|
40
|
-
or
|
41
|
-
$ make view # this will open the generated document after
|
42
|
-
|
43
|
-
- clean sources with:
|
44
|
-
$ make clean
|
45
|
-
|
46
|
-
- archive the whole document with:
|
47
|
-
$ make archive
|
48
|
-
|
49
|
-
Technique
|
50
|
-
---------
|
51
|
-
|
52
|
-
The following command:
|
53
|
-
$ condom -mlfpg -t "Condom makes LaTeX easier" here
|
54
|
-
|
55
|
-
will generate:
|
56
|
-
here/
|
57
|
-
├── fig
|
58
|
-
├── fig.tex
|
59
|
-
├── inc
|
60
|
-
│ ├── colors.tex
|
61
|
-
│ ├── commands.tex
|
62
|
-
│ ├── lst-conf.tex
|
63
|
-
│ └── packages.tex
|
64
|
-
├── main.tex
|
65
|
-
├── Makefile
|
66
|
-
└── src
|
67
|
-
|
68
|
-
fig/
|
69
|
-
This is the folder where you should put your images.
|
70
|
-
|
71
|
-
inc/
|
72
|
-
This folder has all configuration tex files:
|
73
|
-
colors.tex - customized colors
|
74
|
-
commands.tex - customized commands
|
75
|
-
lst-conf.tex - configuration file for the listings package
|
76
|
-
packages - all needed packages
|
77
|
-
|
78
|
-
main.tex
|
79
|
-
The main tex file. If you specify a filename with -n option, then the generated pdf file will have this name, not the main tex file.
|
80
|
-
|
81
|
-
Makefile
|
82
|
-
Makefile to manage your document sources easily (see the usage above).
|
83
|
-
|
84
|
-
src/
|
85
|
-
This is the folder where to put listings (a result of -l option).
|