inesita 1.0.pre.3 → 1.0.pre.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/inesita.gemspec +1 -3
- data/lib/inesita/cli/build.rb +14 -25
- data/lib/inesita/cli/watch.rb +0 -6
- data/lib/inesita/server.rb +1 -1
- data/lib/inesita.rb +1 -0
- metadata +2 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a2f188386e1e6e6434dab38c355238b2a5a170bd79d60455c5062c217fd0fb28
|
4
|
+
data.tar.gz: 1bf771f5d80d1d6ce11b10d60bf7583a887bb9a0c8f4fd224b74d4349bedd74d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4925d863797a030bb3f67482192b83f406906f989a326dc1afc8d3123f697f9d3c4ed58cfedb9dbb88b677e3625458855d333fb22b168a2bfbd1975c4a0ebc97
|
7
|
+
data.tar.gz: b950726eb8e27b371585b32f12f7dfa3c666a7cf607dfdab497d2960aaafeafdc3f845429b0bb3f5a7c816fbe4431f8c418ebd396164a8c40c2d953bc52a1d1a
|
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.
|
3
|
+
s.version = '1.0.pre.4'
|
4
4
|
s.authors = ['Michał Kalbarczyk']
|
5
5
|
s.email = 'fazibear@gmail.com'
|
6
6
|
s.homepage = 'http://github.com/inesita-rb/inesita'
|
@@ -18,8 +18,6 @@ Gem::Specification.new do |s|
|
|
18
18
|
s.add_dependency 'opal-virtual-dom', '~> 0.6.1'
|
19
19
|
s.add_dependency 'thor', '~> 1.2'
|
20
20
|
s.add_dependency 'rack', '~> 2.0'
|
21
|
-
|
22
|
-
s.add_dependency 'rack-rewrite', '~> 1.5'
|
23
21
|
s.add_dependency 'listen', '~> 3.0'
|
24
22
|
|
25
23
|
s.add_development_dependency 'bundler', '~> 2.0'
|
data/lib/inesita/cli/build.rb
CHANGED
@@ -32,30 +32,25 @@ module Inesita
|
|
32
32
|
default: Inesita::Config::STATIC_DIR,
|
33
33
|
desc: 'static dir'
|
34
34
|
|
35
|
-
method_option :dist_source_dir,
|
36
|
-
aliases: :b,
|
37
|
-
type: :string,
|
38
|
-
default: Inesita::Config::APP_DIST_DIR,
|
39
|
-
desc: 'source (app) dir for dist build'
|
40
|
-
|
41
35
|
def build
|
42
|
-
assets = assets_server
|
43
36
|
empty_directory options[:destination_dir], force: options[:force]
|
44
|
-
|
37
|
+
generate_files
|
45
38
|
copy_static
|
46
|
-
create_asset(assets, 'index.html', ->(s) { Inesita::Minify.html(s) })
|
47
|
-
create_asset(assets, 'application.js', ->(s) { Inesita::Minify.js(s) })
|
48
|
-
create_asset(assets, 'stylesheet.css', ->(s) { Inesita::Minify.css(s) })
|
49
39
|
end
|
50
40
|
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
41
|
+
no_commands do
|
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])
|
45
|
+
|
46
|
+
[
|
47
|
+
'/index.html',
|
48
|
+
Inesita.assets_code.match(/src="([^\"]*?)[?"]/)[1]
|
49
|
+
].each do |url|
|
50
|
+
create_file File.join(options[:destination_dir], url),
|
51
|
+
builder.fetch(url),
|
52
|
+
force: options[:force]
|
53
|
+
end
|
59
54
|
end
|
60
55
|
|
61
56
|
def copy_static
|
@@ -71,12 +66,6 @@ module Inesita
|
|
71
66
|
end
|
72
67
|
end
|
73
68
|
end
|
74
|
-
|
75
|
-
def create_asset(assets, name, minify_proc)
|
76
|
-
create_file File.join(options[:destination_dir], name),
|
77
|
-
minify_proc.call(assets[name].source),
|
78
|
-
force: options[:force]
|
79
|
-
end
|
80
69
|
end
|
81
70
|
end
|
82
71
|
end
|
data/lib/inesita/cli/watch.rb
CHANGED
@@ -32,12 +32,6 @@ module Inesita
|
|
32
32
|
default: Inesita::Config::STATIC_DIR,
|
33
33
|
desc: 'static dir'
|
34
34
|
|
35
|
-
method_option :dist_source_dir,
|
36
|
-
aliases: :b,
|
37
|
-
type: :string,
|
38
|
-
default: Inesita::Config::APP_DIST_DIR,
|
39
|
-
desc: 'source (app) dir for dist build'
|
40
|
-
|
41
35
|
def watch
|
42
36
|
puts 'building...'
|
43
37
|
safe_build
|
data/lib/inesita/server.rb
CHANGED
data/lib/inesita.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.4
|
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-
|
11
|
+
date: 2023-05-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: opal
|
@@ -66,20 +66,6 @@ dependencies:
|
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '2.0'
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: rack-rewrite
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - "~>"
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: '1.5'
|
76
|
-
type: :runtime
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - "~>"
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: '1.5'
|
83
69
|
- !ruby/object:Gem::Dependency
|
84
70
|
name: listen
|
85
71
|
requirement: !ruby/object:Gem::Requirement
|