porous 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/porous/application.rb +3 -2
- data/lib/porous/cli/build.rb +1 -1
- data/lib/porous/cli/dev.rb +5 -6
- data/lib/porous/cli/server.rb +3 -6
- data/lib/porous/cli/template/.gitignore.tt +2 -1
- data/lib/porous/server/builder.rb +8 -3
- data/lib/porous/version.rb +1 -1
- data/opal/porous.rb +13 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 97c2c2c1012060cf7e94ce3a27576d5d0deeee6f5dff85f60bc3b546ddf124f3
|
4
|
+
data.tar.gz: df1fcc99004ba224f1fab40355e958112ae56c512bc11412558c493adbc398eb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a9ccbf9700c5fcf531c8421357fef48631bfdb0c60a9fb4bb51282847f72b6d8505d2464b0b10587d935aea1b9d3f7c4abc769d39fc316b4910dbb5b0d4acdd2
|
7
|
+
data.tar.gz: b49424e0903cd012bd54ddd0c99c219bdb475b6fe81a1e3c8177256f81479bfeaac0e8c285059e06190b7840ce46f8bc26d06110c77be60cf41d85141cfd8f3f
|
data/CHANGELOG.md
CHANGED
data/lib/porous/application.rb
CHANGED
@@ -18,9 +18,10 @@ module Porous
|
|
18
18
|
end
|
19
19
|
meta name: 'description', content: props[:description] if props[:description]
|
20
20
|
|
21
|
-
script src: '/
|
21
|
+
script src: '/porous.js'
|
22
|
+
script src: '/app.js'
|
22
23
|
script src: 'https://cdn.tailwindcss.com'
|
23
|
-
link rel: 'icon', href: '/
|
24
|
+
link rel: 'icon', href: '/favicon.svg'
|
24
25
|
end
|
25
26
|
|
26
27
|
body class: 'bg-gray-50 dark:bg-gray-900' do
|
data/lib/porous/cli/build.rb
CHANGED
@@ -14,7 +14,7 @@ module Porous
|
|
14
14
|
|
15
15
|
desc 'build ENV', 'Build static assets for environment (default: development)'
|
16
16
|
def build(env = :development)
|
17
|
-
empty_directory 'static
|
17
|
+
empty_directory 'static', verbose: false, force: options[:force]
|
18
18
|
Porous::Server::Builder.new(env.to_sym).build
|
19
19
|
end
|
20
20
|
end
|
data/lib/porous/cli/dev.rb
CHANGED
@@ -7,7 +7,7 @@ module Porous
|
|
7
7
|
namespace :dev
|
8
8
|
|
9
9
|
desc 'dev', 'Starts a Porous development server'
|
10
|
-
def dev # rubocop:todo Metrics/MethodLength
|
10
|
+
def dev # rubocop:todo Metrics/MethodLength
|
11
11
|
empty_directory 'static/dist', verbose: false, force: options[:force]
|
12
12
|
|
13
13
|
Agoo::Log.configure(
|
@@ -19,16 +19,15 @@ module Porous
|
|
19
19
|
INFO: true,
|
20
20
|
DEBUG: false,
|
21
21
|
connect: false,
|
22
|
-
request:
|
22
|
+
request: true,
|
23
23
|
response: false,
|
24
|
-
eval:
|
25
|
-
push:
|
24
|
+
eval: false,
|
25
|
+
push: false
|
26
26
|
}
|
27
27
|
)
|
28
28
|
|
29
|
-
Agoo::Server.init 9292,
|
29
|
+
Agoo::Server.init 9292, 'static', thread_count: 1, root_first: true
|
30
30
|
Agoo::Server.use Rack::ContentLength
|
31
|
-
Agoo::Server.use Rack::Static, urls: ['/static']
|
32
31
|
Agoo::Server.use Rack::ShowExceptions
|
33
32
|
|
34
33
|
# Socket Communication
|
data/lib/porous/cli/server.rb
CHANGED
@@ -23,17 +23,14 @@ module Porous
|
|
23
23
|
})
|
24
24
|
|
25
25
|
Agoo::Server.init(
|
26
|
-
|
26
|
+
0, 'static',
|
27
|
+
root_first: true,
|
27
28
|
thread_count: 0,
|
28
29
|
ssl_cert: 'ssl/cert.pem',
|
29
30
|
ssl_key: 'ssl/key.pem',
|
30
|
-
bind:
|
31
|
-
'http://127.0.0.1:80',
|
32
|
-
'https://127.0.0.1:443'
|
33
|
-
]
|
31
|
+
bind: 'https://:443'
|
34
32
|
)
|
35
33
|
Agoo::Server.use Rack::ContentLength
|
36
|
-
Agoo::Server.use Rack::Static, urls: ['/static']
|
37
34
|
|
38
35
|
# Socket Communication
|
39
36
|
$socket ||= Porous::Server::Socket.new
|
@@ -12,17 +12,22 @@ module Porous
|
|
12
12
|
@latest_change = Dir.glob(File.join('**', '*.rb')).map { |f| File.mtime f }.max
|
13
13
|
end
|
14
14
|
|
15
|
-
def build
|
15
|
+
def build # rubocop:todo Metrics/AbcSize
|
16
16
|
components = Dir.glob(File.join('**', '*.rb')).map do |relative_path|
|
17
17
|
modified = File.mtime relative_path
|
18
18
|
@latest_change = modified if modified > @latest_change
|
19
19
|
"require '#{relative_path}'"
|
20
20
|
end
|
21
|
-
|
21
|
+
# Porous
|
22
|
+
builder = Opal::Builder.new scheduler: Opal::BuilderScheduler::Sequential, cache: false
|
23
|
+
builder.build_str "require 'porous'", '(inline)'
|
24
|
+
File.binwrite "#{Dir.pwd}/static/porous.js", builder.to_s
|
25
|
+
# App
|
26
|
+
build_string = "#{components.join ";"}; ".gsub '.rb', ''
|
22
27
|
build_string << inject_socket_connection
|
23
28
|
builder = Opal::Builder.new scheduler: Opal::BuilderScheduler::Sequential, cache: false
|
24
29
|
builder.build_str build_string, '(inline)'
|
25
|
-
File.binwrite "#{Dir.pwd}/static/
|
30
|
+
File.binwrite "#{Dir.pwd}/static/app.js", builder.to_s
|
26
31
|
@last_build = Time.now
|
27
32
|
self
|
28
33
|
end
|
data/lib/porous/version.rb
CHANGED
data/opal/porous.rb
CHANGED
@@ -3,11 +3,22 @@
|
|
3
3
|
require 'opal'
|
4
4
|
require 'native'
|
5
5
|
require 'promise'
|
6
|
-
require 'browser/setup/full'
|
7
|
-
|
8
6
|
require 'js'
|
9
7
|
require 'console'
|
10
8
|
|
9
|
+
require 'browser/version'
|
10
|
+
require 'browser/utils'
|
11
|
+
require 'browser/form_data'
|
12
|
+
require 'browser/support'
|
13
|
+
require 'browser/event'
|
14
|
+
require 'browser/window'
|
15
|
+
require 'browser/dom'
|
16
|
+
require 'browser/delay'
|
17
|
+
require 'browser/interval'
|
18
|
+
require 'browser/animation_frame'
|
19
|
+
require 'browser/socket'
|
20
|
+
require 'browser/history'
|
21
|
+
|
11
22
|
require 'virtual_dom'
|
12
23
|
require 'virtual_dom/support/browser'
|
13
24
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: porous
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Exa Stencil
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-02-
|
11
|
+
date: 2024-02-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: agoo
|