eqn 1.1.2 → 1.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +1 -0
- data/.ruby-version +1 -0
- data/README.md +5 -1
- data/eqn.gemspec +2 -0
- data/lib/eqn/function.rb +9 -3
- data/lib/eqn/version.rb +1 -1
- metadata +46 -18
- data/.travis.yml +0 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0a17a117692d4b35d29f0734c4e06468354050f1
|
4
|
+
data.tar.gz: b8ac7d450fd481510e7097a5e7b9217ef0ffceee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c09fde2cf8df20a4d42f2becd6b4bb85fbe6b9dcd4b8cd974e005c7d41b4f99b222aaca7a734204225751a55098a3d5b90e47665a23c75aff70ec99045071e8
|
7
|
+
data.tar.gz: 396c72871320c2a8da3ed340de9cd57433f4db96db0d3c9b952d08e46b6831142fa1368a6aa3faedc03312bfea77342e1dd3100a7901d5dcb14e1f47729e67dd
|
data/.rubocop.yml
CHANGED
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.0.0
|
data/README.md
CHANGED
@@ -1,4 +1,8 @@
|
|
1
|
-
[![
|
1
|
+
[![Build Status](https://circleci.com/gh/schneidmaster/eqn.svg?style=shield)](https://circleci.com/gh/schneidmaster/eqn)
|
2
|
+
[![Test Coverage](https://codeclimate.com/github/schneidmaster/eqn/badges/coverage.svg)](https://codeclimate.com/github/schneidmaster/eqn/coverage)
|
3
|
+
[![Code Climate](https://codeclimate.com/github/schneidmaster/eqn/badges/gpa.svg)](https://codeclimate.com/github/schneidmaster/eqn)
|
4
|
+
[![Gem Version](https://badge.fury.io/rb/eqn.svg)](http://badge.fury.io/rb/eqn)
|
5
|
+
[![security](https://hakiri.io/github/schneidmaster/eqn/master.svg)](https://hakiri.io/github/schneidmaster/eqn/master)
|
2
6
|
|
3
7
|
# Eqn
|
4
8
|
|
data/eqn.gemspec
CHANGED
@@ -22,7 +22,9 @@ Gem::Specification.new do |spec|
|
|
22
22
|
spec.add_dependency 'treetop', '~> 1.4.14'
|
23
23
|
|
24
24
|
spec.add_development_dependency 'bundler', '~> 1.8'
|
25
|
+
spec.add_development_dependency 'codeclimate-test-reporter', '~> 0.4.7'
|
25
26
|
spec.add_development_dependency 'rake', '~> 10.0'
|
26
27
|
spec.add_development_dependency 'rubocop', '~> 0.31'
|
27
28
|
spec.add_development_dependency 'rspec', '~> 3.2.0'
|
29
|
+
spec.add_development_dependency 'simplecov', '~> 0.10.0'
|
28
30
|
end
|
data/lib/eqn/function.rb
CHANGED
@@ -18,19 +18,25 @@ module Eqn
|
|
18
18
|
|
19
19
|
class Round < Node
|
20
20
|
def value
|
21
|
-
elements.shift.value
|
21
|
+
value = elements.shift.value
|
22
|
+
fail ZeroDivisionError if value.is_a?(Float) && (value.abs == Float::INFINITY || value.nan?)
|
23
|
+
value.round
|
22
24
|
end
|
23
25
|
end
|
24
26
|
|
25
27
|
class RoundUp < Node
|
26
28
|
def value
|
27
|
-
elements.shift.value
|
29
|
+
value = elements.shift.value
|
30
|
+
fail ZeroDivisionError if value.is_a?(Float) && (value.abs == Float::INFINITY || value.nan?)
|
31
|
+
value.ceil
|
28
32
|
end
|
29
33
|
end
|
30
34
|
|
31
35
|
class RoundDown < Node
|
32
36
|
def value
|
33
|
-
elements.shift.value
|
37
|
+
value = elements.shift.value
|
38
|
+
fail ZeroDivisionError if value.is_a?(Float) && (value.abs == Float::INFINITY || value.nan?)
|
39
|
+
value.floor
|
34
40
|
end
|
35
41
|
end
|
36
42
|
end
|
data/lib/eqn/version.rb
CHANGED
metadata
CHANGED
@@ -1,85 +1,113 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eqn
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Zach Schneider
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-09-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: treetop
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 1.4.14
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 1.4.14
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ~>
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '1.8'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ~>
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '1.8'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: codeclimate-test-reporter
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ~>
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 0.4.7
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ~>
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 0.4.7
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: rake
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
44
58
|
requirements:
|
45
|
-
- -
|
59
|
+
- - ~>
|
46
60
|
- !ruby/object:Gem::Version
|
47
61
|
version: '10.0'
|
48
62
|
type: :development
|
49
63
|
prerelease: false
|
50
64
|
version_requirements: !ruby/object:Gem::Requirement
|
51
65
|
requirements:
|
52
|
-
- -
|
66
|
+
- - ~>
|
53
67
|
- !ruby/object:Gem::Version
|
54
68
|
version: '10.0'
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
70
|
name: rubocop
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
58
72
|
requirements:
|
59
|
-
- -
|
73
|
+
- - ~>
|
60
74
|
- !ruby/object:Gem::Version
|
61
75
|
version: '0.31'
|
62
76
|
type: :development
|
63
77
|
prerelease: false
|
64
78
|
version_requirements: !ruby/object:Gem::Requirement
|
65
79
|
requirements:
|
66
|
-
- -
|
80
|
+
- - ~>
|
67
81
|
- !ruby/object:Gem::Version
|
68
82
|
version: '0.31'
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
84
|
name: rspec
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|
72
86
|
requirements:
|
73
|
-
- -
|
87
|
+
- - ~>
|
74
88
|
- !ruby/object:Gem::Version
|
75
89
|
version: 3.2.0
|
76
90
|
type: :development
|
77
91
|
prerelease: false
|
78
92
|
version_requirements: !ruby/object:Gem::Requirement
|
79
93
|
requirements:
|
80
|
-
- -
|
94
|
+
- - ~>
|
81
95
|
- !ruby/object:Gem::Version
|
82
96
|
version: 3.2.0
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: simplecov
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ~>
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: 0.10.0
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ~>
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: 0.10.0
|
83
111
|
description: A gem to evaluate numerical equations. Includes support for functions.
|
84
112
|
email:
|
85
113
|
- zach@aha.io
|
@@ -87,10 +115,10 @@ executables: []
|
|
87
115
|
extensions: []
|
88
116
|
extra_rdoc_files: []
|
89
117
|
files:
|
90
|
-
-
|
91
|
-
-
|
92
|
-
-
|
93
|
-
-
|
118
|
+
- .gitignore
|
119
|
+
- .rspec
|
120
|
+
- .rubocop.yml
|
121
|
+
- .ruby-version
|
94
122
|
- Gemfile
|
95
123
|
- LICENSE.txt
|
96
124
|
- README.md
|
@@ -120,12 +148,12 @@ require_paths:
|
|
120
148
|
- lib
|
121
149
|
required_ruby_version: !ruby/object:Gem::Requirement
|
122
150
|
requirements:
|
123
|
-
- -
|
151
|
+
- - '>='
|
124
152
|
- !ruby/object:Gem::Version
|
125
153
|
version: '0'
|
126
154
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
127
155
|
requirements:
|
128
|
-
- -
|
156
|
+
- - '>='
|
129
157
|
- !ruby/object:Gem::Version
|
130
158
|
version: '0'
|
131
159
|
requirements: []
|