Skip to content
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
Merged

Conversation

Prakriti-nith
Copy link
Contributor

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

@coveralls
Copy link

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

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=[])
Copy link
Member

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 .

@Prakriti-nith
Copy link
Contributor Author

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 Added method load_libs_in_iruby Added method ldependent_scripts Jul 23, 2018
@Prakriti-nith Prakriti-nith changed the title Added method ldependent_scripts Added method dependent_scripts Jul 23, 2018
lib/daru/view.rb Outdated
#
# Daru::View.load_lib_in_iruby('nyaplot')
# Daru::View.dependent_script(:nyaplot)
Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spec for string input ?

Copy link
Contributor Author

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

length

Copy link
Contributor Author

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
Copy link
Member

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.

@Shekharrajak
Copy link
Member

Shekharrajak commented Jul 28, 2018

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

@Prakriti-nith
Copy link
Contributor Author

@Shekharrajak I think it's good.

@Shekharrajak Shekharrajak merged commit e1e62f5 into SciRuby:master Jul 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants