Skip to content

Commit

Permalink
Merge pull request #92 from opal/staging
Browse files Browse the repository at this point in the history
10th composite staging pull request
  • Loading branch information
hmdne authored Nov 17, 2021
2 parents a9a1592 + c5662c9 commit c601ea7
Show file tree
Hide file tree
Showing 11 changed files with 25 additions and 22 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,19 @@ jobs:
browser: chrome
os: ubuntu-latest
opal: master
- name: Chromium/Linux/Opal-master/PromiseV2
- name: Chromium/Linux/Opal-1.3/PromiseV2
browser: chrome
os: ubuntu-latest
opal: master
opal: 1.3
promise: v2
- name: Chromium/Linux/Opal-1.2
- name: Chromium/Linux/Opal-1.3
browser: chrome
os: ubuntu-latest
opal: 1.2
- name: Chromium/Linux/Opal-1.1
opal: 1.3
- name: Chromium/Linux/Opal-1.2
browser: chrome
os: ubuntu-latest
opal: 1.1
opal: 1.2
- name: Chromium/Linux/Opal-1.0
browser: chrome
os: ubuntu-latest
Expand Down Expand Up @@ -72,7 +72,7 @@ jobs:
- uses: actions/checkout@v2
- name: set environment variables
run: |
echo "OPAL_VERSION=${{ matrix.combo.opal || '1.2' }}" >> $GITHUB_ENV
echo "OPAL_VERSION=${{ matrix.combo.opal || '1.3' }}" >> $GITHUB_ENV
echo "OPAL_BROWSER_PROMISE=${{ matrix.combo.promise || 'v1' }}" >> $GITHUB_ENV
- uses: ruby/setup-ruby@v1
with:
Expand Down
8 changes: 3 additions & 5 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ gem 'rack'
gem 'sinatra'
gem 'sinatra-websocket'
# For opal-rspec, a release is needed
gem 'opal-rspec', github: 'opal/opal-rspec', submodules: true # '>= 0.8.0.alpha1'
gem 'opal-rspec', github: 'hmdne/opal-rspec', branch: 'opal-1.3', submodules: true # '>= 0.8.0.alpha1'
gem 'opal-sprockets'
# Force build of eventmachine on Windows
gem 'eventmachine', github: 'eventmachine/eventmachine' if RUBY_PLATFORM =~ /mingw/
Expand All @@ -16,7 +16,7 @@ gem 'eventmachine', github: 'eventmachine/eventmachine' if RUBY_PLATFORM =~ /min
# runner
gem 'selenium-webdriver', require: false
gem 'rest-client', require: false
gem 'webdrivers', github: 'hmdne/webdrivers', require: false
gem 'webdrivers', require: false
gem 'rexml', require: false

# browser
Expand All @@ -27,6 +27,4 @@ when /\./
else
gem 'opal', github: 'opal/opal', ref: ENV['OPAL_VERSION']
end
# At this time, we need to use a branch. Please see:
# https://github.com/meh/paggio/issues/7
gem 'paggio', github: 'hmdne/paggio'

1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ _Gemfile_
```ruby
source 'https://rubygems.org/'

gem 'paggio', github: 'hmdne/paggio'
gem 'opal-browser'
```

Expand Down
1 change: 1 addition & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
require 'bundler'
Bundler.require
require 'bundler/gem_tasks'

require 'webdrivers'
load 'webdrivers/Rakefile'
Expand Down
3 changes: 2 additions & 1 deletion examples/component/app/application.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
require "opal"
require "console"
require "promise"
require "browser/setup/full"

# Let's test some element before we have been initialized.
Expand All @@ -15,7 +16,7 @@ class MyCounter < Browser::DOM::Element::Custom

self.observed_attributes = %w[value]

def initialize
def initialize(node)
super
end

Expand Down
5 changes: 2 additions & 3 deletions index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
<html>
<head>
<title>Opal Browser - RSpec Runner</title>

</head>
<body>
<script>
window.onerror = function(msg, url, line) {
var error = document.createElement("div");
Expand All @@ -18,8 +19,6 @@
<script src="spec/wgxpath.install.js"></script>

<%= javascript_include_tag @server.main %>
</head>
<body>
</body>
</html>

2 changes: 1 addition & 1 deletion opal-browser.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ Gem::Specification.new {|s|
s.require_paths = ['lib']

s.add_dependency 'opal', ['>= 1.0', '< 2.0']
s.add_dependency 'paggio'
s.add_dependency 'paggio', '>= 0.3.0'
}
5 changes: 5 additions & 0 deletions opal/browser/dom/node.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ def self.new(value)
end
end

def initialize(node)
raise ArgumentError, "Please ensure that #initialize of #{self.class} accepts one argument" unless node
super
end

# Return true of the other element is the same underlying DOM node.
#
# @return [Boolean]
Expand Down
4 changes: 2 additions & 2 deletions opal/browser/socket.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ module Browser
# connection.
#
# @see https://developer.mozilla.org/en-US/docs/Web/API/WebSocket
class Socket
class Socket < IO
def self.supported?
Browser.supports? :WebSocket
end

include Native::Wrapper
include IO::Writable
include IO::Writable if defined? IO::Writable
include Event::Target

target {|value|
Expand Down
2 changes: 1 addition & 1 deletion opal/browser/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Browser
VERSION = '0.2.0'
VERSION = '0.3.0'
end
2 changes: 1 addition & 1 deletion spec/dom/element/custom_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

def create_custom_class(name, observed_attrs = [])
Class.new(Browser::DOM::Element::Custom) do
def initialize
def initialize(node)
super
$scratchpad[:initialized] = true
end
Expand Down

0 comments on commit c601ea7

Please sign in to comment.