mata 0.6.0 → 0.8.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: 48edf5af987fb9cd1ea941500d85504e5452408a26d5440f1220a4ef5f83a87c
4
- data.tar.gz: fb1d9dc61b09a3731fb27056443062265b1237a31e23201485152331a14a449c
3
+ metadata.gz: 22c5e26cd983f1031f3d717496815e4250e3d7fa3e4ee66551ca23e0adef9146
4
+ data.tar.gz: f0ec9cdf014a771c112b853cc745d593e6dae01b728321ff92722cb35d4d5c68
5
5
  SHA512:
6
- metadata.gz: 2576d4f01252a0de82cad9d1ab18a5da52517222377e43f0e4e06fbda35a3928f323d272eaac6d58fe5f1acaaec52629370dad48db276072ba5e42bc8fa44445
7
- data.tar.gz: 0bd6bc37b21b58318685fb313bc6a0ae7ba1b192b7106f532dc5842225786bc3c691ac677415f516475402fc9c90b0174034e04a3db43251a26541dc8dfff55a
6
+ metadata.gz: 45a5624b8f699c5751cb38798e8856ee4a120c591060efdcda5e4e36e9a4027213d883df09f3cc343fd114d46ed095d46a0afdb73da44ba503eba7b6759d408c
7
+ data.tar.gz: 0e32957741e3094c2b41bfb35e5ae58df6799bf5b95a48ff8b333dfaace1e4739c35e7cb674f8de5b6b4b843ad08075df27c453bc6a3f59975bdc33641c2ac1f
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Mata
2
2
 
3
- Hot module reloading for Rack applications using Server-Sent Events and DOM morphing.
3
+ Live Reload with DOM Morphing for Rack applications using Server-Sent Events.
4
4
 
5
5
 
6
6
  **Sponsored By [Rails Designer](https://railsdesigner.com/)**
@@ -17,75 +17,47 @@ Hot module reloading for Rack applications using Server-Sent Events and DOM morp
17
17
  ## Installation
18
18
 
19
19
  ```ruby
20
- gem "mata"
20
+ bundle add mata --group=development
21
21
  ```
22
22
 
23
-
24
23
  ## Usage
25
24
 
26
25
  ### Rails
27
26
 
28
27
  ```ruby
29
28
  # config/environments/development.rb
30
- Rails.application.configure do
31
- config.middleware.insert_before(
32
- ActionDispatch::Static,
33
- Mata,
34
- watch: %w[app/views app/assets],
35
- skip: %w[tmp log node_modules]
36
- )
37
- end
38
- ```
39
-
40
- ### Sinatra
41
-
42
- ```ruby
43
- require "sinatra"
44
- require "mata"
45
-
46
- configure :development do
47
- use Mata, watch: %w[views public]
48
- end
29
+ config.middleware.insert_before(
30
+ ActionDispatch::Static,
31
+ Mata,
32
+ watch: %w[app/views app/assets],
33
+ skip: %w[app/assets/build]
34
+ )
49
35
  ```
50
36
 
51
- ### Hanami
52
-
53
- ```ruby
54
- # config.ru
55
- require "hanami/boot"
56
- require "mata"
57
-
58
- use Mata, watch: %w[apps lib] if Hanami.env?(:development)
59
37
 
60
- run Hanami.app
61
- ```
62
-
63
- ### Basic Rack app
38
+ ### Other rack-based apps
64
39
 
65
40
  ```ruby
66
41
  # config.ru
67
42
  require "mata"
68
43
 
69
- use Mata, watch: %w[views assets], skip: %w[tmp log]
44
+ use Mata, watch: %w[views assets], skip: %w[views/tmp]
70
45
 
71
46
  run YourApp
72
47
  ```
73
48
 
74
-
75
- ## Options
76
-
77
- - **watch**; array of paths to monitor (default: `%w[app views assets]`)
78
- - **skip**; array of paths to ignore (default: `%w[tmp log]`)
49
+ > [!NOTE]
50
+ > Do share your snippets on how to add Mata into your specific Rack-based apps 💙
79
51
 
80
52
 
81
53
  ## Used in
82
54
 
83
- This gem powers hot reloading in [Perron](https://github.com/rails-designer/perron), a Rails-based static site generator. It can be enabled with `config.hrm = true` in your Perron initializer.
55
+ This gem powers live reloading in [Perron](https://github.com/rails-designer/perron), a Rails-based static site generator. It can be enabled with `config.live_reload = true` in your Perron initializer.
84
56
 
85
57
 
86
58
  ## Why this gem?
87
59
 
88
- I needed hot module reloading for Perron-powered Rails applications. These are minimal Rails apps typically without Hotwire or ActionCable dependencies. Existing solutions either required ActionCable (adding unnecessary complexity) or provided only basic full-page reloads without state preservation.
60
+ I needed a way to reload pages for Perron-powered Rails applications. These are minimal Rails apps typically without Hotwire or ActionCable dependencies. Existing solutions either required ActionCable or provided only basic full-page reloads without state preservation.
89
61
 
90
62
 
91
63
  ## Who is Mata?
data/lib/mata/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class Mata
2
- VERSION = "0.6.0"
2
+ VERSION = "0.8.0"
3
3
  end
@@ -3,8 +3,8 @@
3
3
  class Mata
4
4
  class WatchTower
5
5
  def initialize(options)
6
- @watch_paths = Array(options[:watch] || %w[app views assets])
7
- @skip_paths = skipped_patterns(options[:skip] || options[:ignore] || %w[tmp log])
6
+ @watch_paths = Array(options[:watch] || [])
7
+ @skip_paths = skipped_patterns(options[:skip] || options[:ignore] || [])
8
8
  @on_change = nil
9
9
  @listener = nil
10
10
 
data/lib/mata.rb CHANGED
@@ -11,6 +11,8 @@ class Mata
11
11
  def initialize(app, options = {})
12
12
  @app = app
13
13
 
14
+ return if ENV["MATA_DISABLED"] == "true"
15
+
14
16
  @watch_tower = WatchTower.new(options)
15
17
  @broadcaster = Broadcaster.new
16
18
  @agent = Agent.new
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mata
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rails Designer
@@ -72,7 +72,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
72
72
  - !ruby/object:Gem::Version
73
73
  version: '0'
74
74
  requirements: []
75
- rubygems_version: 4.0.4
75
+ rubygems_version: 4.0.6
76
76
  specification_version: 4
77
77
  summary: Hot module reloading for Rack applications
78
78
  test_files: []