receptive 0.1.0.alpha → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +2 -0
- data/Gemfile.lock +25 -28
- data/HANDBOOK.md +4 -2
- data/Rakefile +2 -2
- data/lib/receptive/version.rb +1 -1
- data/lib-opal/receptive/app.rb +7 -2
- data/lib-opal/receptive/jquery.rb +15 -0
- data/lib-opal/receptive.js.rb +1 -0
- data/receptive.gemspec +5 -6
- data/test-opal/test_helper.rb +1 -0
- metadata +28 -48
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b5a046ccbe547e85576b2aa9e9eb610a18d10ece35f0616bb8d12202dcc127f9
|
4
|
+
data.tar.gz: f1600e2397e89c6b045383162da8255320bcba1c464b7986de0a79ff4d401a28
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d6daa1c5743f3e3a201cd26f663a1f07c1acac73c40248dcb0b6efba69cccc7f8b5a0a684439ec34e18995483ea63d1928541310ab2d1d3e299fc1f7a2540cec
|
7
|
+
data.tar.gz: 7ad9555fd27313360313f451b7e1a6f97f2d5c467bc2314f6cb3d2c790ee8a054d7e1d8bfb935caf977384c21c3acfb1f6bb3dbc371cea57203a057fcc6a17bc
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,43 +1,40 @@
|
|
1
|
+
GIT
|
2
|
+
remote: https://github.com/opal/opal-jquery
|
3
|
+
revision: 5dcc673d0b5a34a3278526d258bf6a672938cac1
|
4
|
+
specs:
|
5
|
+
opal-jquery (0.5.1)
|
6
|
+
opal (>= 0.10.0, < 2.0)
|
7
|
+
|
1
8
|
PATH
|
2
9
|
remote: .
|
3
10
|
specs:
|
4
|
-
receptive (0.
|
5
|
-
opal (
|
6
|
-
opal-jquery (~> 0.
|
7
|
-
opal-minitest (= 0.0.5)
|
11
|
+
receptive (0.3.0)
|
12
|
+
opal (~> 1.0)
|
13
|
+
opal-jquery (~> 0.5)
|
8
14
|
|
9
15
|
GEM
|
10
16
|
remote: https://rubygems.org/
|
11
17
|
specs:
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
opal-minitest (0.0.5)
|
23
|
-
opal (>= 0.8)
|
24
|
-
rake (~> 10)
|
25
|
-
rack (2.0.4)
|
26
|
-
rake (10.5.0)
|
27
|
-
sourcemap (0.1.1)
|
28
|
-
sprockets (3.7.1)
|
29
|
-
concurrent-ruby (~> 1.0)
|
30
|
-
rack (> 1, < 3)
|
31
|
-
tilt (2.0.8)
|
18
|
+
ast (2.4.2)
|
19
|
+
minitest (5.21.1)
|
20
|
+
opal (1.8.2)
|
21
|
+
ast (>= 2.3.0)
|
22
|
+
parser (~> 3.0, >= 3.0.3.2)
|
23
|
+
parser (3.3.0.4)
|
24
|
+
ast (~> 2.4.1)
|
25
|
+
racc
|
26
|
+
racc (1.7.3)
|
27
|
+
rake (13.1.0)
|
32
28
|
|
33
29
|
PLATFORMS
|
34
30
|
ruby
|
35
31
|
|
36
32
|
DEPENDENCIES
|
37
|
-
bundler
|
38
|
-
minitest
|
39
|
-
|
33
|
+
bundler
|
34
|
+
minitest
|
35
|
+
opal-jquery!
|
36
|
+
rake (>= 13)
|
40
37
|
receptive!
|
41
38
|
|
42
39
|
BUNDLED WITH
|
43
|
-
|
40
|
+
2.5.4
|
data/HANDBOOK.md
CHANGED
@@ -14,6 +14,7 @@ The README example, annotated:
|
|
14
14
|
|
15
15
|
```rb
|
16
16
|
require 'opal'
|
17
|
+
require 'jquery' # your own jQuery version
|
17
18
|
require 'receptive'
|
18
19
|
|
19
20
|
class HelloWorld
|
@@ -22,8 +23,8 @@ class HelloWorld
|
|
22
23
|
self.selector = ".hello-world" # this will set the root-node for our view
|
23
24
|
|
24
25
|
# `on` takes an event, and optionally a selector
|
25
|
-
|
26
|
-
|
26
|
+
# leaving the selector black will listen for events
|
27
|
+
on :click, 'button' do |event| # on the root-node
|
27
28
|
|
28
29
|
@greeting_text = find('input').text # `find` operates only on inside the root-node
|
29
30
|
|
@@ -43,6 +44,7 @@ Receptive::App.run
|
|
43
44
|
*upcoming chapters…*
|
44
45
|
|
45
46
|
## Application lifecycle
|
47
|
+
## Events
|
46
48
|
## Incremental DOM
|
47
49
|
## The `render!` method
|
48
50
|
## `window` and `document` events
|
data/Rakefile
CHANGED
@@ -9,12 +9,12 @@ end
|
|
9
9
|
|
10
10
|
task :test_opal do
|
11
11
|
require 'opal'
|
12
|
-
ENV['RUBYOPT'] += ' -rbundler/setup -ropal
|
12
|
+
ENV['RUBYOPT'] += ' -rbundler/setup -ropal-jquery'
|
13
13
|
files = nil
|
14
14
|
cd('test-opal') do
|
15
15
|
files = Dir['**/*_test.rb'].map{|f| "-r#{f.shellescape}"}
|
16
16
|
end
|
17
|
-
sh "opal -Ilib-opal -Itest-opal #{files.join(' ')} -e ':done'"
|
17
|
+
sh "opal -Ilib-opal -gminitest -rminitest -setc -srubygems -stempfile -Itest-opal #{files.join(' ')} -e ':done'"
|
18
18
|
end
|
19
19
|
|
20
20
|
task :test => [:test_mri, :test_opal]
|
data/lib/receptive/version.rb
CHANGED
data/lib-opal/receptive/app.rb
CHANGED
@@ -25,10 +25,15 @@ module Receptive::App
|
|
25
25
|
trigger('app:started', self)
|
26
26
|
|
27
27
|
# Managing dom:ready for sync & async script tags
|
28
|
-
app_loaded = ->*{
|
28
|
+
app_loaded = ->*{
|
29
|
+
`console.log(2, document.readyState)`
|
30
|
+
trigger('app:loaded')
|
31
|
+
trigger('ready')
|
32
|
+
}
|
29
33
|
|
30
34
|
%x{
|
31
|
-
|
35
|
+
console.log(document.readyState)
|
36
|
+
if (document.readyState === 'interactive') {
|
32
37
|
setTimeout(#{app_loaded}, 1);
|
33
38
|
} else {
|
34
39
|
document.addEventListener('DOMContentLoaded', #{app_loaded}, false);
|
data/lib-opal/receptive.js.rb
CHANGED
data/receptive.gemspec
CHANGED
@@ -21,11 +21,10 @@ Gem::Specification.new do |spec|
|
|
21
21
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
22
22
|
spec.require_paths = ["lib"]
|
23
23
|
|
24
|
-
spec.add_dependency "opal", ["
|
25
|
-
spec.add_dependency "opal-jquery", ["~> 0.
|
26
|
-
spec.add_dependency "opal-minitest", "0.0.5"
|
24
|
+
spec.add_dependency "opal", ["~> 1.0"]
|
25
|
+
spec.add_dependency "opal-jquery", ["~> 0.5"]
|
27
26
|
|
28
|
-
spec.add_development_dependency "bundler"
|
29
|
-
spec.add_development_dependency "rake", "
|
30
|
-
spec.add_development_dependency "minitest"
|
27
|
+
spec.add_development_dependency "bundler"
|
28
|
+
spec.add_development_dependency "rake", ">= 13"
|
29
|
+
spec.add_development_dependency "minitest"
|
31
30
|
end
|
data/test-opal/test_helper.rb
CHANGED
metadata
CHANGED
@@ -1,106 +1,86 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: receptive
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Elia Schito
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-01-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: opal
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: 0.10.5
|
20
|
-
- - "<"
|
17
|
+
- - "~>"
|
21
18
|
- !ruby/object:Gem::Version
|
22
|
-
version: '0
|
19
|
+
version: '1.0'
|
23
20
|
type: :runtime
|
24
21
|
prerelease: false
|
25
22
|
version_requirements: !ruby/object:Gem::Requirement
|
26
23
|
requirements:
|
27
|
-
- - "
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
version: 0.10.5
|
30
|
-
- - "<"
|
24
|
+
- - "~>"
|
31
25
|
- !ruby/object:Gem::Version
|
32
|
-
version: '0
|
26
|
+
version: '1.0'
|
33
27
|
- !ruby/object:Gem::Dependency
|
34
28
|
name: opal-jquery
|
35
29
|
requirement: !ruby/object:Gem::Requirement
|
36
30
|
requirements:
|
37
31
|
- - "~>"
|
38
32
|
- !ruby/object:Gem::Version
|
39
|
-
version: 0.
|
33
|
+
version: '0.5'
|
40
34
|
type: :runtime
|
41
35
|
prerelease: false
|
42
36
|
version_requirements: !ruby/object:Gem::Requirement
|
43
37
|
requirements:
|
44
38
|
- - "~>"
|
45
39
|
- !ruby/object:Gem::Version
|
46
|
-
version: 0.
|
47
|
-
- !ruby/object:Gem::Dependency
|
48
|
-
name: opal-minitest
|
49
|
-
requirement: !ruby/object:Gem::Requirement
|
50
|
-
requirements:
|
51
|
-
- - '='
|
52
|
-
- !ruby/object:Gem::Version
|
53
|
-
version: 0.0.5
|
54
|
-
type: :runtime
|
55
|
-
prerelease: false
|
56
|
-
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
requirements:
|
58
|
-
- - '='
|
59
|
-
- !ruby/object:Gem::Version
|
60
|
-
version: 0.0.5
|
40
|
+
version: '0.5'
|
61
41
|
- !ruby/object:Gem::Dependency
|
62
42
|
name: bundler
|
63
43
|
requirement: !ruby/object:Gem::Requirement
|
64
44
|
requirements:
|
65
|
-
- - "
|
45
|
+
- - ">="
|
66
46
|
- !ruby/object:Gem::Version
|
67
|
-
version: '
|
47
|
+
version: '0'
|
68
48
|
type: :development
|
69
49
|
prerelease: false
|
70
50
|
version_requirements: !ruby/object:Gem::Requirement
|
71
51
|
requirements:
|
72
|
-
- - "
|
52
|
+
- - ">="
|
73
53
|
- !ruby/object:Gem::Version
|
74
|
-
version: '
|
54
|
+
version: '0'
|
75
55
|
- !ruby/object:Gem::Dependency
|
76
56
|
name: rake
|
77
57
|
requirement: !ruby/object:Gem::Requirement
|
78
58
|
requirements:
|
79
|
-
- - "
|
59
|
+
- - ">="
|
80
60
|
- !ruby/object:Gem::Version
|
81
|
-
version: '
|
61
|
+
version: '13'
|
82
62
|
type: :development
|
83
63
|
prerelease: false
|
84
64
|
version_requirements: !ruby/object:Gem::Requirement
|
85
65
|
requirements:
|
86
|
-
- - "
|
66
|
+
- - ">="
|
87
67
|
- !ruby/object:Gem::Version
|
88
|
-
version: '
|
68
|
+
version: '13'
|
89
69
|
- !ruby/object:Gem::Dependency
|
90
70
|
name: minitest
|
91
71
|
requirement: !ruby/object:Gem::Requirement
|
92
72
|
requirements:
|
93
|
-
- - "
|
73
|
+
- - ">="
|
94
74
|
- !ruby/object:Gem::Version
|
95
|
-
version: '
|
75
|
+
version: '0'
|
96
76
|
type: :development
|
97
77
|
prerelease: false
|
98
78
|
version_requirements: !ruby/object:Gem::Requirement
|
99
79
|
requirements:
|
100
|
-
- - "
|
80
|
+
- - ">="
|
101
81
|
- !ruby/object:Gem::Version
|
102
|
-
version: '
|
103
|
-
description:
|
82
|
+
version: '0'
|
83
|
+
description:
|
104
84
|
email:
|
105
85
|
- elia@schito.me
|
106
86
|
executables: []
|
@@ -121,6 +101,7 @@ files:
|
|
121
101
|
- lib-opal/receptive/app.rb
|
122
102
|
- lib-opal/receptive/incremental-dom-0.5.1.js
|
123
103
|
- lib-opal/receptive/incremental_dom.js.rb
|
104
|
+
- lib-opal/receptive/jquery.rb
|
124
105
|
- lib-opal/receptive/view.rb
|
125
106
|
- lib/receptive.rb
|
126
107
|
- lib/receptive/version.rb
|
@@ -132,7 +113,7 @@ homepage: https://github.com/elia/receptive#readme
|
|
132
113
|
licenses:
|
133
114
|
- MIT
|
134
115
|
metadata: {}
|
135
|
-
post_install_message:
|
116
|
+
post_install_message:
|
136
117
|
rdoc_options: []
|
137
118
|
require_paths:
|
138
119
|
- lib
|
@@ -143,13 +124,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
143
124
|
version: '0'
|
144
125
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
145
126
|
requirements:
|
146
|
-
- - "
|
127
|
+
- - ">="
|
147
128
|
- !ruby/object:Gem::Version
|
148
|
-
version:
|
129
|
+
version: '0'
|
149
130
|
requirements: []
|
150
|
-
|
151
|
-
|
152
|
-
signing_key:
|
131
|
+
rubygems_version: 3.5.4
|
132
|
+
signing_key:
|
153
133
|
specification_version: 4
|
154
134
|
summary: The perfect toolkit to lighten up your existing HTML
|
155
135
|
test_files: []
|