Skip to content

Commit c16185f

Browse files
Merge pull request #415 from jekyll/race
Bring watch back
2 parents 1485512 + b54a9a4 commit c16185f

File tree

8 files changed

+15
-22
lines changed

8 files changed

+15
-22
lines changed

lib/jekyll-admin.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ def self.site
3939

4040
# Monkey Patches
4141
require_relative "./jekyll/commands/serve"
42-
require_relative "./jekyll/commands/build"
4342

4443
[Jekyll::Page, Jekyll::Document, Jekyll::StaticFile, Jekyll::Collection].each do |klass|
4544
klass.include JekyllAdmin::APIable

lib/jekyll-admin/file_helper.rb

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,12 @@ def write_file(path, content)
2121
File.open(path, "wb") do |file|
2222
file.write(content)
2323
end
24-
site.process
24+
# we should fully process in dev mode for tests to pass
25+
if ENV["RACK_ENV"] == "production"
26+
site.read
27+
else
28+
site.process
29+
end
2530
end
2631

2732
# Delete the file at the given path
@@ -31,6 +36,11 @@ def delete_file(path)
3136
site.process
3237
end
3338

39+
def delete_file_without_process(path)
40+
Jekyll.logger.debug "DELETING:", path
41+
FileUtils.rm_f sanitized_path(path)
42+
end
43+
3444
private
3545

3646
def ensure_requested_file

lib/jekyll-admin/server/collection.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class Server < Sinatra::Base
2525

2626
if renamed?
2727
ensure_requested_file
28-
delete_file path
28+
delete_file_without_process path
2929
end
3030

3131
write_file write_path, document_body

lib/jekyll-admin/server/data.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class Server < Sinatra::Base
1717
put "/*?/?:path.:ext" do
1818
if renamed?
1919
ensure_requested_file
20-
delete_file path
20+
delete_file_without_process path
2121
end
2222

2323
write_file write_path, data_file_body

lib/jekyll-admin/server/page.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class Server < Sinatra::Base
1616

1717
if renamed?
1818
ensure_requested_file
19-
delete_file path
19+
delete_file_without_process path
2020
end
2121

2222
write_file write_path, page_body

lib/jekyll-admin/server/static_file.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class Server < Sinatra::Base
1818
put "/*" do
1919
if renamed?
2020
ensure_requested_file
21-
delete_file path
21+
delete_file_without_process path
2222
end
2323

2424
write_file(write_path, static_file_body)

lib/jekyll/commands/build.rb

Lines changed: 0 additions & 14 deletions
This file was deleted.

lib/jekyll/commands/serve.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ def start_up_webrick(opts, destination)
1616
def jekyll_admin_monkey_patch(server)
1717
server.mount "/admin", Rack::Handler::WEBrick, JekyllAdmin::StaticServer
1818
server.mount "/_api", Rack::Handler::WEBrick, JekyllAdmin::Server
19-
Jekyll.logger.warn "Auto-regeneration:", "disabled by JekyllAdmin."
20-
Jekyll.logger.warn "", "The site will regenerate only via the Admin interface."
2119
Jekyll.logger.info "JekyllAdmin mode:", ENV["RACK_ENV"] || "production"
2220
end
2321
end

0 commit comments

Comments
 (0)