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

Merged
merged 5 commits into from Jul 29, 2018

Conversation

Projects
None yet
3 participants
@Prakriti-nith
Contributor

Prakriti-nith commented Jul 11, 2018

This method can be used to load multiple adapter at once in iruby notebook.
Examples

@coveralls

This comment has been minimized.

coveralls commented Jul 11, 2018

Pull Request Test Coverage Report for Build 646

  • 60 of 61 (98.36%) changed or added relevant lines in 2 files are covered.
  • 42 unchanged lines in 9 files lost coverage.
  • Overall coverage increased (+1.6%) to 97.779%

Changes Missing Coverage Covered Lines Changed/Added Lines %
lib/daru/view.rb 17 18 94.44%
Files with Coverage Reduction New Missed Lines %
lib/daru/view/adapters/googlecharts/display.rb 1 96.72%
spec/adapters/googlecharts/base_chart_spec.rb 1 96.97%
lib/daru/view/table.rb 2 93.75%
lib/daru/view/adapters/datatables.rb 2 93.55%
lib/daru/view/plot.rb 5 86.84%
lib/daru/view/adapters/nyaplot.rb 6 72.73%
lib/daru/view/adapters/highcharts.rb 6 88.89%
lib/daru/view/adapters/highcharts/display.rb 7 92.91%
lib/daru/view/adapters/googlecharts.rb 12 89.38%
Totals Coverage Status
Change from base Build 578: 1.6%
Covered Lines: 2686
Relevant Lines: 2747

💛 - Coveralls
# @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=[])

This comment has been minimized.

@Shekharrajak

Shekharrajak Jul 22, 2018

Collaborator

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 .

@Prakriti-nith

This comment has been minimized.

Contributor

Prakriti-nith commented Jul 23, 2018

Examples for loading multiple adapters.
@Shekharrajak can you please review this PR?

@Prakriti-nith Prakriti-nith changed the title from Added method `load_libs_in_iruby` to Added method `ldependent_scripts` Jul 23, 2018

@Prakriti-nith Prakriti-nith changed the title from Added method `ldependent_scripts` to Added method `dependent_scripts` Jul 23, 2018

#
# Daru::View.load_lib_in_iruby('nyaplot')
# Daru::View.dependent_script(:nyaplot)

This comment has been minimized.

@Shekharrajak

Shekharrajak Jul 26, 2018

Collaborator

Write both examples passing string as well as symbol. In method documentation you should write the input parameter datatypes along with return value details.

This comment has been minimized.

@Prakriti-nith

Prakriti-nith Jul 26, 2018

Contributor

Done

context "#dependent_scripts" do
let(:script) {
Daru::View.dependent_scripts(
[:googlecharts, :nyaplot, :highcharts, :datatables]

This comment has been minimized.

@Shekharrajak

Shekharrajak Jul 26, 2018

Collaborator

Spec for string input ?

This comment has been minimized.

@Prakriti-nith

Prakriti-nith Jul 26, 2018

Contributor

Done

private
# @param libraries [Array] Adapters whose JS files will be loaded
# @return [void] load the dependent JS files for the adapter in IRuby notebook

This comment has been minimized.

@Shekharrajak

Shekharrajak Jul 26, 2018

Collaborator

length

This comment has been minimized.

@Prakriti-nith

Prakriti-nith Jul 26, 2018

Contributor

Done

#
# @param lib [String, Symbol] library whose dependencies are to be loaded
# @return [void, String] dependent script for the library
# @example

This comment has been minimized.

@Shekharrajak

Shekharrajak Jul 28, 2018

Collaborator

Need to verify, how it looks in yard document.

@Shekharrajak

This comment has been minimized.

Collaborator

Shekharrajak commented Jul 28, 2018

@Prakriti-nith , Anything else you want to add in this PR ?

@Prakriti-nith

This comment has been minimized.

Contributor

Prakriti-nith commented Jul 28, 2018

@Shekharrajak I think it's good.

@Shekharrajak Shekharrajak merged commit e1e62f5 into SciRuby:master Jul 29, 2018

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage increased (+1.6%) to 97.779%
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment