Skip to content

Commit 029808e

Browse files
committedDec 7, 2014
Initial merge of lib/ and opal/ paths
1 parent a93e967 commit 029808e

File tree

11 files changed

+13
-9
lines changed

11 files changed

+13
-9
lines changed
 
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

‎lib/opal/jquery.rb

+13-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
1-
require 'opal'
2-
require 'opal/jquery/version'
1+
if RUBY_ENGINE == "opal"
2+
require 'opal-jquery/window'
3+
require 'opal-jquery/document'
4+
require 'opal-jquery/element'
5+
require 'opal-jquery/event'
6+
require 'opal-jquery/http'
7+
require 'opal-jquery/kernel'
8+
else
9+
require 'opal'
10+
require 'opal/jquery/version'
311

4-
Opal.append_path File.expand_path('../../../opal', __FILE__).untaint
12+
# do not include dependencies
13+
Opal.use_gem 'opal-jquery', false
14+
end

‎opal/opal-jquery.rb

-6
This file was deleted.

2 commit comments

Comments
 (2)

adambeynon commented on Dec 7, 2014

@adambeynon
ContributorAuthor

@elia @meh What do you think? Had a thought this morning about merging the lib/ and opal/ directories. In most opal gems, lib/ is just going to be empty for bootstrapping the opal/ directory. This makes use of the compiler directive if RUBY_ENGINE == "opal" so any irrelevant code just doesn't get compiled into the output. Also, it doesn't break anything in MRI, as the require statements are masked by the if block.

elia commented on Dec 7, 2014

@elia
Member

Looks good to me, also wondering if we should just skip opal when searching deps in use_gem. Of course doing that for opal itself would require some more pondering.

Please sign in to comment.