kdwatch 0.5.3 → 0.5.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 974abb5a5f84e7afb0d7bde78c81a8072b9627a90e1aa25bb26811ba02605c56
4
- data.tar.gz: e4777968c970488118701adf24fd6c86efce9ae8d08ee4f999ddf2cf851e05d0
3
+ metadata.gz: 1a9da0314481e385e7c7809d744245974f7f03c1ec545d010dccf1e11ad798a1
4
+ data.tar.gz: efb937cffffac1f963b2768e712c720a502e6fc596e256c457fa5636de5238fd
5
5
  SHA512:
6
- metadata.gz: c62d74513d5fdc91cd5736c2c0410f2d985d64bd4784680f387fae825ba33ab08770eef3930ceb9da21c092d2670083b372c356ac0e1940202f14376d598a99b
7
- data.tar.gz: f5e5a995913f7b7bdd5ab264045062452ceaea3840cc7c3ff47780fd11b648c2f203f0a850c29896871874f4ccdeb514439c5ae73c1423f5ad951a061bfbcfa3
6
+ metadata.gz: 591eeb97f79a48774586fb4f213aebd00b0e9e2604e4cc2644e30d69a2cca6e1869b58907f68b6098e3db734cb253a01178879b7239229e3fb0d3d361a9137d2
7
+ data.tar.gz: 5889974b1b930571d73b96fc1b6f3b423f5a0449859bc14aef429a2c1a05264e4b36a5082ff3b1a8c68fdb1b7fc47b160f1a702fff956e4ee139e666bbb4daec
data/bin/kdwatch CHANGED
@@ -7,6 +7,7 @@ ENV["KRAMDOWN_PERSISTENT"]="yes"
7
7
  require 'optparse'
8
8
  require 'ostruct'
9
9
  require 'socket'
10
+ require 'tempfile'
10
11
 
11
12
  require_relative "../lib/kdwatch/version"
12
13
 
@@ -153,11 +154,19 @@ ENV["KDWATCH_PORT"] = options.port.to_s
153
154
  live_reload_port = options.port + 51234 # move up into ephemeral space
154
155
  ENV["KDWATCH_LRPORT"] = live_reload_port.to_s
155
156
 
156
- File.write(".config.ru", <<HERE)
157
+ tf = Tempfile.new('kdwatch-config-ru-')
158
+ path = tf.path
159
+ rupath = "#{path}.ru"
160
+
161
+ tf.write(<<HERE)
157
162
  require 'rack-livereload'
158
163
  use Rack::LiveReload, min_delay: 500, source: :vendored, no_swf: true, port: #{live_reload_port}, live_reload_port: #{live_reload_port}
159
164
  require 'kdwatch-app.rb'
160
165
  run Sinatra::Application
166
+ File.delete("#{rupath}")
161
167
  HERE
162
168
 
163
- exec("rackup -E production -s thin -o #{options.host} -p #{options.port} .config.ru")
169
+ tf.close
170
+ File.rename(path, rupath)
171
+
172
+ exec("rackup -E production -s thin -o #{options.host} -p #{options.port} #{rupath}")
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Kdwatch
4
- VERSION = "0.5.3"
4
+ VERSION = "0.5.4"
5
5
  end
data/lib/kdwatch-app.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  require_relative "kdwatch/version"
2
2
  require 'bundler'
3
+ require 'tempfile'
3
4
 
4
5
  # Bundler.require
5
6
  require "bundler"
@@ -62,14 +63,19 @@ get "/rfc-local.css" do
62
63
  # insert local css here
63
64
  end
64
65
 
65
- File.write(".Guardfile", <<GF)
66
+ guardfile = Tempfile.new("kdwatch-guard-")
67
+ guardfile.write(<<GF)
66
68
  guard :livereload, :port => #{ENV["KDWATCH_LRPORT"]} do
67
69
  watch("#{sfn}")
68
70
  end
69
71
  GF
72
+ guardfile.close
73
+ gfpath = guardfile.path
74
+ # gfpath = "#{path}.guardfile"
75
+ # File.rename(path, gfpath)
70
76
 
71
77
  rd, _wr = IO.pipe
72
- spawn("guard -G .Guardfile", in: rd, close_others: true)
78
+ spawn("guard -G #{gfpath}", in: rd, close_others: true)
73
79
 
74
80
  # wrong: puts settings.port
75
81
 
@@ -80,4 +86,3 @@ url = "http://#{host}:#{port}"
80
86
 
81
87
  spawn("sleep 5; open #{url} || xdg-open #{url} || echo @@@ Please open #{url}")
82
88
 
83
-
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kdwatch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.3
4
+ version: 0.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carsten Bormann
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-07-07 00:00:00.000000000 Z
11
+ date: 2022-07-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler