lifeapi 0.0.10 → 0.0.12
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/lifeapi/version.rb +1 -1
- data/lib/lifeapi.rb +7 -13
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b53a2632baf1ec94a741981df2b50943b172ed8c
|
|
4
|
+
data.tar.gz: 20a297241c6e1f8443bf37e70d1374701c73c698
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 79aa75579a095ae28475a59640e7381e7ac3182f02dd935f64ed3b3a4bba2528276b21183b1d52ce7993ccaf552eebff161924da3b44f6afdfd028aec95cf6a4
|
|
7
|
+
data.tar.gz: 8b7d05b4f2fb94a745ef84529b8df51ebdf7d03aecdc46d489afcac69b4f609c337abd4b33228fc70ae295a36cecd52e8411514c9e1b5aa6594d464317763604
|
data/lib/lifeapi/version.rb
CHANGED
data/lib/lifeapi.rb
CHANGED
|
@@ -102,8 +102,7 @@ module Lifeapi
|
|
|
102
102
|
@year = year
|
|
103
103
|
@month = month
|
|
104
104
|
@day = day
|
|
105
|
-
json_data = HTTParty.get("https://jack-lifeapi.herokuapp.com/v1/days/single"
|
|
106
|
-
:headers => {"year" => "#{@year}", "month" => "#{@month}", "day" => "#{@day}"})
|
|
105
|
+
json_data = HTTParty.get("https://jack-lifeapi.herokuapp.com/v1/days/single?year=#{@year}&month=#{@month}&day=#{day}")
|
|
107
106
|
|
|
108
107
|
#if the params are bad
|
|
109
108
|
if json_data.code == 400
|
|
@@ -133,8 +132,7 @@ module Lifeapi
|
|
|
133
132
|
@day2 = day2
|
|
134
133
|
@condense = true
|
|
135
134
|
|
|
136
|
-
json_data = HTTParty.get("https://jack-lifeapi.herokuapp.com/v1/days/range"
|
|
137
|
-
:headers => {"year1" => "#{@year1}", "month1" => "#{@month1}", "day1" => "#{@day1}", "year2" => "#{@year2}", "month2" => "#{@month2}", "day2" => "#{@day2}", "condense" => "#{@condense}"})
|
|
135
|
+
json_data = HTTParty.get("https://jack-lifeapi.herokuapp.com/v1/days/range?year1=#{@year1}&month1=#{@month1}&day1=#{@day1}&year2=#{@year2}&month2=#{@month2}&day2=#{@day2}&condense=true")
|
|
138
136
|
|
|
139
137
|
#if the params are bad
|
|
140
138
|
if json_data.code == 400
|
|
@@ -164,8 +162,7 @@ module Lifeapi
|
|
|
164
162
|
@day2 = day2
|
|
165
163
|
@condense = false
|
|
166
164
|
|
|
167
|
-
json_data = HTTParty.get("https://jack-lifeapi.herokuapp.com/v1/days/range"
|
|
168
|
-
:headers => {"year1" => "#{@year1}", "month1" => "#{@month1}", "day1" => "#{@day1}", "year2" => "#{@year2}", "month2" => "#{@month2}", "day2" => "#{@day2}", "condense" => "#{@condense}"})
|
|
165
|
+
json_data = HTTParty.get("https://jack-lifeapi.herokuapp.com/v1/days/range?year1=#{@year1}&month1=#{@month1}&day1=#{@day1}&year2=#{@year2}&month2=#{@month2}&day2=#{@day2}&condense=false")
|
|
169
166
|
|
|
170
167
|
#if the params are bad
|
|
171
168
|
if json_data.code == 400
|
|
@@ -175,7 +172,7 @@ module Lifeapi
|
|
|
175
172
|
data = JSON.parse(json_data.to_json)
|
|
176
173
|
|
|
177
174
|
#day = Range.new(data["start_date"], data["end_date"], data["activities"])
|
|
178
|
-
|
|
175
|
+
@day_array = []
|
|
179
176
|
data.each do |d|
|
|
180
177
|
@day = Day.new(d["record_date"], d["activities"])
|
|
181
178
|
@day_array += [@day]
|
|
@@ -186,8 +183,7 @@ module Lifeapi
|
|
|
186
183
|
|
|
187
184
|
# returns the whole summer, in condensed format
|
|
188
185
|
def self.get_whole_summer_condensed()
|
|
189
|
-
json_data = HTTParty.get("https://jack-lifeapi.herokuapp.com/v1/days/all_time"
|
|
190
|
-
:headers => {"condense" => "true"})
|
|
186
|
+
json_data = HTTParty.get("https://jack-lifeapi.herokuapp.com/v1/days/all_time?condense=true")
|
|
191
187
|
|
|
192
188
|
#if the params are bad
|
|
193
189
|
if json_data.code == 400
|
|
@@ -204,8 +200,7 @@ module Lifeapi
|
|
|
204
200
|
|
|
205
201
|
# returns the whole summer as an array of days, in uncondensed format
|
|
206
202
|
def self.get_whole_summer()
|
|
207
|
-
json_data = HTTParty.get("https://jack-lifeapi.herokuapp.com/v1/days/all_time"
|
|
208
|
-
:headers => {"condense" => "false"})
|
|
203
|
+
json_data = HTTParty.get("https://jack-lifeapi.herokuapp.com/v1/days/all_time?condense=false")
|
|
209
204
|
|
|
210
205
|
#if the params are bad
|
|
211
206
|
if json_data.code == 400
|
|
@@ -237,8 +232,7 @@ module Lifeapi
|
|
|
237
232
|
@hour = hour
|
|
238
233
|
@minute = minute
|
|
239
234
|
|
|
240
|
-
json_data = HTTParty.get("https://jack-lifeapi.herokuapp.com/v1/days/query"
|
|
241
|
-
:headers => {"year" => "#{@year}", "month" => "#{@month}", "day" => "#{@day}", "hour" => "#{@hour}", "minute" => "#{@minute}"})
|
|
235
|
+
json_data = HTTParty.get("https://jack-lifeapi.herokuapp.com/v1/days/query?year=#{@year}&month=#{@month}&day=#{@day}&hour=#{@hour}&minute=#{@minute}")
|
|
242
236
|
|
|
243
237
|
#if the params are bad
|
|
244
238
|
if json_data.code == 400
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: lifeapi
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.12
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- jack rometty
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-05-
|
|
11
|
+
date: 2016-05-19 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -96,7 +96,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
96
96
|
version: '0'
|
|
97
97
|
requirements: []
|
|
98
98
|
rubyforge_project:
|
|
99
|
-
rubygems_version: 2.
|
|
99
|
+
rubygems_version: 2.5.1
|
|
100
100
|
signing_key:
|
|
101
101
|
specification_version: 4
|
|
102
102
|
summary: gem for the jack rometty life api
|