Skip to content

Commit 2e13125

Browse files
committed
Fix extensions to work under non-init_iruby environment
1 parent 734ed07 commit 2e13125

File tree

4 files changed

+8
-0
lines changed

4 files changed

+8
-0
lines changed

lib/bionya/core.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
module Nyaplot
22
add_extension("Bionya")
33
add_additional_library("Bionya","https://rawgit.com/domitry/nyaplot/master/lib/bionya/js/release/bionya")
4+
init_iruby if defined? IRuby
45
end

lib/mapnya/core.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
module Nyaplot
22
add_extension("Mapnya")
33
add_additional_library("Mapnya","https://rawgit.com/domitry/nyaplot/master/lib/mapnya/js/release/mapnya")
4+
init_iruby if defined? IRuby
45
end

lib/nyaplot/core.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ def self.add_dependency(name, url)
2121
@@dep_libraries[name]=url;
2222
end
2323

24+
# Load extension library to IRuby notebook before Nyaplotjs is loaded
25+
def self.add_additional_library(name, url)
26+
@@additional_libraries[name]=url
27+
end
28+
2429
# Enable to show plots on IRuby notebook
2530
def self.init_iruby
2631
path = File.expand_path("../templates/init.js.erb", __FILE__)

lib/nyaplot3d/core.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ module Nyaplot
22
add_extension("Elegans")
33
add_dependency("THREE","http://cdnjs.cloudflare.com/ajax/libs/three.js/r66/three.min")
44
add_dependency("Elegans","http://rawgit.com/domitry/elegans/nyaplot-extension/release/elegans")
5+
init_iruby if defined? IRuby
56
end

0 commit comments

Comments
 (0)