middleman-core-x86-mingw32 3.0.3 → 3.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -223,7 +223,7 @@ module Middleman
223
223
  # messages, which can take a long time (minutes at full CPU)
224
224
  # if the object is huge or has cyclic references, like this.
225
225
  def to_s
226
- "#<Middleman::Application>"
226
+ "#<Middleman::Application:0x#{object_id}>"
227
227
  end
228
228
 
229
229
  # Expand a path to include the index file if it's a directory
@@ -21,8 +21,6 @@ module Middleman
21
21
  mount_instance
22
22
  logger.info "== The Middleman is standing watch on port #{port}"
23
23
 
24
- start_file_watcher unless @options[:"disable-watcher"]
25
-
26
24
  @initialized ||= false
27
25
  unless @initialized
28
26
  @initialized = true
@@ -79,37 +77,27 @@ module Middleman
79
77
  end
80
78
 
81
79
  def start_file_watcher
82
- # Watcher Library
83
- require "listen"
84
-
85
- return if @listener
86
-
87
- @listener = Listen.to(Dir.pwd, :relative_paths => true)
88
-
80
+ return if @options[:"disable-watcher"]
81
+
82
+ first_run = !@listener
83
+
84
+ if first_run
85
+ # Watcher Library
86
+ require "listen"
87
+ @listener = Listen.to(Dir.pwd, :relative_paths => true)
88
+ end
89
+
89
90
  @listener.change do |modified, added, removed|
90
91
  added_and_modified = (modified + added)
91
92
 
92
- unless added_and_modified.empty?
93
- # See if the changed file is config.rb or lib/*.rb
94
- if needs_to_reload?(added_and_modified)
95
- reload
96
- return
97
- end
98
-
99
- # Otherwise forward to Middleman
93
+ # See if the changed file is config.rb or lib/*.rb
94
+ if needs_to_reload?(added_and_modified) || needs_to_reload?(removed)
95
+ reload
96
+ else
100
97
  added_and_modified.each do |path|
101
98
  app.files.did_change(path)
102
99
  end
103
- end
104
-
105
- unless removed.empty?
106
- # See if the changed file is config.rb or lib/*.rb
107
- if needs_to_reload?(removed)
108
- reload
109
- return
110
- end
111
100
 
112
- # Otherwise forward to Middleman
113
101
  removed.each do |path|
114
102
  app.files.did_delete(path)
115
103
  end
@@ -117,7 +105,7 @@ module Middleman
117
105
  end
118
106
 
119
107
  # Don't block this thread
120
- @listener.start(false)
108
+ @listener.start(false) if first_run
121
109
  end
122
110
 
123
111
  # Trap the interupt signal and shut down smoothly
@@ -164,6 +152,7 @@ module Middleman
164
152
  )
165
153
 
166
154
  @app = new_app
155
+ start_file_watcher
167
156
 
168
157
  @webrick.mount "/", ::Rack::Handler::WEBrick, app.class.to_rack_app
169
158
  end
@@ -1,5 +1,5 @@
1
1
  module Middleman
2
2
  # Current Version
3
3
  # @return [String]
4
- VERSION = '3.0.3' unless const_defined?(:VERSION)
4
+ VERSION = '3.0.4' unless const_defined?(:VERSION)
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: middleman-core-x86-mingw32
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.3
4
+ version: 3.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -569,7 +569,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
569
569
  version: '0'
570
570
  segments:
571
571
  - 0
572
- hash: 4093729475455442254
572
+ hash: -4139807320694989245
573
573
  required_rubygems_version: !ruby/object:Gem::Requirement
574
574
  none: false
575
575
  requirements:
@@ -578,7 +578,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
578
578
  version: '0'
579
579
  segments:
580
580
  - 0
581
- hash: 4093729475455442254
581
+ hash: -4139807320694989245
582
582
  requirements: []
583
583
  rubyforge_project:
584
584
  rubygems_version: 1.8.23