weather_guy 0.0.5 → 0.0.6
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/bin/temp +3 -2
- data/lib/weather_guy.rb +18 -1
- data/lib/weather_guy/conversions.rb +10 -0
- data/lib/weather_guy/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eb6c0d89221a8393a693c8cc400bf4184b40e5cd
|
4
|
+
data.tar.gz: 4b4e01be50eaf5b64c773dd6557754d14a50afca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bc45d7711735c48de5b66d91c03ea55ba4048e1434e483c2746ba258bdce5a9b0dcaf946442afc6fec5312b018888d261bda5d50f74b2865cc4c27b16c54cdcb
|
7
|
+
data.tar.gz: 7f199cbed2a4832bbafa9f703b0fb6aa2baca96afe1cbc4a99cd86794e2275bcdd63b82e405ac9bb9fe0f2123b70b8419200bc0675629765b982c34979306e4b
|
data/bin/temp
CHANGED
@@ -1,9 +1,10 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
require 'weather_guy'
|
2
3
|
|
3
4
|
temp = ARGV[0]
|
4
5
|
|
5
|
-
cels = (temp
|
6
|
-
kelv = (temp
|
6
|
+
cels = WeatherGuy::Conversion.new.f_to_c(temp)
|
7
|
+
kelv = WeatherGuy::Conversion.new.f_to_k(temp)
|
7
8
|
|
8
9
|
puts "The temperature in Celsius is #{cels}."
|
9
10
|
puts "The temperature in Kelvin is #{kelv}."
|
data/lib/weather_guy.rb
CHANGED
@@ -1,5 +1,22 @@
|
|
1
1
|
require "weather_guy/version"
|
2
2
|
|
3
3
|
module WeatherGuy
|
4
|
-
|
4
|
+
class Conversion
|
5
|
+
def f_to_c(f_temp)
|
6
|
+
(f_temp.to_i - 32) * 5 / 9
|
7
|
+
end
|
8
|
+
|
9
|
+
def f_to_k(f_temp)
|
10
|
+
(f_temp.to_i + 459.67) * 5 / 9
|
11
|
+
end
|
12
|
+
|
13
|
+
def c_to_f(c_temp)
|
14
|
+
9 / 5 * (c_temp.to_i + 32)
|
15
|
+
end
|
16
|
+
|
17
|
+
def c_to_k(c_temp)
|
18
|
+
c_temp.to_i + 273.15
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
5
22
|
end
|
data/lib/weather_guy/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: weather_guy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- mattcar
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-11-
|
11
|
+
date: 2014-11-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -53,6 +53,7 @@ files:
|
|
53
53
|
- Rakefile
|
54
54
|
- bin/temp
|
55
55
|
- lib/weather_guy.rb
|
56
|
+
- lib/weather_guy/conversions.rb
|
56
57
|
- lib/weather_guy/version.rb
|
57
58
|
- weather_guy.gemspec
|
58
59
|
homepage: https://github.com/mattcar/weather_guy
|