inesita 1.0.pre.4 → 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: a2f188386e1e6e6434dab38c355238b2a5a170bd79d60455c5062c217fd0fb28
4
- data.tar.gz: 1bf771f5d80d1d6ce11b10d60bf7583a887bb9a0c8f4fd224b74d4349bedd74d
3
+ metadata.gz: 8e2548a53c3987435cf69c54af23e728a766322e64732fcb876693f367ee2992
4
+ data.tar.gz: a0d9e09d3e557e5de5f5928b7eef5a882621b57b2b085f2043f2f033f64e3d0c
5
5
  SHA512:
6
- metadata.gz: 4925d863797a030bb3f67482192b83f406906f989a326dc1afc8d3123f697f9d3c4ed58cfedb9dbb88b677e3625458855d333fb22b168a2bfbd1975c4a0ebc97
7
- data.tar.gz: b950726eb8e27b371585b32f12f7dfa3c666a7cf607dfdab497d2960aaafeafdc3f845429b0bb3f5a7c816fbe4431f8c418ebd396164a8c40c2d953bc52a1d1a
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.4'
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'
data/lib/inesita.rb CHANGED
@@ -6,7 +6,6 @@ require 'listen'
6
6
 
7
7
  require 'inesita/config'
8
8
  require 'inesita/server'
9
- require 'inesita/builder'
10
9
 
11
10
  module Inesita
12
11
  module_function
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
4
+ version: 1.0.pre.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michał Kalbarczyk
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-05-13 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
@@ -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