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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c7a78002efee6ad3b972ad83a8e6a465f1315116
4
- data.tar.gz: ebbe4de996b80177d20d108940496aa924ae8e18
3
+ metadata.gz: 0a17a117692d4b35d29f0734c4e06468354050f1
4
+ data.tar.gz: b8ac7d450fd481510e7097a5e7b9217ef0ffceee
5
5
  SHA512:
6
- metadata.gz: 45338dbccc37d5d4cfb31f53423af3049063b29b54230a23ef1e0b737b85427b12b9bcadb74e767bcea25950576e3f0c2e02722d659e191093c9f691559a67fe
7
- data.tar.gz: 7e311be733a590f3bb895f864afe546c4a95afd17840d6a9d837acd398dce36533bfb000af1cd32cc135b2f51f85db35e3d4b771c9f0dd116edfb1e11b6fbc55
6
+ metadata.gz: 1c09fde2cf8df20a4d42f2becd6b4bb85fbe6b9dcd4b8cd974e005c7d41b4f99b222aaca7a734204225751a55098a3d5b90e47665a23c75aff70ec99045071e8
7
+ data.tar.gz: 396c72871320c2a8da3ed340de9cd57433f4db96db0d3c9b952d08e46b6831142fa1368a6aa3faedc03312bfea77342e1dd3100a7901d5dcb14e1f47729e67dd
data/.rubocop.yml CHANGED
@@ -1,6 +1,7 @@
1
1
  AllCops:
2
2
  Exclude:
3
3
  - db/**/*
4
+ - vendor/**/*
4
5
 
5
6
  BlockNesting:
6
7
  Max: 4
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.0.0
data/README.md CHANGED
@@ -1,4 +1,8 @@
1
- [![Gem Version](https://badge.fury.io/rb/eqn.svg)](http://badge.fury.io/rb/eqn) [![Build Status](https://travis-ci.org/schneidmaster/eqn.svg?branch=master)](https://travis-ci.org/schneidmaster/eqn)
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.round
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.ceil
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.floor
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
@@ -1,3 +1,3 @@
1
1
  module Eqn
2
- VERSION = '1.1.2'
2
+ VERSION = '1.1.3'
3
3
  end
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.2
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-06-18 00:00:00.000000000 Z
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
- - ".gitignore"
91
- - ".rspec"
92
- - ".rubocop.yml"
93
- - ".travis.yml"
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: []
data/.travis.yml DELETED
@@ -1,10 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 2.2.0
4
- install:
5
- - gem uninstall bundler
6
- - gem install bundler --version '1.8.5'
7
- - bundle
8
- script:
9
- - bundle exec rspec
10
- - bundle exec rubocop