carraway 0.2.1 → 0.3.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 35663f69d3c3df5b55e4126389a996dd61ee12960d16253a7809fa994ea97121
4
- data.tar.gz: bd7a4c26317395e1a0ed6c0b62325d9134f32371bd1b6cd11390fce48e3850a7
3
+ metadata.gz: 2ee793f9b9eed79c6d9868b081ac44551044822f65f1bfb412187466f7a77f87
4
+ data.tar.gz: fa3a466a4cfecd3d205d756b38cde8943e3c00153ba2a46a69310f98fff94a5d
5
5
  SHA512:
6
- metadata.gz: 8d20f1e709f63db268c34be452673b348495fae3c6f0fbe85909bda12e90d56cd737c13dccc926f33b2bcbbab4098803a4a05a7e7eadb9a2745aa45fc53b338c
7
- data.tar.gz: ec450f3fb95ff93c4c90620b1376d257c59c84ccfbf3ee30e38d044f02cc84398b869cad3a06995356af502720e1e039397687e491121629db037826e99e8c9a
6
+ metadata.gz: 5661f290d9025f61171434b316f53f94e7027a4495e3fd31fb7cb56c75aa8c74172488e5381e02b277d9f0774a414dbf6dd59a8a5d18d8d74782f153ef890467
7
+ data.tar.gz: 319db0ad9870d3159b60b06cf3e4c5f73e121c846ee5b8b79c1d0561a55f682afbaa36e6c704bfbd5fe43f0301e3de2ed2c38b072d178da00b881674378947b8
@@ -15,6 +15,10 @@ module Carraway
15
15
  def port
16
16
  @config['port'] || 5000
17
17
  end
18
+
19
+ def gatsby_endpoint
20
+ @config['gatsby_endpoint'] || 'http://localhost:8000'
21
+ end
18
22
  end
19
23
  end
20
24
  end
@@ -39,12 +39,13 @@ module Carraway
39
39
  # FIXME handle not found
40
40
 
41
41
  # Refresh GatsbyJS
42
- uri = URI.parse("http://localhost:8000/__refresh")
42
+ uri = URI.parse([Config.gatsby_endpoint, '/__refresh'].join)
43
+
43
44
  http = Net::HTTP.new(uri.host, uri.port)
44
45
  req = Net::HTTP::Post.new(uri.path)
45
46
  res = http.request(req) # FIXME Handle errors
46
47
 
47
- redirect "http://localhost:8000#{@post.path}"
48
+ redirect [Config.gatsby_endpoint, @port.path].join
48
49
  end
49
50
 
50
51
  post '/carraway/' do
@@ -1,3 +1,3 @@
1
1
  module Carraway
2
- VERSION = "0.2.1"
2
+ VERSION = "0.3.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: carraway
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - adorechic