ovto 0.6.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitmodules +3 -0
- data/CHANGELOG.md +4 -0
- data/Gemfile +2 -3
- data/Gemfile.lock +21 -25
- data/book/api/middleware.md +8 -2
- data/docs/api/Array.html +190 -0
- data/docs/api/Hash.html +196 -0
- data/docs/api/Ovto/Actions.html +1 -1
- data/docs/api/Ovto/App.html +1 -1
- data/docs/api/Ovto/Component/MoreThanOneNode.html +1 -1
- data/docs/api/Ovto/Component.html +1 -1
- data/docs/api/Ovto/Middleware/Actions.html +428 -0
- data/docs/api/Ovto/Middleware/Base.html +606 -0
- data/docs/api/Ovto/Middleware/Component.html +355 -0
- data/docs/api/Ovto/Middleware.html +288 -0
- data/docs/api/Ovto/PureComponent/StateIsNotAvailable.html +1 -1
- data/docs/api/Ovto/PureComponent.html +1 -1
- data/docs/api/Ovto/Runtime.html +1 -1
- data/docs/api/Ovto/State/MissingValue.html +1 -1
- data/docs/api/Ovto/State/UnknownStateKey.html +135 -0
- data/docs/api/Ovto/State.html +2 -2
- data/docs/api/Ovto/WiredActionSet.html +636 -0
- data/docs/api/Ovto/WiredActions.html +1 -1
- data/docs/api/Ovto.html +3 -3
- data/docs/api/_index.html +27 -4
- data/docs/api/actions.html +16 -3
- data/docs/api/app.html +15 -2
- data/docs/api/class_list.html +1 -1
- data/docs/api/component.html +15 -2
- data/docs/api/fetch.html +17 -4
- data/docs/api/file.README.html +1 -1
- data/docs/api/index.html +1 -1
- data/docs/api/method_list.html +85 -53
- data/docs/api/middleware.html +498 -0
- data/docs/api/pure_component.html +17 -4
- data/docs/api/state.html +15 -2
- data/docs/api/top-level-namespace.html +4 -2
- data/docs/guides/debugging.html +15 -2
- data/docs/guides/development.html +15 -2
- data/docs/guides/install.html +15 -2
- data/docs/guides/tutorial.html +15 -2
- data/docs/index.html +15 -2
- data/docs/search_index.json +1 -1
- data/examples/sinatra/Gemfile +2 -0
- data/examples/sinatra/Gemfile.lock +32 -30
- data/examples/sinatra/app.rb +1 -4
- data/examples/sinatra/config.ru +6 -6
- data/examples/static/Gemfile.lock +9 -9
- data/lib/ovto/component.rb +3 -0
- data/lib/ovto/version.rb +1 -1
- data/lib/ovto.rb +2 -1
- metadata +15 -7
data/examples/sinatra/Gemfile
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: ../..
|
3
3
|
specs:
|
4
|
-
ovto (0.
|
4
|
+
ovto (0.6.0)
|
5
5
|
opal (>= 0.11, < 2)
|
6
6
|
rack (~> 2.0)
|
7
7
|
thor (~> 0.20)
|
@@ -9,44 +9,44 @@ PATH
|
|
9
9
|
GEM
|
10
10
|
remote: https://rubygems.org/
|
11
11
|
specs:
|
12
|
-
ast (2.4.
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
opal (
|
12
|
+
ast (2.4.2)
|
13
|
+
concurrent-ruby (1.1.9)
|
14
|
+
multi_json (1.15.0)
|
15
|
+
mustermann (1.1.1)
|
16
|
+
ruby2_keywords (~> 0.0.1)
|
17
|
+
nio4r (2.5.8)
|
18
|
+
opal (1.2.0)
|
19
19
|
ast (>= 2.3.0)
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
opal (~> 0.11.0)
|
25
|
-
sprockets (~> 3.7)
|
20
|
+
parser (~> 3.0)
|
21
|
+
opal-sprockets (1.0.2)
|
22
|
+
opal (>= 1.0, < 2.0)
|
23
|
+
sprockets (~> 4.0)
|
26
24
|
tilt (>= 1.4)
|
27
|
-
parser (
|
28
|
-
ast (~> 2.
|
29
|
-
|
30
|
-
|
25
|
+
parser (3.0.2.0)
|
26
|
+
ast (~> 2.4.1)
|
27
|
+
puma (5.5.2)
|
28
|
+
nio4r (~> 2.0)
|
29
|
+
rack (2.2.3)
|
30
|
+
rack-protection (2.1.0)
|
31
31
|
rack
|
32
|
-
|
32
|
+
rake (13.0.6)
|
33
|
+
ruby2_keywords (0.0.5)
|
34
|
+
sinatra (2.1.0)
|
33
35
|
mustermann (~> 1.0)
|
34
|
-
rack (~> 2.
|
35
|
-
rack-protection (= 2.0
|
36
|
+
rack (~> 2.2)
|
37
|
+
rack-protection (= 2.1.0)
|
36
38
|
tilt (~> 2.0)
|
37
|
-
sinatra-contrib (2.0
|
38
|
-
backports (>= 2.8.2)
|
39
|
+
sinatra-contrib (2.1.0)
|
39
40
|
multi_json
|
40
41
|
mustermann (~> 1.0)
|
41
|
-
rack-protection (= 2.0
|
42
|
-
sinatra (= 2.0
|
43
|
-
tilt (
|
44
|
-
|
45
|
-
sprockets (3.7.2)
|
42
|
+
rack-protection (= 2.1.0)
|
43
|
+
sinatra (= 2.1.0)
|
44
|
+
tilt (~> 2.0)
|
45
|
+
sprockets (4.0.2)
|
46
46
|
concurrent-ruby (~> 1.0)
|
47
47
|
rack (> 1, < 3)
|
48
48
|
thor (0.20.3)
|
49
|
-
tilt (2.0.
|
49
|
+
tilt (2.0.10)
|
50
50
|
|
51
51
|
PLATFORMS
|
52
52
|
ruby
|
@@ -54,9 +54,11 @@ PLATFORMS
|
|
54
54
|
DEPENDENCIES
|
55
55
|
opal-sprockets
|
56
56
|
ovto!
|
57
|
+
puma
|
57
58
|
rack
|
59
|
+
rake
|
58
60
|
sinatra
|
59
61
|
sinatra-contrib
|
60
62
|
|
61
63
|
BUNDLED WITH
|
62
|
-
2.
|
64
|
+
2.2.22
|
data/examples/sinatra/app.rb
CHANGED
@@ -3,16 +3,13 @@ require 'sinatra/reloader'
|
|
3
3
|
require 'opal'
|
4
4
|
|
5
5
|
class SinatraApp < Sinatra::Base
|
6
|
-
# Proc to generate javascript include tag (see config.ru)
|
7
|
-
set :generate_javascript_include_tag, nil
|
8
|
-
|
9
6
|
configure(:development) do
|
10
7
|
register Sinatra::Reloader
|
11
8
|
also_reload "#{__dir__}/**/*.rb"
|
12
9
|
end
|
13
10
|
|
14
11
|
get '/' do
|
15
|
-
@js_tag =
|
12
|
+
@js_tag = $GENERATE_JAVASCRIPT_INCLUDE_TAG.call # Defined in config.ru
|
16
13
|
erb :index # Render views/index.erb
|
17
14
|
end
|
18
15
|
end
|
data/examples/sinatra/config.ru
CHANGED
@@ -2,20 +2,20 @@ require 'opal/sprockets'
|
|
2
2
|
require_relative './app.rb'
|
3
3
|
|
4
4
|
Opal.use_gem 'ovto'
|
5
|
-
|
5
|
+
opal_server = Opal::Sprockets::Server.new {|s|
|
6
6
|
s.append_path './ovto/'
|
7
7
|
s.main = 'app'
|
8
8
|
}
|
9
9
|
|
10
|
-
sprockets =
|
10
|
+
sprockets = opal_server.sprockets
|
11
11
|
prefix = '/assets'
|
12
12
|
|
13
13
|
map prefix do
|
14
14
|
run sprockets
|
15
15
|
end
|
16
16
|
|
17
|
-
|
18
|
-
|
19
|
-
::Opal::Sprockets.javascript_include_tag('app', sprockets: sprockets, prefix: prefix, debug: true)
|
20
|
-
}
|
17
|
+
$GENERATE_JAVASCRIPT_INCLUDE_TAG = ->{
|
18
|
+
::Opal::Sprockets.javascript_include_tag('app', sprockets: sprockets, prefix: prefix, debug: true)
|
21
19
|
}
|
20
|
+
|
21
|
+
run SinatraApp
|
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: ../..
|
3
3
|
specs:
|
4
|
-
ovto (0.
|
4
|
+
ovto (0.6.0)
|
5
5
|
opal (>= 0.11, < 2)
|
6
6
|
rack (~> 2.0)
|
7
7
|
thor (~> 0.20)
|
@@ -9,15 +9,15 @@ PATH
|
|
9
9
|
GEM
|
10
10
|
remote: https://rubygems.org/
|
11
11
|
specs:
|
12
|
-
ast (2.4.
|
12
|
+
ast (2.4.2)
|
13
13
|
ifchanged (1.0.1)
|
14
|
-
opal (1.0
|
14
|
+
opal (1.2.0)
|
15
15
|
ast (>= 2.3.0)
|
16
|
-
parser (~>
|
17
|
-
parser (
|
18
|
-
ast (~> 2.4.
|
19
|
-
rack (2.
|
20
|
-
rake (13.0.
|
16
|
+
parser (~> 3.0)
|
17
|
+
parser (3.0.2.0)
|
18
|
+
ast (~> 2.4.1)
|
19
|
+
rack (2.2.3)
|
20
|
+
rake (13.0.6)
|
21
21
|
thor (0.20.3)
|
22
22
|
|
23
23
|
PLATFORMS
|
@@ -29,4 +29,4 @@ DEPENDENCIES
|
|
29
29
|
rake
|
30
30
|
|
31
31
|
BUNDLED WITH
|
32
|
-
2.
|
32
|
+
2.2.22
|
data/lib/ovto/component.rb
CHANGED
@@ -114,6 +114,9 @@ module Ovto
|
|
114
114
|
when String
|
115
115
|
children = render_children(content, block)
|
116
116
|
tag_name, base_attributes = *extract_attrs(_tag_name)
|
117
|
+
if tag_name == "textarea" && (content || block)
|
118
|
+
raise ArgumentError, "Use `value:` to specify content of a textarea"
|
119
|
+
end
|
117
120
|
# Ignore nil/false
|
118
121
|
more_attributes = attributes.reject{|k, v| !v}
|
119
122
|
result = render_tag(tag_name, merge_attrs(base_attributes, more_attributes), children)
|
data/lib/ovto/version.rb
CHANGED
data/lib/ovto.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
if RUBY_ENGINE == 'opal'
|
2
|
+
require 'opal'
|
2
3
|
require 'console'; def console; $console; end
|
3
4
|
require_relative 'ovto/actions'
|
4
5
|
require_relative 'ovto/app'
|
@@ -71,7 +72,7 @@ module Ovto
|
|
71
72
|
if accepts_state
|
72
73
|
# We can pass `state:` safely
|
73
74
|
args_with_state = {state: state}.merge(args)
|
74
|
-
return obj.__send__(meth, args_with_state, &block)
|
75
|
+
return obj.__send__(meth, **args_with_state, &block)
|
75
76
|
else
|
76
77
|
# Check it is empty (see https://github.com/opal/opal/issues/1872)
|
77
78
|
if args.empty?
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ovto
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yutaka HARA
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-10-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: opal
|
@@ -89,16 +89,24 @@ files:
|
|
89
89
|
- book/guides/tutorial.md
|
90
90
|
- book/ovtologo.png
|
91
91
|
- book/screenshot.png
|
92
|
+
- docs/api/Array.html
|
93
|
+
- docs/api/Hash.html
|
92
94
|
- docs/api/Ovto.html
|
93
95
|
- docs/api/Ovto/Actions.html
|
94
96
|
- docs/api/Ovto/App.html
|
95
97
|
- docs/api/Ovto/Component.html
|
96
98
|
- docs/api/Ovto/Component/MoreThanOneNode.html
|
99
|
+
- docs/api/Ovto/Middleware.html
|
100
|
+
- docs/api/Ovto/Middleware/Actions.html
|
101
|
+
- docs/api/Ovto/Middleware/Base.html
|
102
|
+
- docs/api/Ovto/Middleware/Component.html
|
97
103
|
- docs/api/Ovto/PureComponent.html
|
98
104
|
- docs/api/Ovto/PureComponent/StateIsNotAvailable.html
|
99
105
|
- docs/api/Ovto/Runtime.html
|
100
106
|
- docs/api/Ovto/State.html
|
101
107
|
- docs/api/Ovto/State/MissingValue.html
|
108
|
+
- docs/api/Ovto/State/UnknownStateKey.html
|
109
|
+
- docs/api/Ovto/WiredActionSet.html
|
102
110
|
- docs/api/Ovto/WiredActions.html
|
103
111
|
- docs/api/_index.html
|
104
112
|
- docs/api/actions.html
|
@@ -117,6 +125,7 @@ files:
|
|
117
125
|
- docs/api/js/full_list.js
|
118
126
|
- docs/api/js/jquery.js
|
119
127
|
- docs/api/method_list.html
|
128
|
+
- docs/api/middleware.html
|
120
129
|
- docs/api/pure_component.html
|
121
130
|
- docs/api/state.html
|
122
131
|
- docs/api/top-level-namespace.html
|
@@ -189,7 +198,7 @@ homepage: https://github.com/yhara/ovto
|
|
189
198
|
licenses:
|
190
199
|
- MIT
|
191
200
|
metadata: {}
|
192
|
-
post_install_message:
|
201
|
+
post_install_message:
|
193
202
|
rdoc_options: []
|
194
203
|
require_paths:
|
195
204
|
- lib
|
@@ -204,9 +213,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
204
213
|
- !ruby/object:Gem::Version
|
205
214
|
version: '0'
|
206
215
|
requirements: []
|
207
|
-
|
208
|
-
|
209
|
-
signing_key:
|
216
|
+
rubygems_version: 3.2.22
|
217
|
+
signing_key:
|
210
218
|
specification_version: 4
|
211
219
|
summary: Simple client-side framework for Opal
|
212
220
|
test_files: []
|