-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added method dependent_scripts
#107
Conversation
Pull Request Test Coverage Report for Build 646
💛 - Coveralls |
lib/daru/view.rb
Outdated
# @example | ||
# To load the dependent JS file for Nyaplot and GoogleCharts libraries | ||
# Daru::View.load_libs_in_iruby(['nyaplot','googlecharts']) | ||
def load_libs_in_iruby(libraries=[]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can use the dependent_script
method to load js in iruby as well as web frameworks.
We can check for IRuby and accordingly load js .
Examples for loading multiple adapters. |
load_libs_in_iruby
ldependent_scripts
ldependent_scripts
dependent_scripts
lib/daru/view.rb
Outdated
# | ||
# Daru::View.load_lib_in_iruby('nyaplot') | ||
# Daru::View.dependent_script(:nyaplot) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Write both examples passing string as well as symbol. In method documentation you should write the input parameter datatypes along with return value details.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
spec/view_spec.rb
Outdated
context "#dependent_scripts" do | ||
let(:script) { | ||
Daru::View.dependent_scripts( | ||
[:googlecharts, :nyaplot, :highcharts, :datatables] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spec for string input ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
lib/daru/view.rb
Outdated
private | ||
|
||
# @param libraries [Array] Adapters whose JS files will be loaded | ||
# @return [void] load the dependent JS files for the adapter in IRuby notebook |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
length
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
lib/daru/view.rb
Outdated
# | ||
# @param lib [String, Symbol] library whose dependencies are to be loaded | ||
# @return [void, String] dependent script for the library | ||
# @example |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to verify, how it looks in yard document.
@Prakriti-nith , Anything else you want to add in this PR ? |
@Shekharrajak I think it's good. |
This method can be used to load multiple adapter at once in iruby notebook.
Examples