bowser 0.2.1 → 0.2.2

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
  SHA1:
3
- metadata.gz: eb2a7b79c9113fbf80802a4c3fe913f6c1906613
4
- data.tar.gz: a44101d81eae9ac27229fcd3189d5563534c4ad1
3
+ metadata.gz: ce5fa6c5aeb9bd9564a0c9de5aeedae230c98cb1
4
+ data.tar.gz: b994065c0e6d339c401224215aab94862cc130d5
5
5
  SHA512:
6
- metadata.gz: 10a66ac8eb3ec5a7c948f25fbcacad3d6696fef807d671df1cbe04281789ad60960537546b395d49d080fa07282d7bb1cccffa4efd6750e3cdb7617f23aa94ef
7
- data.tar.gz: e2f7f4ffdd77cef7fec0f7ae89a3e541bfaac428622bdabd924076053b2b27fe9f3dd5211e9cb0b2154a7742b1687ee0ad8152ece9e78e52c3b7268aed85d838
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
- As contributors and maintainers of this project, and in the interest of
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
- We are committed to making participation in this project a harassment-free
9
- experience for everyone, regardless of level of experience, gender, gender
10
- identity and expression, sexual orientation, disability, personal appearance,
11
- body size, race, ethnicity, age, religion, or nationality.
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
- * Personal attacks
17
- * Trolling or insulting/derogatory comments
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 other's private information, such as physical or electronic
20
- addresses, without explicit permission
21
- * Other unethical or unprofessional conduct
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
- By adopting this Code of Conduct, project maintainers commit themselves to
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 a project maintainer at
39
- [jgaskins@gmail.com](mailto:jgaskins@gmail.com?subject=Bowser+Code+of+Conduct).
40
- All complaints will be reviewed and investigated and will result in a response
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
- version 1.3.0, available at
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/3/0/
74
+ [version]: http://contributor-covenant.org/version/1/4/
data/README.md CHANGED
@@ -50,6 +50,8 @@ The current implementation uses the `Promise` class from the Opal standard libra
50
50
 
51
51
  ## Contributing
52
52
 
53
+ This project is governed by a [Code of Conduct](CODE_OF_CONDUCT.md)
54
+
53
55
  1. Fork it
54
56
  1. Branch it
55
57
  1. Hack it
data/bowser.gemspec CHANGED
@@ -22,5 +22,5 @@ Gem::Specification.new do |spec|
22
22
 
23
23
  spec.add_development_dependency "bundler", "~> 1.10"
24
24
  spec.add_development_dependency "rake", "~> 10.0"
25
- spec.add_development_dependency "opal-rspec", "~> 0.5.0"
25
+ spec.add_development_dependency "opal-rspec"
26
26
  end
@@ -1,3 +1,3 @@
1
1
  module Bowser
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
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.currentTarget`)
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
- if args.one?
47
- property = args[0].gsub(/_[a-z]/) { |match| match[-1, 1].upcase }
48
- `#@native[property]`
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
- super
54
+ value
51
55
  end
52
56
  end
53
57
 
@@ -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 = `new WebSocket(url)`
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.1
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-08-17 00:00:00.000000000 Z
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.5.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.5.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.6.6
128
+ rubygems_version: 2.5.1
129
129
  signing_key:
130
130
  specification_version: 4
131
131
  summary: Minimalist browser support for Opal apps