Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap-rubygem.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bootstrap.gemspec2
-rw-r--r--lib/bootstrap/version.rb2
-rw-r--r--tasks/updater/js.rb24
-rw-r--r--tasks/updater/network.rb8
4 files changed, 27 insertions, 9 deletions
diff --git a/bootstrap.gemspec b/bootstrap.gemspec
index 66d0002..7f89af8 100644
--- a/bootstrap.gemspec
+++ b/bootstrap.gemspec
@@ -14,7 +14,7 @@ Gem::Specification.new do |s|
# SassC requires Ruby 2.3.3. Also specify here to make it obvious.
s.required_ruby_version = '>= 2.3.3'
- s.add_runtime_dependency 'popper_js', '>= 1.14.3', '< 2'
+ s.add_runtime_dependency 'popper_js', '>= 1.16.1', '< 2'
s.add_runtime_dependency 'sassc-rails', '>= 2.0.0'
s.add_runtime_dependency 'autoprefixer-rails', '>= 9.1.0'
diff --git a/lib/bootstrap/version.rb b/lib/bootstrap/version.rb
index e8d328d..5d0039c 100644
--- a/lib/bootstrap/version.rb
+++ b/lib/bootstrap/version.rb
@@ -2,5 +2,5 @@
module Bootstrap
VERSION = '4.6.1'
- BOOTSTRAP_SHA = '82a1f334cf02c6b1fbb27d5da6afb89a80223c31'
+ BOOTSTRAP_SHA = 'e5643aaa89eb67327a5b4abe7db976f0ea276b70'
end
diff --git a/tasks/updater/js.rb b/tasks/updater/js.rb
index 0542629..9344004 100644
--- a/tasks/updater/js.rb
+++ b/tasks/updater/js.rb
@@ -1,7 +1,11 @@
+require 'pathname'
require 'tsort'
class Updater
module Js
+ INLINED_SRCS = %w[index.js tools/sanitizer.js].freeze
+ EXTERNAL_JS = %w[popper.js].freeze
+
def update_javascript_assets
log_status 'Updating javascripts...'
save_to = @save_to[:js]
@@ -29,13 +33,15 @@ class Updater
def bootstrap_js_files
@bootstrap_js_files ||= begin
- src_files = get_paths_by_type('js/src', /\.js$/) - %w[index.js tools/sanitizer.js]
+ src_files = get_paths_by_type('js/src', /\.js$/) - INLINED_SRCS
+ puts "src_files: #{src_files.inspect}"
imports = Deps.new
# Get the imports from the ES6 files to order requires correctly.
read_files('js/src', src_files).each do |name, content|
- imports.add name,
- *content.scan(%r{import [a-zA-Z]* from '\./(\w+)})
- .flatten(1).map { |f| "#{f}.js" }
+ file_imports = content.scan(%r{import *(?:[a-zA-Z]*|\{[a-zA-Z ,]*\}) *from '([\w/.-]+)}).flatten(1).map do |f|
+ Pathname.new(name).dirname.join(f.end_with?(".js") ? f : "#{f}.js").cleanpath.to_s
+ end.uniq
+ imports.add name, *(file_imports - INLINED_SRCS - EXTERNAL_JS)
end
imports.tsort
end
@@ -53,11 +59,17 @@ class Updater
end
def add(from, *tos)
- (@imports[from] ||= []).push(*tos.sort)
+ imports = (@imports[from] ||= [])
+ imports.push(*tos)
+ imports.sort!
end
def tsort_each_child(node, &block)
- @imports[node].each(&block)
+ node_imports = @imports[node]
+ if node_imports.nil?
+ raise "No imports found for #{node.inspect}\nImports:\n#{@imports.inspect}"
+ end
+ node_imports.each(&block)
end
def tsort_each_node(&block)
diff --git a/tasks/updater/network.rb b/tasks/updater/network.rb
index 6502bb8..0d2394a 100644
--- a/tasks/updater/network.rb
+++ b/tasks/updater/network.rb
@@ -25,7 +25,13 @@ class Updater
log_http_get_files files, path_url, false
files.map do |name|
Thread.start {
- contents[name] = URI.open("#{path_url}/#{name}").read
+ begin
+ url = "#{path_url}/#{name}"
+ contents[name] = URI.open(url).read
+ rescue Exception => e
+ log "Error downloading #{url}: #{e}"
+ exit 1
+ end
WRITE_FILES_MUTEX.synchronize { write_cached_files path, name => contents[name] }
}
end.each(&:join)