logar 0.1.1
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 +7 -0
- data/lib/logar.rb +4 -0
- data/lib/logar/calculation.rb +17 -0
- data/lib/logar/door.rb +21 -0
- data/lib/logar/version.rb +3 -0
- data/lib/logar/wall.rb +25 -0
- metadata +49 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 3bd6d67e2acecab1108f897d2f416245d6fffec4
|
4
|
+
data.tar.gz: 93a8a492a2ce0216a1dd78769d311765cd74b673
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 13c4262cd800be3f2f3500bee10255d49f46062ab7b018a042f7bdba1f70c8efd64e176cf2befd1dc02bd0ec22f008a38c3a63bc356b1dab63e3949a90187b1f
|
7
|
+
data.tar.gz: f517abd925cf77a93d5d240e514e1c2ecedff62560d9862d4ee7139ef33daaaf9ee16290e3aa387b420bde49098f79f4a5c9d3f25dc722ade1d77d380aae0d08
|
data/lib/logar.rb
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
module Logar
|
2
|
+
class Rating
|
3
|
+
attr_reader :result
|
4
|
+
|
5
|
+
def total_area
|
6
|
+
(((self.tb * wall_area) / 100) + ((self.tw * door_area) / 100)) / 1
|
7
|
+
end
|
8
|
+
|
9
|
+
def total_reduction
|
10
|
+
(Math.log10(1 / self.total_area) * 10)
|
11
|
+
end
|
12
|
+
|
13
|
+
def result
|
14
|
+
((self.total_reduction * 100) / 100).floor
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
data/lib/logar/door.rb
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
module Logar
|
2
|
+
class Rating
|
3
|
+
attr_accessor :door_width, :door_height, :door_db
|
4
|
+
|
5
|
+
def door_area
|
6
|
+
(door_width.to_f * door_height.to_f) / 1000000
|
7
|
+
end
|
8
|
+
|
9
|
+
def door_percentage
|
10
|
+
door_area / self.wall_one_percentage
|
11
|
+
end
|
12
|
+
|
13
|
+
def door_rounded
|
14
|
+
((self.door_percentage * 100).round(2)).floor
|
15
|
+
end
|
16
|
+
|
17
|
+
def tw
|
18
|
+
((1.0 / 10) ** (door_db / 10))
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
data/lib/logar/wall.rb
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
module Logar
|
2
|
+
class Rating
|
3
|
+
attr_accessor :wall_width, :wall_height, :wall_db
|
4
|
+
|
5
|
+
def wall_area
|
6
|
+
wall_width.to_f * wall_height.to_f
|
7
|
+
end
|
8
|
+
|
9
|
+
def wall_one_percentage
|
10
|
+
wall_area / 100
|
11
|
+
end
|
12
|
+
|
13
|
+
def door_rounded
|
14
|
+
((self.door_percentage * 100).round(2)).floor
|
15
|
+
end
|
16
|
+
|
17
|
+
def wall_percentage
|
18
|
+
(100 - self.door_percentage).ceil
|
19
|
+
end
|
20
|
+
|
21
|
+
def tb
|
22
|
+
((1.0 / 10) ** (wall_db / 10))
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
metadata
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: logar
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Jamie Barton
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-01-31 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: Find the overall dB rating for acoustic resistance and sound proofing
|
14
|
+
properties your doors and walls will provide.
|
15
|
+
email: gems@codethisway.com
|
16
|
+
executables: []
|
17
|
+
extensions: []
|
18
|
+
extra_rdoc_files: []
|
19
|
+
files:
|
20
|
+
- lib/logar.rb
|
21
|
+
- lib/logar/calculation.rb
|
22
|
+
- lib/logar/door.rb
|
23
|
+
- lib/logar/version.rb
|
24
|
+
- lib/logar/wall.rb
|
25
|
+
homepage: https://github.com/notrab/logar
|
26
|
+
licenses:
|
27
|
+
- MIT
|
28
|
+
metadata: {}
|
29
|
+
post_install_message:
|
30
|
+
rdoc_options: []
|
31
|
+
require_paths:
|
32
|
+
- lib
|
33
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
34
|
+
requirements:
|
35
|
+
- - ">="
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
39
|
+
requirements:
|
40
|
+
- - ">="
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: '0'
|
43
|
+
requirements: []
|
44
|
+
rubyforge_project:
|
45
|
+
rubygems_version: 2.4.5
|
46
|
+
signing_key:
|
47
|
+
specification_version: 4
|
48
|
+
summary: Acoustically rate your wall and doors.
|
49
|
+
test_files: []
|