bowser 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CODE_OF_CONDUCT.md +53 -28
- data/README.md +2 -0
- data/bowser.gemspec +1 -1
- data/lib/bowser/version.rb +1 -1
- data/opal/bowser/event.rb +10 -6
- data/opal/bowser/websocket.rb +13 -2
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ce5fa6c5aeb9bd9564a0c9de5aeedae230c98cb1
|
4
|
+
data.tar.gz: b994065c0e6d339c401224215aab94862cc130d5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ee892ddd31d6f2704945b1f2669337824d820474da28e89f425fdbaee4019e97658159727318a3c171ae0ac9f7b9bfefd8801877771e29de5c1787e0248654b0
|
7
|
+
data.tar.gz: 331da8890c1ecd26d7d60143a5ea8f2bdbd6dbd452f4c525f880ba3da8989ad6568cedcdfd52dfbe09b222dcb795c1deecd6d57fb83252b052977514c9ad5796
|
data/CODE_OF_CONDUCT.md
CHANGED
@@ -1,24 +1,41 @@
|
|
1
|
-
# Contributor Code of Conduct
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
2
|
|
3
|
-
|
4
|
-
fostering an open and welcoming community, we pledge to respect all people who
|
5
|
-
contribute through reporting issues, posting feature requests, updating
|
6
|
-
documentation, submitting pull requests or patches, and other activities.
|
3
|
+
## Our Pledge
|
7
4
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
10
|
+
orientation.
|
11
|
+
|
12
|
+
## Our Standards
|
13
|
+
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
16
|
+
|
17
|
+
* Using welcoming and inclusive language
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
19
|
+
* Gracefully accepting constructive criticism
|
20
|
+
* Focusing on what is best for the community
|
21
|
+
* Showing empathy towards other community members
|
12
22
|
|
13
23
|
Examples of unacceptable behavior by participants include:
|
14
24
|
|
15
|
-
* The use of sexualized language or imagery
|
16
|
-
|
17
|
-
* Trolling
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
18
28
|
* Public or private harassment
|
19
|
-
* Publishing
|
20
|
-
|
21
|
-
* Other
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
33
|
+
|
34
|
+
## Our Responsibilities
|
35
|
+
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
22
39
|
|
23
40
|
Project maintainers have the right and responsibility to remove, edit, or
|
24
41
|
reject comments, commits, code, wiki edits, issues, and other contributions
|
@@ -26,24 +43,32 @@ that are not aligned to this Code of Conduct, or to ban temporarily or
|
|
26
43
|
permanently any contributor for other behaviors that they deem inappropriate,
|
27
44
|
threatening, offensive, or harmful.
|
28
45
|
|
29
|
-
|
30
|
-
fairly and consistently applying these principles to every aspect of managing
|
31
|
-
this project. Project maintainers who do not follow or enforce the Code of
|
32
|
-
Conduct may be permanently removed from the project team.
|
46
|
+
## Scope
|
33
47
|
|
34
48
|
This Code of Conduct applies both within project spaces and in public spaces
|
35
|
-
when an individual is representing the project or its community.
|
49
|
+
when an individual is representing the project or its community. Examples of
|
50
|
+
representing a project or community include using an official project e-mail
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
53
|
+
further defined and clarified by project maintainers.
|
54
|
+
|
55
|
+
## Enforcement
|
36
56
|
|
37
57
|
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
38
|
-
reported by contacting
|
39
|
-
|
40
|
-
|
41
|
-
that is deemed necessary and appropriate to the circumstances. Maintainers are
|
58
|
+
reported by contacting the project team at [jgaskins@gmail.com](mailto:jgaskins@gmail.com). All
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
42
61
|
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
63
|
+
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
66
|
+
members of the project's leadership.
|
67
|
+
|
68
|
+
## Attribution
|
43
69
|
|
44
|
-
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
45
|
-
|
46
|
-
[http://contributor-covenant.org/version/1/3/0/][version]
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
+
available at [http://contributor-covenant.org/version/1/4][version]
|
47
72
|
|
48
73
|
[homepage]: http://contributor-covenant.org
|
49
|
-
[version]: http://contributor-covenant.org/version/1/
|
74
|
+
[version]: http://contributor-covenant.org/version/1/4/
|
data/README.md
CHANGED
data/bowser.gemspec
CHANGED
data/lib/bowser/version.rb
CHANGED
data/opal/bowser/event.rb
CHANGED
@@ -35,19 +35,23 @@ module Bowser
|
|
35
35
|
end
|
36
36
|
|
37
37
|
def target
|
38
|
-
Element.new(`#@native.
|
38
|
+
Element.new(`#@native.target`)
|
39
39
|
end
|
40
40
|
|
41
41
|
def code
|
42
42
|
`#@native.keyCode`
|
43
43
|
end
|
44
44
|
|
45
|
-
def method_missing *args
|
46
|
-
|
47
|
-
|
48
|
-
|
45
|
+
def method_missing name, *args
|
46
|
+
property = name.gsub(/_[a-z]/) { |match| match[-1, 1].upcase }
|
47
|
+
value = `#@native[property]`
|
48
|
+
|
49
|
+
if `!!value && #{Proc === value}`
|
50
|
+
value.call(*args)
|
51
|
+
elsif `value == null`
|
52
|
+
nil
|
49
53
|
else
|
50
|
-
|
54
|
+
value
|
51
55
|
end
|
52
56
|
end
|
53
57
|
|
data/opal/bowser/websocket.rb
CHANGED
@@ -10,11 +10,14 @@ module Bowser
|
|
10
10
|
close
|
11
11
|
)
|
12
12
|
|
13
|
-
def initialize url
|
13
|
+
def initialize url, native: `new WebSocket(url)`
|
14
14
|
@url = url
|
15
|
-
@native =
|
15
|
+
@native = native
|
16
16
|
@handlers ||= Hash.new { |h, k| h[k] = [] }
|
17
17
|
add_handlers
|
18
|
+
|
19
|
+
on(:open) { @connected = true }
|
20
|
+
on(:close) { @connected = false }
|
18
21
|
end
|
19
22
|
|
20
23
|
def on event_name, &block
|
@@ -30,6 +33,10 @@ module Bowser
|
|
30
33
|
self
|
31
34
|
end
|
32
35
|
|
36
|
+
def connected?
|
37
|
+
@connected
|
38
|
+
end
|
39
|
+
|
33
40
|
# Reconnect the websocket after a short delay if it is interrupted
|
34
41
|
def autoreconnect!(delay: 1)
|
35
42
|
return if @autoreconnect
|
@@ -40,6 +47,10 @@ module Bowser
|
|
40
47
|
end
|
41
48
|
end
|
42
49
|
|
50
|
+
def close reason=`undefined`
|
51
|
+
`#@native.close(reason)`
|
52
|
+
end
|
53
|
+
|
43
54
|
private
|
44
55
|
|
45
56
|
def add_handlers
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bowser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jamie Gaskins
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-11-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: opal
|
@@ -62,16 +62,16 @@ dependencies:
|
|
62
62
|
name: opal-rspec
|
63
63
|
requirement: !ruby/object:Gem::Requirement
|
64
64
|
requirements:
|
65
|
-
- - "
|
65
|
+
- - ">="
|
66
66
|
- !ruby/object:Gem::Version
|
67
|
-
version: 0
|
67
|
+
version: '0'
|
68
68
|
type: :development
|
69
69
|
prerelease: false
|
70
70
|
version_requirements: !ruby/object:Gem::Requirement
|
71
71
|
requirements:
|
72
|
-
- - "
|
72
|
+
- - ">="
|
73
73
|
- !ruby/object:Gem::Version
|
74
|
-
version: 0
|
74
|
+
version: '0'
|
75
75
|
description:
|
76
76
|
email:
|
77
77
|
- jgaskins@gmail.com
|
@@ -125,7 +125,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
125
125
|
version: '0'
|
126
126
|
requirements: []
|
127
127
|
rubyforge_project:
|
128
|
-
rubygems_version: 2.
|
128
|
+
rubygems_version: 2.5.1
|
129
129
|
signing_key:
|
130
130
|
specification_version: 4
|
131
131
|
summary: Minimalist browser support for Opal apps
|