cossincalc 1.0.1 → 1.0.2
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/bin/cossincalc +2 -1
- data/lib/cossincalc/triangle/drawing/svg.rb +1 -1
- data/lib/cossincalc/version.rb +1 -1
- metadata +4 -4
data/bin/cossincalc
CHANGED
|
@@ -25,6 +25,7 @@ EOT
|
|
|
25
25
|
opt :gon, "Use gon as the angle unit"
|
|
26
26
|
opt :radian, "Use radians as the angle unit"
|
|
27
27
|
opt :directory, "The path to the output directory to be created", :default => "cossincalc-calculation-#{Time.now.strftime('%Y-%m-%d')}", :short => '-o'
|
|
28
|
+
opt :force, "Force calculation, even if the directory already exists", :default => false
|
|
28
29
|
opt :precision, "The number of digits to show in the result after the decimal separator", :default => 2
|
|
29
30
|
end
|
|
30
31
|
|
|
@@ -57,7 +58,7 @@ end
|
|
|
57
58
|
begin
|
|
58
59
|
Dir.mkdir(opts[:directory])
|
|
59
60
|
rescue Errno::EEXIST
|
|
60
|
-
Trollop.die "The specified directory already exists"
|
|
61
|
+
Trollop.die "The specified directory already exists" unless opts[:force]
|
|
61
62
|
end
|
|
62
63
|
|
|
63
64
|
filename = File.join(opts[:directory], 'result')
|
|
@@ -31,7 +31,7 @@ EOT
|
|
|
31
31
|
# The filename should be provided without the .png extension.
|
|
32
32
|
def save_png(filename)
|
|
33
33
|
save_svg(filename)
|
|
34
|
-
system "convert \"#{filename}.svg\" \"#{filename}.png\""
|
|
34
|
+
system("convert \"#{filename}.svg\" \"#{filename}.png\"") || system("rsvg-convert \"#{filename}.svg\" -o \"#{filename}.png\"")
|
|
35
35
|
end
|
|
36
36
|
|
|
37
37
|
# Saves a drawing of the triangle as an SVG file.
|
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: 19
|
|
5
5
|
prerelease: false
|
|
6
6
|
segments:
|
|
7
7
|
- 1
|
|
8
8
|
- 0
|
|
9
|
-
-
|
|
10
|
-
version: 1.0.
|
|
9
|
+
- 2
|
|
10
|
+
version: 1.0.2
|
|
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: 2010-
|
|
18
|
+
date: 2010-11-11 00:00:00 +01:00
|
|
19
19
|
default_executable:
|
|
20
20
|
dependencies: []
|
|
21
21
|
|