nacelle 0.4.2 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +2 -2
- data/Appraisals +6 -21
- data/Gemfile +1 -2
- data/app/assets/config/manifest.js +1 -0
- data/gemfiles/rails_7.0.gemfile.lock +131 -113
- data/gemfiles/{rails_6.0.gemfile → rails_7.1.gemfile} +1 -2
- data/gemfiles/rails_7.1.gemfile.lock +240 -0
- data/gemfiles/{rails_6.1.gemfile → rails_7.2.gemfile} +1 -2
- data/gemfiles/rails_7.2.gemfile.lock +238 -0
- data/lib/nacelle/after_filter.rb +49 -0
- data/lib/nacelle/cell.rb +59 -14
- data/lib/nacelle/cells_serializer.rb +1 -1
- data/lib/nacelle/has_cells.rb +17 -0
- data/lib/nacelle/version.rb +1 -1
- data/lib/nacelle.rb +4 -2
- data/nacelle.gemspec +0 -1
- metadata +10 -22
- data/gemfiles/rails_6.0.gemfile.lock +0 -189
- data/gemfiles/rails_6.1.gemfile.lock +0 -192
- data/lib/nacelle/middleware.rb +0 -53
@@ -1,192 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: ..
|
3
|
-
specs:
|
4
|
-
nacelle (0.4.2)
|
5
|
-
cells (~> 3.0)
|
6
|
-
rails
|
7
|
-
sprockets-rails
|
8
|
-
|
9
|
-
GEM
|
10
|
-
remote: https://rubygems.org/
|
11
|
-
specs:
|
12
|
-
actioncable (6.1.4.4)
|
13
|
-
actionpack (= 6.1.4.4)
|
14
|
-
activesupport (= 6.1.4.4)
|
15
|
-
nio4r (~> 2.0)
|
16
|
-
websocket-driver (>= 0.6.1)
|
17
|
-
actionmailbox (6.1.4.4)
|
18
|
-
actionpack (= 6.1.4.4)
|
19
|
-
activejob (= 6.1.4.4)
|
20
|
-
activerecord (= 6.1.4.4)
|
21
|
-
activestorage (= 6.1.4.4)
|
22
|
-
activesupport (= 6.1.4.4)
|
23
|
-
mail (>= 2.7.1)
|
24
|
-
actionmailer (6.1.4.4)
|
25
|
-
actionpack (= 6.1.4.4)
|
26
|
-
actionview (= 6.1.4.4)
|
27
|
-
activejob (= 6.1.4.4)
|
28
|
-
activesupport (= 6.1.4.4)
|
29
|
-
mail (~> 2.5, >= 2.5.4)
|
30
|
-
rails-dom-testing (~> 2.0)
|
31
|
-
actionpack (6.1.4.4)
|
32
|
-
actionview (= 6.1.4.4)
|
33
|
-
activesupport (= 6.1.4.4)
|
34
|
-
rack (~> 2.0, >= 2.0.9)
|
35
|
-
rack-test (>= 0.6.3)
|
36
|
-
rails-dom-testing (~> 2.0)
|
37
|
-
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
38
|
-
actiontext (6.1.4.4)
|
39
|
-
actionpack (= 6.1.4.4)
|
40
|
-
activerecord (= 6.1.4.4)
|
41
|
-
activestorage (= 6.1.4.4)
|
42
|
-
activesupport (= 6.1.4.4)
|
43
|
-
nokogiri (>= 1.8.5)
|
44
|
-
actionview (6.1.4.4)
|
45
|
-
activesupport (= 6.1.4.4)
|
46
|
-
builder (~> 3.1)
|
47
|
-
erubi (~> 1.4)
|
48
|
-
rails-dom-testing (~> 2.0)
|
49
|
-
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
50
|
-
activejob (6.1.4.4)
|
51
|
-
activesupport (= 6.1.4.4)
|
52
|
-
globalid (>= 0.3.6)
|
53
|
-
activemodel (6.1.4.4)
|
54
|
-
activesupport (= 6.1.4.4)
|
55
|
-
activerecord (6.1.4.4)
|
56
|
-
activemodel (= 6.1.4.4)
|
57
|
-
activesupport (= 6.1.4.4)
|
58
|
-
activestorage (6.1.4.4)
|
59
|
-
actionpack (= 6.1.4.4)
|
60
|
-
activejob (= 6.1.4.4)
|
61
|
-
activerecord (= 6.1.4.4)
|
62
|
-
activesupport (= 6.1.4.4)
|
63
|
-
marcel (~> 1.0.0)
|
64
|
-
mini_mime (>= 1.1.0)
|
65
|
-
activesupport (6.1.4.4)
|
66
|
-
concurrent-ruby (~> 1.0, >= 1.0.2)
|
67
|
-
i18n (>= 1.6, < 2)
|
68
|
-
minitest (>= 5.1)
|
69
|
-
tzinfo (~> 2.0)
|
70
|
-
zeitwerk (~> 2.3)
|
71
|
-
addressable (2.8.0)
|
72
|
-
public_suffix (>= 2.0.2, < 5.0)
|
73
|
-
appraisal (2.4.1)
|
74
|
-
bundler
|
75
|
-
rake
|
76
|
-
thor (>= 0.14.0)
|
77
|
-
builder (3.2.4)
|
78
|
-
byebug (11.1.3)
|
79
|
-
capybara (3.35.3)
|
80
|
-
addressable
|
81
|
-
mini_mime (>= 0.1.3)
|
82
|
-
nokogiri (~> 1.8)
|
83
|
-
rack (>= 1.6.0)
|
84
|
-
rack-test (>= 0.6.3)
|
85
|
-
regexp_parser (>= 1.5, < 3.0)
|
86
|
-
xpath (~> 3.2)
|
87
|
-
cells (3.11.3)
|
88
|
-
actionpack (>= 3.0)
|
89
|
-
railties (>= 3.0)
|
90
|
-
uber (~> 0.0.8)
|
91
|
-
concurrent-ruby (1.1.9)
|
92
|
-
crass (1.0.6)
|
93
|
-
diff-lcs (1.5.0)
|
94
|
-
erubi (1.10.0)
|
95
|
-
globalid (1.0.0)
|
96
|
-
activesupport (>= 5.0)
|
97
|
-
i18n (1.8.11)
|
98
|
-
concurrent-ruby (~> 1.0)
|
99
|
-
loofah (2.13.0)
|
100
|
-
crass (~> 1.0.2)
|
101
|
-
nokogiri (>= 1.5.9)
|
102
|
-
mail (2.7.1)
|
103
|
-
mini_mime (>= 0.1.1)
|
104
|
-
marcel (1.0.2)
|
105
|
-
method_source (1.0.0)
|
106
|
-
mini_mime (1.1.2)
|
107
|
-
mini_portile2 (2.6.1)
|
108
|
-
minitest (5.15.0)
|
109
|
-
nio4r (2.5.8)
|
110
|
-
nokogiri (1.12.5)
|
111
|
-
mini_portile2 (~> 2.6.1)
|
112
|
-
racc (~> 1.4)
|
113
|
-
public_suffix (4.0.6)
|
114
|
-
racc (1.6.0)
|
115
|
-
rack (2.2.3)
|
116
|
-
rack-test (1.1.0)
|
117
|
-
rack (>= 1.0, < 3)
|
118
|
-
rails (6.1.4.4)
|
119
|
-
actioncable (= 6.1.4.4)
|
120
|
-
actionmailbox (= 6.1.4.4)
|
121
|
-
actionmailer (= 6.1.4.4)
|
122
|
-
actionpack (= 6.1.4.4)
|
123
|
-
actiontext (= 6.1.4.4)
|
124
|
-
actionview (= 6.1.4.4)
|
125
|
-
activejob (= 6.1.4.4)
|
126
|
-
activemodel (= 6.1.4.4)
|
127
|
-
activerecord (= 6.1.4.4)
|
128
|
-
activestorage (= 6.1.4.4)
|
129
|
-
activesupport (= 6.1.4.4)
|
130
|
-
bundler (>= 1.15.0)
|
131
|
-
railties (= 6.1.4.4)
|
132
|
-
sprockets-rails (>= 2.0.0)
|
133
|
-
rails-dom-testing (2.0.3)
|
134
|
-
activesupport (>= 4.2.0)
|
135
|
-
nokogiri (>= 1.6)
|
136
|
-
rails-html-sanitizer (1.4.2)
|
137
|
-
loofah (~> 2.3)
|
138
|
-
railties (6.1.4.4)
|
139
|
-
actionpack (= 6.1.4.4)
|
140
|
-
activesupport (= 6.1.4.4)
|
141
|
-
method_source
|
142
|
-
rake (>= 0.13)
|
143
|
-
thor (~> 1.0)
|
144
|
-
rake (13.0.6)
|
145
|
-
regexp_parser (2.2.0)
|
146
|
-
rspec (3.10.0)
|
147
|
-
rspec-core (~> 3.10.0)
|
148
|
-
rspec-expectations (~> 3.10.0)
|
149
|
-
rspec-mocks (~> 3.10.0)
|
150
|
-
rspec-core (3.10.1)
|
151
|
-
rspec-support (~> 3.10.0)
|
152
|
-
rspec-expectations (3.10.1)
|
153
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
154
|
-
rspec-support (~> 3.10.0)
|
155
|
-
rspec-mocks (3.10.2)
|
156
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
157
|
-
rspec-support (~> 3.10.0)
|
158
|
-
rspec-support (3.10.3)
|
159
|
-
sprockets (3.7.2)
|
160
|
-
concurrent-ruby (~> 1.0)
|
161
|
-
rack (> 1, < 3)
|
162
|
-
sprockets-rails (3.4.2)
|
163
|
-
actionpack (>= 5.2)
|
164
|
-
activesupport (>= 5.2)
|
165
|
-
sprockets (>= 3.0.0)
|
166
|
-
thor (1.1.0)
|
167
|
-
tzinfo (2.0.4)
|
168
|
-
concurrent-ruby (~> 1.0)
|
169
|
-
uber (0.0.15)
|
170
|
-
websocket-driver (0.7.5)
|
171
|
-
websocket-extensions (>= 0.1.0)
|
172
|
-
websocket-extensions (0.1.5)
|
173
|
-
xpath (3.2.0)
|
174
|
-
nokogiri (~> 1.8)
|
175
|
-
zeitwerk (2.5.2)
|
176
|
-
|
177
|
-
PLATFORMS
|
178
|
-
ruby
|
179
|
-
|
180
|
-
DEPENDENCIES
|
181
|
-
appraisal
|
182
|
-
bundler
|
183
|
-
byebug
|
184
|
-
capybara (~> 3.35.0)
|
185
|
-
nacelle!
|
186
|
-
rails (~> 6.1.0)
|
187
|
-
rake
|
188
|
-
rspec
|
189
|
-
sprockets (~> 3.0)
|
190
|
-
|
191
|
-
BUNDLED WITH
|
192
|
-
2.2.32
|
data/lib/nacelle/middleware.rb
DELETED
@@ -1,53 +0,0 @@
|
|
1
|
-
require "active_support/xml_mini/nokogiri"
|
2
|
-
ActiveSupport::XmlMini.backend = "Nokogiri"
|
3
|
-
|
4
|
-
require "active_support/core_ext/hash"
|
5
|
-
|
6
|
-
module Nacelle
|
7
|
-
class Middleware
|
8
|
-
def initialize app
|
9
|
-
@app = app
|
10
|
-
end
|
11
|
-
|
12
|
-
def call env
|
13
|
-
status, headers, body = @app.call env
|
14
|
-
return [status, headers, body] unless headers["Content-Type"].try(:include?, "text/html")
|
15
|
-
|
16
|
-
new_body = ""
|
17
|
-
body.each { |part| new_body << part }
|
18
|
-
process! new_body, env
|
19
|
-
headers.delete("Content-Length")
|
20
|
-
[status, headers, [new_body]]
|
21
|
-
end
|
22
|
-
|
23
|
-
private
|
24
|
-
|
25
|
-
def process! body, env
|
26
|
-
cells = cells body
|
27
|
-
|
28
|
-
body.gsub!(/(#{cells.keys.join('|')})/) do |tag|
|
29
|
-
name, state, attrs = cells[tag]
|
30
|
-
attrs = HashWithIndifferentAccess.new(attrs)
|
31
|
-
cell = "#{name.camelize}Cell".constantize.new_with_request(Rack::Request.new(env))
|
32
|
-
args = [state]
|
33
|
-
attrs.delete "class" # ignore styling class
|
34
|
-
args << attrs unless attrs.empty?
|
35
|
-
begin
|
36
|
-
cell.render_state *args
|
37
|
-
rescue AbstractController::ActionNotFound
|
38
|
-
"<strong>Cell “#{name.capitalize} #{state}” not found!</strong>"
|
39
|
-
end
|
40
|
-
end unless cells.empty?
|
41
|
-
end
|
42
|
-
|
43
|
-
def cells body
|
44
|
-
body.scan(/(<cell[^>]*\/\s*>|<cell[^>]*>.*?<\/cell>)/m).inject({}) do |cells, matches|
|
45
|
-
tag = matches.first
|
46
|
-
attrs = Hash.from_xml(tag)['cell']
|
47
|
-
name, state = attrs.delete('name').split('/')
|
48
|
-
cells[tag] = [name, state, attrs]
|
49
|
-
cells
|
50
|
-
end
|
51
|
-
end
|
52
|
-
end
|
53
|
-
end
|