inesita 1.0.pre.5 → 1.0.pre.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rtx.toml +2 -0
- data/inesita.gemspec +1 -1
- data/lib/inesita/builder.rb +29 -0
- data/lib/inesita/cli/build.rb +2 -2
- data/lib/inesita/cli.rb +1 -1
- metadata +7 -6
- data/lib/inesita/minify.rb +0 -34
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8e2548a53c3987435cf69c54af23e728a766322e64732fcb876693f367ee2992
|
4
|
+
data.tar.gz: a0d9e09d3e557e5de5f5928b7eef5a882621b57b2b085f2043f2f033f64e3d0c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 570edb6cb73bd9ffbee1d0f8fd16cd8cbf4fbbd6a44b2292274b650396f816187d4bc2781e1b52533a12fe6fd229b4da64d5d4af33820eea606e1bec65b5d51b
|
7
|
+
data.tar.gz: 3333bc6f94a93ebaab03537efafd50bfb78ddf596800d4f968786b0e5aba6aead5324468e249e1865aca7c87296022a0586e5e673bdfbb7b9bc1ae9659d7e120
|
data/.rtx.toml
ADDED
data/inesita.gemspec
CHANGED
@@ -0,0 +1,29 @@
|
|
1
|
+
module Inesita
|
2
|
+
class Builder
|
3
|
+
def initialize(app)
|
4
|
+
@app = app
|
5
|
+
end
|
6
|
+
|
7
|
+
def fetch(url)
|
8
|
+
response(URI.parse(url)).body.reduce('') do |content, element|
|
9
|
+
content += element
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
private
|
14
|
+
|
15
|
+
def response(uri)
|
16
|
+
status, headers, body = @app.call({
|
17
|
+
'HTTP_HOST' => @host,
|
18
|
+
'PATH_INFO' => uri.path,
|
19
|
+
'QUERY_STRING' => uri.query || '',
|
20
|
+
'rack.url_scheme' => 'http',
|
21
|
+
'REQUEST_METHOD' => 'GET',
|
22
|
+
'SCRIPT_NAME' => '',
|
23
|
+
'SERVER_NAME' => uri.host
|
24
|
+
})
|
25
|
+
|
26
|
+
::Rack::Response.new(body, status, headers)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
data/lib/inesita/cli/build.rb
CHANGED
@@ -40,8 +40,8 @@ module Inesita
|
|
40
40
|
|
41
41
|
no_commands do
|
42
42
|
def generate_files
|
43
|
-
rack = Rack::Server.new(config: 'config.ru'
|
44
|
-
builder = Inesita::Builder.new(
|
43
|
+
rack = Rack::Server.new(config: 'config.ru')
|
44
|
+
builder = Inesita::Builder.new(rack.app)
|
45
45
|
|
46
46
|
[
|
47
47
|
'/index.html',
|
data/lib/inesita/cli.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: inesita
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.pre.
|
4
|
+
version: 1.0.pre.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michał Kalbarczyk
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-05-
|
11
|
+
date: 2023-05-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: opal
|
@@ -144,6 +144,7 @@ extensions: []
|
|
144
144
|
extra_rdoc_files: []
|
145
145
|
files:
|
146
146
|
- ".gitignore"
|
147
|
+
- ".rtx.toml"
|
147
148
|
- ".travis.yml"
|
148
149
|
- CHANGELOG.md
|
149
150
|
- Gemfile
|
@@ -153,6 +154,7 @@ files:
|
|
153
154
|
- bin/inesita
|
154
155
|
- inesita.gemspec
|
155
156
|
- lib/inesita.rb
|
157
|
+
- lib/inesita/builder.rb
|
156
158
|
- lib/inesita/cli.rb
|
157
159
|
- lib/inesita/cli/build.rb
|
158
160
|
- lib/inesita/cli/new.rb
|
@@ -173,7 +175,6 @@ files:
|
|
173
175
|
- lib/inesita/cli/template/static/stylesheet.css.tt
|
174
176
|
- lib/inesita/cli/watch.rb
|
175
177
|
- lib/inesita/config.rb
|
176
|
-
- lib/inesita/minify.rb
|
177
178
|
- lib/inesita/server.rb
|
178
179
|
- opal/inesita.rb
|
179
180
|
- opal/inesita/browser.rb
|
@@ -207,8 +208,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
207
208
|
- !ruby/object:Gem::Version
|
208
209
|
version: 1.3.1
|
209
210
|
requirements: []
|
210
|
-
rubygems_version: 3.
|
211
|
-
signing_key:
|
211
|
+
rubygems_version: 3.4.12
|
212
|
+
signing_key:
|
212
213
|
specification_version: 4
|
213
214
|
summary: Frontend web framework for Opal
|
214
215
|
test_files:
|
data/lib/inesita/minify.rb
DELETED
@@ -1,34 +0,0 @@
|
|
1
|
-
module Inesita
|
2
|
-
module Minify
|
3
|
-
module_function
|
4
|
-
|
5
|
-
def html(source)
|
6
|
-
if defined?(HtmlCompressor) && defined?(HtmlCompressor::Compressor)
|
7
|
-
HtmlCompressor::Compressor.new.compress(source)
|
8
|
-
else
|
9
|
-
source
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
def js(source)
|
14
|
-
if defined?(Uglifier)
|
15
|
-
Uglifier.compile(source)
|
16
|
-
else
|
17
|
-
source
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
def css(source)
|
22
|
-
if defined?(Sass) && defined?(Sass::Engine)
|
23
|
-
Sass::Engine.new(source,
|
24
|
-
syntax: :scss,
|
25
|
-
cache: false,
|
26
|
-
read_cache: false,
|
27
|
-
style: :compressed
|
28
|
-
).render
|
29
|
-
else
|
30
|
-
source
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|