tbmx 0.5.4 → 0.5.5
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.
- checksums.yaml +4 -4
- data/lib/tbmx.rb +14 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2ccb9cbb7c49767890fcf8779fba34b5c474ee1e
|
4
|
+
data.tar.gz: 1e9afa2a780a42f198721915935fb96eeeb20659
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: db5e4c90cdb5cd751d69f686dfa0b8b706c7d84124daebe3cd7412ea44f94806e1cbba12017567ed284731c07ca9b3c578345460b7b858a6787a70222733fae5
|
7
|
+
data.tar.gz: 04534bafc9f28aeb7fadc7892872ee4a58afa41c85597bf0f9b5dcc24453c6eb56e0d8150ecae564bdca000ec4b0e88ea79da10c5f1772290aca9a38cd3dc41f
|
data/lib/tbmx.rb
CHANGED
@@ -43,6 +43,18 @@ include ERB::Util
|
|
43
43
|
module TBMX
|
44
44
|
TB_COM = "http://thinkingbicycle.com"
|
45
45
|
|
46
|
+
module MathFunctions
|
47
|
+
class << self
|
48
|
+
def degrees2radians degrees
|
49
|
+
degrees * Math::PI / 180.0
|
50
|
+
end
|
51
|
+
|
52
|
+
def radians2degrees radians
|
53
|
+
radians * 180.0 / Math::PI
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
46
58
|
class ParseError < RuntimeError
|
47
59
|
end
|
48
60
|
|
@@ -325,13 +337,9 @@ module TBMX
|
|
325
337
|
"sqrt"
|
326
338
|
math_function_handler command.word.to_sym
|
327
339
|
when "d2r", "deg->rad", "degrees->radians"
|
328
|
-
|
329
|
-
radians = degrees * Math::PI / 180.0
|
330
|
-
radians
|
340
|
+
MathFunctions::degrees2radians number_from_expression
|
331
341
|
when "r2d", "rad->deg", "radians->degrees"
|
332
|
-
|
333
|
-
degrees = radians * 180.0 / Math::PI
|
334
|
-
degrees
|
342
|
+
MathFunctions::radians2degrees number_from_expression
|
335
343
|
when "log"
|
336
344
|
base, number = numbers_from_expressions
|
337
345
|
if number.nil?
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tbmx
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Christopher Mark Gore
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-08-
|
11
|
+
date: 2015-08-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|