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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 835934c111023fe0803262389b6df97cc1d9a0e83cd9dfe295fc9d1eb8ee75eb
4
- data.tar.gz: 174545438d802b118217db512810fd1b99868e1f13da27c7d9decff225e7f038
3
+ metadata.gz: 8e2548a53c3987435cf69c54af23e728a766322e64732fcb876693f367ee2992
4
+ data.tar.gz: a0d9e09d3e557e5de5f5928b7eef5a882621b57b2b085f2043f2f033f64e3d0c
5
5
  SHA512:
6
- metadata.gz: 6eda8c4a212e1e2a2b6c7ee72de651fabf962efc8f9a766ec6b8d4f732c35662a49515963b40fda7f16eee186caf89bab937ea7f778ee0252e03a425512a1c2a
7
- data.tar.gz: d8b90a0e6aaa87c7a808452a0013aa4f2ede064a710766f428b1f7a651e8613fc1eba732143aad61a8d0b5f12df8c08a520977148a0bec3ebe66302bb4ac3549
6
+ metadata.gz: 570edb6cb73bd9ffbee1d0f8fd16cd8cbf4fbbd6a44b2292274b650396f816187d4bc2781e1b52533a12fe6fd229b4da64d5d4af33820eea606e1bec65b5d51b
7
+ data.tar.gz: 3333bc6f94a93ebaab03537efafd50bfb78ddf596800d4f968786b0e5aba6aead5324468e249e1865aca7c87296022a0586e5e673bdfbb7b9bc1ae9659d7e120
data/.rtx.toml ADDED
@@ -0,0 +1,2 @@
1
+ [tools]
2
+ ruby = "latest"
data/inesita.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'inesita'
3
- s.version = '1.0.pre.5'
3
+ s.version = '1.0.pre.6'
4
4
  s.authors = ['Michał Kalbarczyk']
5
5
  s.email = 'fazibear@gmail.com'
6
6
  s.homepage = 'http://github.com/inesita-rb/inesita'
@@ -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
@@ -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', Port: options['port'], Host: options['host'])
44
- builder = Inesita::Builder.new(app: rack.app, destination_dir: options[:destination_dir])
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
@@ -11,7 +11,7 @@ end
11
11
  require 'rack'
12
12
  require 'rack/server'
13
13
  require 'inesita/config'
14
- require 'inesita/minify'
14
+ require 'inesita/builder'
15
15
  require 'inesita/cli/build'
16
16
  require 'inesita/cli/server'
17
17
  require 'inesita/cli/new'
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.5
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-22 00:00:00.000000000 Z
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.0.3.1
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:
@@ -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