ranNUM 1.3.0 → 1.3.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 +4 -4
- data/lib/ranNUM.rb +5 -4
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4b5062043ef1b905e3814a44393a97fb520a7373
|
|
4
|
+
data.tar.gz: 9c621bf3ca8049c05a3e1dfd68077457b3b08ced
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b0cd7dff2c24d3872daf08e7f5b52362e06f2156b7aeded655a727498b0605f89f2209eeacf366d225dae329050c4c4f00aaa14ee250cc91bf4faa94f0172885
|
|
7
|
+
data.tar.gz: c1a96a4b7a7a6611365e82db62d793544a0f7307a5497a6ba5fb954faf761660b5e98f2ea1d467ed3f1a39c9aa408c75fe1115f1584867a23fc53067043f314c
|
data/lib/ranNUM.rb
CHANGED
|
@@ -67,8 +67,8 @@ class RAN
|
|
|
67
67
|
end
|
|
68
68
|
#get weather data
|
|
69
69
|
def self.get_owm_data(city_id, api_key)
|
|
70
|
-
|
|
71
|
-
url = "http://api.openweathermap.org/data/2.5/weather?id=#{city_id}&units=metric&APPID=#{api_key}" #in celcius
|
|
70
|
+
url = "http://api.openweathermap.org/data/2.5/weather?id=#{city_id}&units=imperial&APPID=#{api_key}" #in fahrenheit
|
|
71
|
+
#url = "http://api.openweathermap.org/data/2.5/weather?id=#{city_id}&units=metric&APPID=#{api_key}" #in celcius
|
|
72
72
|
#url = "http://api.openweathermap.org/data/2.5/weather?id=#{city_id}&APPID=#{api_key}" #in kelvin
|
|
73
73
|
resp = Net::HTTP.get_response(URI.parse(url))
|
|
74
74
|
JSON.parse(resp.body)
|
|
@@ -83,6 +83,7 @@ class RAN
|
|
|
83
83
|
unless weathertemp.nil?
|
|
84
84
|
weathertemp
|
|
85
85
|
else
|
|
86
|
+
sleep(1)
|
|
86
87
|
RAN.w_TEMP
|
|
87
88
|
end
|
|
88
89
|
end
|
|
@@ -109,7 +110,7 @@ class RAN
|
|
|
109
110
|
|
|
110
111
|
|
|
111
112
|
def self.number
|
|
112
|
-
(RAN.y_STOCK.to_f*RAN.w_TEMP.to_f+1)*(RAN.s_SYMBOL2.to_f+1)
|
|
113
|
+
(rand(11)*RAN.y_STOCK.to_f*RAN.w_TEMP.to_f+1)*(rand(6)*RAN.s_SYMBOL2.to_f+1*RAN.w_TEMP.to_f+1)
|
|
113
114
|
end
|
|
114
115
|
|
|
115
116
|
def self.num(rnNUM)
|
|
@@ -138,7 +139,7 @@ end
|
|
|
138
139
|
#puts RAN.number
|
|
139
140
|
|
|
140
141
|
#prints a random number equal to or below the number in parentheses
|
|
141
|
-
#puts RAN.num(
|
|
142
|
+
#puts RAN.num(1000000)
|
|
142
143
|
|
|
143
144
|
#prints a random number equal to or below the number in parentheses rounded
|
|
144
145
|
|