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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9f4b45907709281428dd8d3864bed092143f4e7542c0f1a5b9d9aed2c005b95f
4
- data.tar.gz: 22a456c8dd79e115ba8cbe2fb3706e75b4f70b31b310ae6412067405616fe34a
3
+ metadata.gz: b5a046ccbe547e85576b2aa9e9eb610a18d10ece35f0616bb8d12202dcc127f9
4
+ data.tar.gz: f1600e2397e89c6b045383162da8255320bcba1c464b7986de0a79ff4d401a28
5
5
  SHA512:
6
- metadata.gz: b543eb6ee8a093fd62a9b3dce5db88418b1cdfeb102e1a0a461e14cfd9284d74bb2b91c1efeda359f4bcc49def4f0d5bbe137988bedaa1864109387def270dea
7
- data.tar.gz: d11818c1327dd29fb395304bd299ac1b4cc1d981e0cb3b03ea32d80108de0c82d382cd7fa73722c3ef1cbb4f1595e77c5ef15b18103e401464dedf9ef8cb7075
6
+ metadata.gz: d6daa1c5743f3e3a201cd26f663a1f07c1acac73c40248dcb0b6efba69cccc7f8b5a0a684439ec34e18995483ea63d1928541310ab2d1d3e299fc1f7a2540cec
7
+ data.tar.gz: 7ad9555fd27313360313f451b7e1a6f97f2d5c467bc2314f6cb3d2c790ee8a054d7e1d8bfb935caf977384c21c3acfb1f6bb3dbc371cea57203a057fcc6a17bc
data/Gemfile CHANGED
@@ -4,3 +4,5 @@ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
4
 
5
5
  # Specify your gem's dependencies in receptive.gemspec
6
6
  gemspec
7
+
8
+ gem 'opal-jquery', github: 'opal/opal-jquery'
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.1.0.alpha)
5
- opal (>= 0.10.5, < 0.12)
6
- opal-jquery (~> 0.4.2)
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
- concurrent-ruby (1.0.5)
13
- hike (1.2.3)
14
- minitest (5.11.3)
15
- opal (0.10.5)
16
- hike (~> 1.2)
17
- sourcemap (~> 0.1.0)
18
- sprockets (~> 3.1)
19
- tilt (>= 1.4)
20
- opal-jquery (0.4.2)
21
- opal (>= 0.7.0, < 0.11.0)
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 (~> 1.16)
38
- minitest (~> 5.0)
39
- rake (~> 10.0)
33
+ bundler
34
+ minitest
35
+ opal-jquery!
36
+ rake (>= 13)
40
37
  receptive!
41
38
 
42
39
  BUNDLED WITH
43
- 1.16.1
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
- on(:click, 'button') do |event| # leaving the selector black will listen for events
26
- # on the root-node
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/minitest '
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]
@@ -1,3 +1,3 @@
1
1
  module Receptive
2
- VERSION = "0.1.0.alpha"
2
+ VERSION = "0.3.0"
3
3
  end
@@ -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 = ->*{ trigger('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
- if (document.readyState === 'complete') {
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);
@@ -0,0 +1,15 @@
1
+ require 'opal-jquery'
2
+
3
+ class Element
4
+ def has?(selector_or_element)
5
+ `#{self}.has(#{selector_or_element}).length !== 0`
6
+ end
7
+
8
+ def hidden= value
9
+ if value
10
+ attr(:hidden, true)
11
+ else
12
+ remove_attribute(:hidden)
13
+ end
14
+ end
15
+ end
@@ -1,4 +1,5 @@
1
1
  require 'console'
2
+ require 'receptive/jquery'
2
3
 
3
4
  module Receptive
4
5
  def self.silence_logs
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", [">= 0.10.5", "< 0.12"]
25
- spec.add_dependency "opal-jquery", ["~> 0.4.2"]
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", "~> 1.16"
29
- spec.add_development_dependency "rake", "~> 10.0"
30
- spec.add_development_dependency "minitest", "~> 5.0"
27
+ spec.add_development_dependency "bundler"
28
+ spec.add_development_dependency "rake", ">= 13"
29
+ spec.add_development_dependency "minitest"
31
30
  end
@@ -4,5 +4,6 @@ require "receptive"
4
4
  # require "minitest/autorun"
5
5
  require 'opal/platform'
6
6
  require 'minitest'
7
+
7
8
  `if (typeof(window) === 'undefined') window = Opal.global;` # for nodejs
8
9
  at_exit { Minitest.run ARGV; exit `Opal.global.OPAL_TEST_EXIT_STATUS` || 1 }
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.1.0.alpha
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: 2018-02-14 00:00:00.000000000 Z
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.12'
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.12'
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.4.2
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.4.2
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: '1.16'
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: '1.16'
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: '10.0'
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: '10.0'
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: '5.0'
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: '5.0'
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: 1.3.1
129
+ version: '0'
149
130
  requirements: []
150
- rubyforge_project:
151
- rubygems_version: 2.7.4
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: []