fuelcli 0.1.5 → 0.1.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/Gemfile.lock +4 -2
- data/exe/fuel +13 -3
- data/lib/fuel/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c46466c36bb596ca68d59c16332237373d22c41f59bc5ac9ba1e51c0abc30585
|
4
|
+
data.tar.gz: fd161c09a71e51841c97213da8ba5b16622ac193b5c027929aef67a8d73f5c34
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: baf3e815342e15675fd9fd2bddf81ceae53565e636f1ca460a5aa0a9e38546dee812411370d3b9aad078d1b7ac63df84ef44e58732ccfb3b1859dbd1371d321c
|
7
|
+
data.tar.gz: 1e7776e5d1907959ee42e17e23a461737c020449d06a1a182213d7a4d9053cfbf0f39fa0089a3ab0458f0f0a79c6de9cfc73d36242fa8ba1bd5d87a9e904c6d1
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
|
4
|
+
fuelcli (0.1.5)
|
5
|
+
ruby-progressbar (~> 1.11)
|
5
6
|
thor (~> 1.0)
|
6
7
|
|
7
8
|
GEM
|
@@ -22,13 +23,14 @@ GEM
|
|
22
23
|
diff-lcs (>= 1.2.0, < 2.0)
|
23
24
|
rspec-support (~> 3.10.0)
|
24
25
|
rspec-support (3.10.0)
|
26
|
+
ruby-progressbar (1.11.0)
|
25
27
|
thor (1.0.1)
|
26
28
|
|
27
29
|
PLATFORMS
|
28
30
|
ruby
|
29
31
|
|
30
32
|
DEPENDENCIES
|
31
|
-
|
33
|
+
fuelcli!
|
32
34
|
rake (~> 12.0)
|
33
35
|
rspec
|
34
36
|
|
data/exe/fuel
CHANGED
@@ -16,9 +16,11 @@ module Fuel
|
|
16
16
|
|
17
17
|
def burn(leg)
|
18
18
|
begin
|
19
|
-
|
19
|
+
say ""
|
20
20
|
say "#{get_name(leg)}"
|
21
21
|
say ""
|
22
|
+
say "#{get_note_url(leg)}"
|
23
|
+
say ""
|
22
24
|
burn_fuel
|
23
25
|
if( yes? "leg #{get_name(leg)} flown?")
|
24
26
|
update_flight_plan(leg,true)
|
@@ -51,15 +53,23 @@ module Fuel
|
|
51
53
|
private
|
52
54
|
|
53
55
|
def get_name(leg)
|
54
|
-
url = URI("http
|
56
|
+
url = URI("http://#{ENV.fetch("FUEL_HOST","www.flightplanapp.com")}/api/fuel/#{leg}")
|
55
57
|
http = Net::HTTP.new(url.host, url.port)
|
56
58
|
request = Net::HTTP::Get.new(url)
|
57
59
|
response = http.request(request)
|
58
60
|
waypoint = JSON.parse(response.read_body)
|
59
61
|
waypoint["description"]
|
60
62
|
end
|
63
|
+
def get_note_url(leg)
|
64
|
+
url = URI("http://#{ENV.fetch("FUEL_HOST","www.flightplanapp.com")}/api/fuel/#{leg}")
|
65
|
+
http = Net::HTTP.new(url.host, url.port)
|
66
|
+
request = Net::HTTP::Get.new(url)
|
67
|
+
response = http.request(request)
|
68
|
+
waypoint = JSON.parse(response.read_body)
|
69
|
+
waypoint["note_url"]
|
70
|
+
end
|
61
71
|
def update_flight_plan(leg,flown)
|
62
|
-
url = URI("http
|
72
|
+
url = URI("http://#{ENV.fetch("FUEL_HOST","www.flightplanapp.com")}/api/fuel")
|
63
73
|
http = Net::HTTP.new(url.host, url.port)
|
64
74
|
request = Net::HTTP::Post.new(url)
|
65
75
|
request["Content-Type"] = 'multipart/form-data'
|
data/lib/fuel/version.rb
CHANGED