inesita 0.9.2 → 1.0.pre.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/inesita.gemspec +6 -6
- data/lib/inesita/cli/template/Gemfile.tt +0 -16
- data/lib/inesita/cli/template/index.html.erb.tt +12 -0
- data/lib/inesita/cli/template/static/stylesheet.css.tt +3 -0
- data/lib/inesita/cli.rb +1 -0
- data/lib/inesita/config.rb +2 -3
- data/lib/inesita/server.rb +21 -78
- data/lib/inesita.rb +0 -4
- metadata +22 -23
- data/lib/inesita/cli/template/.sprockets.rb.tt +0 -7
- data/lib/inesita/cli/template/app/index.html.slim.tt +0 -7
- data/lib/inesita/cli/template/app/stylesheet.css.sass.tt +0 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dc2f09dafe1d0277398cb1b2e5f9ccbc1372eed066d0e4fd023eddb7595f4579
|
4
|
+
data.tar.gz: d6db66e26f2a0d802e3a6401ed2f326dd2dd49286ecf442ba026fb6e8e9cb94a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '08fd30bd02f02ca6ab6c1df60266da19de6542461456178ac5d97575e288d157a72dbc79e15e98a98a1519c0527352c7f24a864f980484725825302c0527c03a'
|
7
|
+
data.tar.gz: 9912de2d08bd8d1c5e812627669d5f159687bae1425ba6f5f83441ff95968fb5e9b5169acc6b73379ff1225d4d3e78bb4dccf5b782bdf9f793ec8f870b5d30b4
|
data/inesita.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'inesita'
|
3
|
-
s.version = '0.
|
3
|
+
s.version = '1.0.pre.2'
|
4
4
|
s.authors = ['Michał Kalbarczyk']
|
5
5
|
s.email = 'fazibear@gmail.com'
|
6
6
|
s.homepage = 'http://github.com/inesita-rb/inesita'
|
@@ -9,21 +9,21 @@ Gem::Specification.new do |s|
|
|
9
9
|
s.license = 'MIT'
|
10
10
|
s.post_install_message = 'Thanks for using princess Inesita. See documentaion: https://inesita.fazibear.me/'
|
11
11
|
|
12
|
-
|
13
12
|
s.files = `git ls-files`.split("\n")
|
14
13
|
s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
|
15
14
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
16
15
|
s.require_paths = ['lib']
|
17
16
|
|
18
17
|
s.add_dependency 'opal', '~> 1.0'
|
19
|
-
s.add_dependency 'opal-sprockets', '> 0.3'
|
20
18
|
s.add_dependency 'opal-virtual-dom', '~> 0.6.1'
|
21
|
-
s.add_dependency 'thor', '~>
|
19
|
+
s.add_dependency 'thor', '~> 1.2'
|
20
|
+
s.add_dependency 'rack', '~> 2.0'
|
21
|
+
|
22
22
|
s.add_dependency 'rack-rewrite', '~> 1.5'
|
23
23
|
s.add_dependency 'listen', '~> 3.0'
|
24
24
|
|
25
25
|
s.add_development_dependency 'bundler', '~> 2.0'
|
26
26
|
s.add_development_dependency 'rspec', '~> 3.0'
|
27
|
-
s.add_development_dependency 'opal-rspec', '~>
|
28
|
-
s.add_development_dependency 'rake', '~>
|
27
|
+
s.add_development_dependency 'opal-rspec', '~> 1.0'
|
28
|
+
s.add_development_dependency 'rake', '~> 13.0'
|
29
29
|
end
|
@@ -4,19 +4,3 @@ source "https://rubygems.org"
|
|
4
4
|
gem 'inesita', '~> 0.9.0'
|
5
5
|
gem 'inesita-livereload', '~> 0.1.0'
|
6
6
|
gem 'inesita-router', '~> 0.3.0'
|
7
|
-
|
8
|
-
# templates gems
|
9
|
-
gem 'slim'
|
10
|
-
gem 'sass'
|
11
|
-
|
12
|
-
# minification gems
|
13
|
-
# gem 'uglifier'
|
14
|
-
# gem 'htmlcompressor'
|
15
|
-
|
16
|
-
# bootsrap assets
|
17
|
-
gem 'bootstrap'
|
18
|
-
|
19
|
-
# rails-assets are also supported
|
20
|
-
# source 'https://rails-assets.org' do
|
21
|
-
# gem 'rails-assets-bootstrap'
|
22
|
-
# end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<title><%= config[:project_name] %></title>
|
6
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
|
7
|
+
<link rel="stylesheet" href="/static/stylesheet.css"/>
|
8
|
+
<%= Inesita.assets_code %>
|
9
|
+
</head>
|
10
|
+
<body>
|
11
|
+
</body>
|
12
|
+
</html>
|
data/lib/inesita/cli.rb
CHANGED
data/lib/inesita/config.rb
CHANGED
@@ -1,10 +1,9 @@
|
|
1
1
|
module Inesita
|
2
2
|
module Config
|
3
|
-
ASSETS_PREFIX = '/__ASSETS__'
|
4
3
|
STATIC_DIR = '/static'
|
5
4
|
BUILD_DIR = 'dist'
|
6
5
|
APP_DIR = 'app'
|
7
|
-
|
8
|
-
|
6
|
+
SERVER_MAIN = 'application'
|
7
|
+
SERVER_INDEX_PATH = 'index.html.erb'
|
9
8
|
end
|
10
9
|
end
|
data/lib/inesita/server.rb
CHANGED
@@ -1,91 +1,34 @@
|
|
1
|
-
require 'rack/rewrite'
|
2
|
-
|
3
1
|
module Inesita
|
4
|
-
module SprocketsContext
|
5
|
-
def asset_path(path, _options = {})
|
6
|
-
path
|
7
|
-
end
|
8
|
-
end
|
9
|
-
|
10
2
|
class Server
|
11
|
-
|
3
|
+
def initialize(*args, &block)
|
4
|
+
require 'rack/rewrite'
|
5
|
+
server = server(*args, &block)
|
6
|
+
@rack = Rack::Builder.new do
|
7
|
+
use Rack::Static, urls: [Inesita::Config::STATIC_DIR]
|
8
|
+
run server
|
9
|
+
end
|
12
10
|
|
13
|
-
|
14
|
-
setup_dirs(opts)
|
15
|
-
setup_env(opts)
|
16
|
-
@setup_sprockets = opts.delete(:setup_sprockets) || './.sprockets.rb'
|
17
|
-
@assets_app = create_assets_app
|
18
|
-
@app = create_app
|
11
|
+
Opal.append_path 'app'
|
19
12
|
Inesita.assets_code = assets_code
|
20
13
|
end
|
21
14
|
|
22
|
-
def
|
23
|
-
@
|
24
|
-
end
|
25
|
-
|
26
|
-
def setup_dirs(opts)
|
27
|
-
@static_dir = opts[:static_dir] || Config::STATIC_DIR
|
28
|
-
@app_dir = opts[:app_dir] || Config::APP_DIR
|
29
|
-
@app_dist_dir = opts[:app_dist_dir] || Config::APP_DIST_DIR
|
30
|
-
@app_dev_dir = opts[:app_dev_dir] || Config::APP_DEV_DIR
|
31
|
-
end
|
32
|
-
|
33
|
-
def assets_code
|
34
|
-
assets_prefix = @dist ? '' : Config::ASSETS_PREFIX
|
35
|
-
%(
|
36
|
-
<link rel="stylesheet" type="text/css" href="#{assets_prefix}/stylesheet.css">
|
37
|
-
#{Opal::Sprockets.javascript_include_tag('application', sprockets: @assets_app, prefix: assets_prefix, debug: !@dist)}
|
38
|
-
)
|
39
|
-
end
|
40
|
-
|
41
|
-
def create_app
|
42
|
-
assets_app = @assets_app
|
43
|
-
static_dir = @static_dir
|
44
|
-
|
45
|
-
Rack::Builder.new do
|
46
|
-
use Rack::Static, :urls => [static_dir]
|
47
|
-
|
48
|
-
use Rack::Rewrite do
|
49
|
-
rewrite(/^(?!#{Config::ASSETS_PREFIX}).*/, Config::ASSETS_PREFIX)
|
50
|
-
end
|
51
|
-
|
52
|
-
map Config::ASSETS_PREFIX do
|
53
|
-
run assets_app
|
54
|
-
end
|
55
|
-
end
|
56
|
-
end
|
57
|
-
|
58
|
-
def create_assets_app
|
59
|
-
Opal::Sprockets::Server.new do |s|
|
60
|
-
s.append_path @app_dir
|
61
|
-
if @dist
|
62
|
-
s.append_path @app_dist_dir
|
63
|
-
else
|
64
|
-
s.append_path @app_dev_dir
|
65
|
-
end
|
66
|
-
|
67
|
-
Opal.paths.each do |p|
|
68
|
-
s.append_path p
|
69
|
-
end
|
70
|
-
|
71
|
-
RailsAssets.load_paths.each do |p|
|
72
|
-
s.append_path p
|
73
|
-
end if defined?(RailsAssets)
|
74
|
-
|
75
|
-
s.sprockets.context_class.class_eval do
|
76
|
-
include SprocketsContext
|
77
|
-
end
|
78
|
-
|
79
|
-
setup_sprockets(@setup_sprockets, s.sprockets)
|
80
|
-
end.sprockets
|
15
|
+
def call(*args)
|
16
|
+
@rack.call(*args)
|
81
17
|
end
|
82
18
|
|
83
|
-
def
|
84
|
-
|
19
|
+
def assets_code(path = 'application')
|
20
|
+
@server.javascript_include_tag(path)
|
85
21
|
end
|
86
22
|
|
87
|
-
def
|
88
|
-
@
|
23
|
+
def server(*args, &block)
|
24
|
+
@server = if block_given?
|
25
|
+
Opal::SimpleServer.new(*args, &block)
|
26
|
+
else
|
27
|
+
Opal::SimpleServer.new(*args) do |server|
|
28
|
+
server.main = ::Inesita::Config::SERVER_MAIN
|
29
|
+
server.index_path = ::Inesita::Config::SERVER_INDEX_PATH
|
30
|
+
end
|
31
|
+
end
|
89
32
|
end
|
90
33
|
end
|
91
34
|
end
|
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: 0.
|
4
|
+
version: 1.0.pre.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michał Kalbarczyk
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-05-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: opal
|
@@ -25,47 +25,47 @@ dependencies:
|
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name: opal-
|
28
|
+
name: opal-virtual-dom
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 0.6.1
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 0.6.1
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: thor
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
47
|
+
version: '1.2'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
54
|
+
version: '1.2'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: rack
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '0
|
61
|
+
version: '2.0'
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '0
|
68
|
+
version: '2.0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rack-rewrite
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -128,28 +128,28 @@ dependencies:
|
|
128
128
|
requirements:
|
129
129
|
- - "~>"
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version:
|
131
|
+
version: '1.0'
|
132
132
|
type: :development
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
136
|
- - "~>"
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version:
|
138
|
+
version: '1.0'
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
140
|
name: rake
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
142
142
|
requirements:
|
143
143
|
- - "~>"
|
144
144
|
- !ruby/object:Gem::Version
|
145
|
-
version: '
|
145
|
+
version: '13.0'
|
146
146
|
type: :development
|
147
147
|
prerelease: false
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
150
|
- - "~>"
|
151
151
|
- !ruby/object:Gem::Version
|
152
|
-
version: '
|
152
|
+
version: '13.0'
|
153
153
|
description: Frontent web framework for Opal
|
154
154
|
email: fazibear@gmail.com
|
155
155
|
executables:
|
@@ -172,7 +172,6 @@ files:
|
|
172
172
|
- lib/inesita/cli/new.rb
|
173
173
|
- lib/inesita/cli/server.rb
|
174
174
|
- lib/inesita/cli/template/.gitignore.tt
|
175
|
-
- lib/inesita/cli/template/.sprockets.rb.tt
|
176
175
|
- lib/inesita/cli/template/Gemfile.tt
|
177
176
|
- lib/inesita/cli/template/README.md.tt
|
178
177
|
- lib/inesita/cli/template/app/application.rb.tt
|
@@ -180,12 +179,12 @@ files:
|
|
180
179
|
- lib/inesita/cli/template/app/components/description.rb.tt
|
181
180
|
- lib/inesita/cli/template/app/components/home.rb.tt
|
182
181
|
- lib/inesita/cli/template/app/components/navbar.rb.tt
|
183
|
-
- lib/inesita/cli/template/app/index.html.slim.tt
|
184
182
|
- lib/inesita/cli/template/app/router.rb.tt
|
185
183
|
- lib/inesita/cli/template/app/store.rb.tt
|
186
|
-
- lib/inesita/cli/template/app/stylesheet.css.sass.tt
|
187
184
|
- lib/inesita/cli/template/config.ru.tt
|
185
|
+
- lib/inesita/cli/template/index.html.erb.tt
|
188
186
|
- lib/inesita/cli/template/static/inesita-rb.png
|
187
|
+
- lib/inesita/cli/template/static/stylesheet.css.tt
|
189
188
|
- lib/inesita/cli/watch.rb
|
190
189
|
- lib/inesita/config.rb
|
191
190
|
- lib/inesita/minify.rb
|
@@ -218,11 +217,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
218
217
|
version: '0'
|
219
218
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
220
219
|
requirements:
|
221
|
-
- - "
|
220
|
+
- - ">"
|
222
221
|
- !ruby/object:Gem::Version
|
223
|
-
version:
|
222
|
+
version: 1.3.1
|
224
223
|
requirements: []
|
225
|
-
rubygems_version: 3.
|
224
|
+
rubygems_version: 3.4.12
|
226
225
|
signing_key:
|
227
226
|
specification_version: 4
|
228
227
|
summary: Frontend web framework for Opal
|