fuelcli 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +4 -2
  3. data/exe/fuel +13 -3
  4. data/lib/fuel/version.rb +1 -1
  5. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 85cdc907fd4d9639f441bc8188664104736d4fe37f7c4ca925596769aed33a4e
4
- data.tar.gz: c992a10a9329c2b5f12ddd27d20b3fd3742ef700d3d914380c0076b1f5b7c2a6
3
+ metadata.gz: c46466c36bb596ca68d59c16332237373d22c41f59bc5ac9ba1e51c0abc30585
4
+ data.tar.gz: fd161c09a71e51841c97213da8ba5b16622ac193b5c027929aef67a8d73f5c34
5
5
  SHA512:
6
- metadata.gz: c0ba6ed280219c1a976245fe7055418177a94b9859133fe2ec845081d05bba43395de35e6edabce3ff6397a0568f71829f71421eb2d1339280b0aaba56fb51bc
7
- data.tar.gz: 8ae910bbe321468b2cb02900cb9d3ce14007de1648cdd5888d9b55b00dc76cfacea6b8068d07eb608fb0288dff571e8f41d21c3f42e6765045ca4582f28757b3
6
+ metadata.gz: baf3e815342e15675fd9fd2bddf81ceae53565e636f1ca460a5aa0a9e38546dee812411370d3b9aad078d1b7ac63df84ef44e58732ccfb3b1859dbd1371d321c
7
+ data.tar.gz: 1e7776e5d1907959ee42e17e23a461737c020449d06a1a182213d7a4d9053cfbf0f39fa0089a3ab0458f0f0a79c6de9cfc73d36242fa8ba1bd5d87a9e904c6d1
@@ -1,7 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fuel (0.1.2)
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
- fuel!
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
- say ""
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://flightplanapp.herokuapp.com/api/fuel/#{leg}")
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://flightplanapp.herokuapp.com/api/fuel")
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'
@@ -1,3 +1,3 @@
1
1
  module Fuel
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fuelcli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - dsofadog