Skip to content

Commit

Permalink
Merge 981136f into a7fce46
Browse files Browse the repository at this point in the history
  • Loading branch information
Shekharrajak committed Oct 2, 2020
2 parents a7fce46 + 981136f commit ac77b0a
Show file tree
Hide file tree
Showing 4 changed files with 158 additions and 237 deletions.
4 changes: 2 additions & 2 deletions lib/daru/view/constants.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
HIGHCHARTS_DEPENDENCIES_CSS = ['highcharts.css'].freeze

# Dependent GoogleCharts JS constants for IRuby notebook
GOOGLECHARTS_DEPENDENCIES_IRUBY = ['google_visualr.js', 'loader.js'].freeze
GOOGLECHARTS_DEPENDENCIES_IRUBY = ['loader.js'].freeze

# Dependent GoogleCharts JS constants for web frameworks
GOOGLECHARTS_DEPENDENCIES_WEB = ['google_visualr.js', 'loader.js', 'jspdf.min.js'].freeze
GOOGLECHARTS_DEPENDENCIES_WEB = [ 'loader.js', 'jspdf.min.js'].freeze

# Regex pattern to match a valid URL
PATTERN_URL = Regexp.new(
Expand Down
28 changes: 16 additions & 12 deletions spec/view_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,14 @@
let(:script_str) {
Daru::View.dependent_scripts(['googlecharts', 'nyaplot'])
}
it "generates dependent JS of googlecharts" do
expect(script_str).to match(/BEGIN google_visualr.js/)
expect(script_str).to match(/END google_visualr.js/)
expect(script_str).to match(/BEGIN loader.js/)
expect(script_str).to match(/END loader.js/)
end
# PR: https://github.com/SciRuby/daru-view/pull/158
# Note: Not sure why google_visualr.js is removed from googlechart
# it "generates dependent JS of googlecharts" do
# expect(script_str).to match(/BEGIN google_visualr.js/)
# expect(script_str).to match(/END google_visualr.js/)
# expect(script_str).to match(/BEGIN loader.js/)
# expect(script_str).to match(/END loader.js/)
# end
it "generates dependent JS of nyaplot" do
expect(script_str).to match(/http:\/\/cdnjs.cloudflare.com/)
expect(script_str).to match(/"downloadable":"http:\/\/cdn.rawgit.com/)
Expand All @@ -96,12 +98,14 @@
expect(script).to match(/BEGIN modules\/data.js/i)
expect(script).to match(/END modules\/data.js/i)
end
it "generates dependent JS of googlecharts" do
expect(script).to match(/BEGIN google_visualr.js/)
expect(script).to match(/END google_visualr.js/)
expect(script).to match(/BEGIN loader.js/)
expect(script).to match(/END loader.js/)
end
# PR: https://github.com/SciRuby/daru-view/pull/158
# Note: Not sure why google_visualr.js is removed from googlechart
# it "generates dependent JS of googlecharts" do
# expect(script).to match(/BEGIN google_visualr.js/)
# expect(script).to match(/END google_visualr.js/)
# expect(script).to match(/BEGIN loader.js/)
# expect(script).to match(/END loader.js/)
# end
it "generates dependent JS of nyaplot" do
expect(script).to match(/http:\/\/cdnjs.cloudflare.com/)
expect(script).to match(/"downloadable":"http:\/\/cdn.rawgit.com/)
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ac77b0a

Please sign in to comment.