pieces 0.4.1 → 0.4.2

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
  SHA1:
3
- metadata.gz: f5c6d9b8bcb0697d6c423f8c4b0384f9a2447da9
4
- data.tar.gz: ced9731402a01a9b90fd3cd6da37d388bf8b923c
3
+ metadata.gz: e27bdc6bd2f2f6692aa8b2ed444d5d5ce662dbf1
4
+ data.tar.gz: 7b66106ffe80f2bd44611640d60d83b8f3e27ea9
5
5
  SHA512:
6
- metadata.gz: 0fb1c9f4a23dcddbefcb2e3f8be7e55758a8ab4d663c5db15dca6356c32ec24e8ec5254f6fa19bcc1ca584e27ce6bc1f776e019b48cd036132fb9d87b22e4b7a
7
- data.tar.gz: 6888e909ec27028bf25633f5fef74370dc2176b6e69d6284baebb6a280ce4fc59d2611d2311771f315443752ed159593bee92a5b32ae5ba8b2ed1a0e6bce1818
6
+ metadata.gz: 5e356716b1e0d9bede9b944fdfa7fd9783c672e7d9a149064ce6e0716e6809eb12b3645ef96731021623358872acce84d215c7b3b3122bf751a375d5b9bf6053
7
+ data.tar.gz: 5ee3d4371032923872272373e0090d5a1e260a5479230a6d3c01f9916e2ef98202cf97ef386ffb4cccc27f86acbefe0273189675d46e48fdd79f4b057ed63233
data/README.md CHANGED
@@ -124,6 +124,16 @@ bundle exec rails s
124
124
 
125
125
  And then visit [http://localhost:3000/styleguide](http://localhost:3000/styleguide)
126
126
 
127
+ **Do you use vagrant?** If you do you should update Pieces::Rails in your
128
+ `config/routes.rb` as follows:
129
+
130
+ ``` ruby
131
+ mount Pieces::Rails.new(force_polling: true).mount, at: '/styleguide' unless Rails.env.production?
132
+ ```
133
+
134
+ This will tell `listen`, the gem that watches for changes, to poll your app
135
+ for changes. This is required for vagrant!
136
+
127
137
  ## Create new static site
128
138
 
129
139
  To create a new static site with Pieces:
@@ -2,15 +2,17 @@ module Pieces
2
2
  class Listener
3
3
  attr_reader :path
4
4
  attr_reader :build_method
5
+ attr_reader :force_polling
5
6
 
6
7
  def initialize(config = {})
7
8
  @path = config[:path] || Dir.pwd
8
9
  @build_method = config[:build_method] || :build
10
+ @force_polling = config[:force_polling] || false
9
11
  build_pieces
10
12
  end
11
13
 
12
14
  def listen
13
- Listen.to("#{path}/config/", "#{path}/app/") do
15
+ Listen.to("#{path}/config/", "#{path}/app/", force_polling: force_polling) do
14
16
  print "Rebuilding #{path}... "
15
17
  build_pieces
16
18
  puts 'done.'
data/lib/pieces/rails.rb CHANGED
@@ -2,10 +2,16 @@ require 'pieces/rails/railtie'
2
2
 
3
3
  module Pieces
4
4
  class Rails
5
- def mount(options = {})
6
- path = options[:path] || Dir.pwd
7
- Pieces::Listener.new(path: path, build_method: :build_routes).listen
8
- Pieces::Server.new(options.merge(path: path)).app
5
+ attr_reader :path, :force_polling
6
+
7
+ def initialize(options = {})
8
+ @path = path || Dir.pwd
9
+ @force_polling = options[:force_polling]
10
+ end
11
+
12
+ def mount
13
+ Pieces::Listener.new(path: path, build_method: :build_routes, force_polling: force_polling).listen
14
+ Pieces::Server.new(path: path).app
9
15
  end
10
16
  end
11
17
  end
@@ -1,3 +1,3 @@
1
1
  module Pieces
2
- VERSION = '0.4.1'
2
+ VERSION = '0.4.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pieces
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luke Morton