tbmx 0.5.3 → 0.5.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/tbmx.rb +13 -1
  3. metadata +9 -16
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 6034215d274609912b393d57dc418fde9f806b06
4
+ data.tar.gz: 4656f36faee847e0e62179142e7b6ae31996564e
5
+ SHA512:
6
+ metadata.gz: 831a26ca020431a8552805e750ec31a91a69223e803094f94a3fdea8d86712b0900ee6b0810342f1ce23cc4486dad82816141d7ff7ffe02e4c701161e634c0d9
7
+ data.tar.gz: d6907cae52a867208dc4b97ca0df957377491022fcd4756b771302ad7ae74b4410b17ded423efd77e3e239e94542b2869db367ad711138e2f877df8a7ce318cf
data/lib/tbmx.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  # -*- mode: Ruby -*-
3
3
 
4
- # Copyright © 2013-2014, Christopher Mark Gore,
4
+ # Copyright © 2013-2015, Christopher Mark Gore,
5
5
  # Soli Deo Gloria,
6
6
  # All rights reserved.
7
7
  #
@@ -324,6 +324,14 @@ module TBMX
324
324
  "log10", "log2",
325
325
  "sqrt"
326
326
  math_function_handler command.word.to_sym
327
+ when "d2r", "deg->rad", "degrees->radians"
328
+ degrees = number_from_expression
329
+ radians = degrees * Math::PI / 180.0
330
+ radians
331
+ when "r2d", "rad->deg", "radians->degrees"
332
+ radians = number_from_expression
333
+ degrees = radians * 180.0 / Math::PI
334
+ degrees
327
335
  when "log"
328
336
  base, number = numbers_from_expressions
329
337
  if number.nil?
@@ -360,6 +368,10 @@ module TBMX
360
368
  end.reject &:nil?
361
369
  end
362
370
 
371
+ def number_from_expression
372
+ numbers_from_expressions.first
373
+ end
374
+
363
375
  def injectable_math_function_handler(initial, function)
364
376
  numbers_from_expressions.inject initial, function
365
377
  end
metadata CHANGED
@@ -1,20 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tbmx
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.3
5
- prerelease:
4
+ version: 0.5.4
6
5
  platform: ruby
7
6
  authors:
8
7
  - Christopher Mark Gore
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2014-02-25 00:00:00.000000000 Z
11
+ date: 2015-08-17 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: activesupport
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - ~>
20
18
  - !ruby/object:Gem::Version
@@ -22,7 +20,6 @@ dependencies:
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
24
  - - ~>
28
25
  - !ruby/object:Gem::Version
@@ -30,17 +27,15 @@ dependencies:
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: monkey-patch
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ! '>='
31
+ - - '>='
36
32
  - !ruby/object:Gem::Version
37
33
  version: '0'
38
34
  type: :runtime
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ! '>='
38
+ - - '>='
44
39
  - !ruby/object:Gem::Version
45
40
  version: '0'
46
41
  description: TBMX is a markup language, loosely based on Lisp and TeX, for ThinkingBicycle.com.
@@ -52,27 +47,25 @@ files:
52
47
  - lib/tbmx.rb
53
48
  homepage: https://github.com/cgore/ruby-tbmx
54
49
  licenses: []
50
+ metadata: {}
55
51
  post_install_message:
56
52
  rdoc_options: []
57
53
  require_paths:
58
54
  - lib
59
55
  required_ruby_version: !ruby/object:Gem::Requirement
60
- none: false
61
56
  requirements:
62
- - - ! '>='
57
+ - - '>='
63
58
  - !ruby/object:Gem::Version
64
59
  version: '0'
65
60
  required_rubygems_version: !ruby/object:Gem::Requirement
66
- none: false
67
61
  requirements:
68
- - - ! '>='
62
+ - - '>='
69
63
  - !ruby/object:Gem::Version
70
64
  version: '0'
71
65
  requirements: []
72
66
  rubyforge_project:
73
- rubygems_version: 1.8.23
67
+ rubygems_version: 2.0.14
74
68
  signing_key:
75
- specification_version: 3
69
+ specification_version: 4
76
70
  summary: TBMX is a markup language for ThinkingBicycle.com.
77
71
  test_files: []
78
- has_rdoc: