Skip to content

Commit

Permalink
Remove bunch of js lines in rails
Browse files Browse the repository at this point in the history
  • Loading branch information
Prakriti-nith committed Aug 3, 2018
1 parent 10d99ad commit 48245d4
Show file tree
Hide file tree
Showing 6 changed files with 158 additions and 80 deletions.
1 change: 1 addition & 0 deletions lib/daru/data_tables/data_table.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
module Daru
module DataTables
class Engine < ::Rails::Engine; end if defined?(Rails)
class DataTable
attr_accessor :html_options, :element_id, :options, :data
# @param data [Array, Daru::DataFrame, Daru::Vector] The data provided
Expand Down
8 changes: 6 additions & 2 deletions lib/daru/data_tables/display/iruby_notebook.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,18 @@ module Daru
module DataTables
# generate initializing code
def self.generate_init_code_js(dependent_js)
js_dir = File.expand_path('../js', __dir__)
js_dir = File.expand_path(
'../../../../vendor/assets/javascripts', __dir__
)
path = File.expand_path('../templates/init.inline.js.erb', __dir__)
template = File.read(path)
ERB.new(template).result(binding)
end

def self.generate_init_code_css(dependent_css)
css_dir = File.expand_path('../css', __dir__)
css_dir = File.expand_path(
'../../../../vendor/assets/stylesheets', __dir__
)
path = File.expand_path('../templates/init.inline.css.erb', __dir__)
template = File.read(path)
ERB.new(template).result(binding)
Expand Down
8 changes: 5 additions & 3 deletions lib/tasks/data_tables.rake
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,23 @@ end
namespace :data_tables do
desc "Update datatables javascript and stylesheets dependent files"
task :update => [:js, :css, :jquery]
sh "mkdir -p vendor/assets/javascripts/"
task :js do
say "Grabbing Core js from datatables codebase..." do
sh "curl -# https://nightly.datatables.net/js/jquery.dataTables.js -L --compressed -o lib/data_tables/js/jquery.dataTables.js"
sh "curl -# https://nightly.datatables.net/js/jquery.dataTables.js -L --compressed -o vendor/assets/javascripts/jquery.dataTables.js"
end
end

sh "mkdir -p vendor/assets/stylesheets/"
task :css do
say "Grabbing css from the datatables website..." do
sh "curl -# https://nightly.datatables.net/css/jquery.dataTables.css -L --compressed -o lib/data_tables/css/jquery.dataTables.css"
sh "curl -# https://nightly.datatables.net/css/jquery.dataTables.css -L --compressed -o vendor/assets/stylesheets/jquery.dataTables.css"
end
end

task :jquery do
say "Grabbing jquery from the jquery website..." do
sh "curl -# http://code.jquery.com/jquery-latest.min.js -L --compressed -o lib/data_tables/js/jquery-latest.min.js"
sh "curl -# http://code.jquery.com/jquery-latest.min.js -L --compressed -o vendor/assets/javascripts/jquery-latest.min.js"
end
end
end
Loading

0 comments on commit 48245d4

Please sign in to comment.