cossincalc 1.0.8 → 1.0.9
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.
data/lib/core_ext.rb
CHANGED
@@ -16,3 +16,10 @@ unless :to_proc.respond_to?(:to_proc)
|
|
16
16
|
end
|
17
17
|
end
|
18
18
|
end
|
19
|
+
|
20
|
+
# Changes working directory to the directory in which the file of the given path
|
21
|
+
# resides, and executes the given block within this directory. Passes the
|
22
|
+
# basename of the file (including extension) as an argument to the block.
|
23
|
+
def Dir.cd_to(filepath)
|
24
|
+
Dir.chdir(File.dirname(filepath)) { yield(File.basename(filepath)) }
|
25
|
+
end
|
@@ -31,7 +31,9 @@ EOT
|
|
31
31
|
# The filename should be provided without the .png extension.
|
32
32
|
def save_png(filename)
|
33
33
|
save_svg(filename)
|
34
|
-
|
34
|
+
Dir.cd_to(filename) do |basename|
|
35
|
+
system("convert \"#{basename}.svg\" \"#{basename}.png\"") || system("rsvg-convert \"#{basename}.svg\" -o \"#{basename}.png\"")
|
36
|
+
end
|
35
37
|
end
|
36
38
|
|
37
39
|
# Saves a drawing of the triangle as an SVG file.
|
@@ -31,7 +31,7 @@ EOT
|
|
31
31
|
# The filename should be provided without the .pdf extension.
|
32
32
|
def save_pdf(filename)
|
33
33
|
save_tex(filename)
|
34
|
-
Dir.
|
34
|
+
Dir.cd_to(filename) { |basename| `pdflatex "#{basename}.tex"` }
|
35
35
|
end
|
36
36
|
|
37
37
|
# Returns the content of the LaTeX document.
|
data/lib/cossincalc/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cossincalc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 5
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 1.0.
|
9
|
+
- 9
|
10
|
+
version: 1.0.9
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Molte Emil Strange Andersen
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-06-25 00:00:00 +02:00
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|