bootstrap-sass-backport 3.2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +19 -0
- data/.travis.yml +19 -0
- data/CHANGELOG.md +146 -0
- data/CONTRIBUTING.md +79 -0
- data/Gemfile +10 -0
- data/LICENSE +21 -0
- data/README.md +320 -0
- data/Rakefile +54 -0
- data/assets/fonts/bootstrap/glyphicons-halflings-regular.eot +0 -0
- data/assets/fonts/bootstrap/glyphicons-halflings-regular.svg +229 -0
- data/assets/fonts/bootstrap/glyphicons-halflings-regular.ttf +0 -0
- data/assets/fonts/bootstrap/glyphicons-halflings-regular.woff +0 -0
- data/assets/images/.keep +0 -0
- data/assets/javascripts/bootstrap-sprockets.js +12 -0
- data/assets/javascripts/bootstrap.js +2107 -0
- data/assets/javascripts/bootstrap/affix.js +142 -0
- data/assets/javascripts/bootstrap/alert.js +92 -0
- data/assets/javascripts/bootstrap/button.js +110 -0
- data/assets/javascripts/bootstrap/carousel.js +223 -0
- data/assets/javascripts/bootstrap/collapse.js +170 -0
- data/assets/javascripts/bootstrap/dropdown.js +151 -0
- data/assets/javascripts/bootstrap/modal.js +280 -0
- data/assets/javascripts/bootstrap/popover.js +113 -0
- data/assets/javascripts/bootstrap/scrollspy.js +170 -0
- data/assets/javascripts/bootstrap/tab.js +128 -0
- data/assets/javascripts/bootstrap/tooltip.js +457 -0
- data/assets/javascripts/bootstrap/transition.js +59 -0
- data/assets/stylesheets/_bootstrap-compass.scss +7 -0
- data/assets/stylesheets/_bootstrap-mincer.scss +17 -0
- data/assets/stylesheets/_bootstrap-sprockets.scss +7 -0
- data/assets/stylesheets/_bootstrap.scss +50 -0
- data/assets/stylesheets/bootstrap/_alerts.scss +68 -0
- data/assets/stylesheets/bootstrap/_badges.scss +57 -0
- data/assets/stylesheets/bootstrap/_breadcrumbs.scss +26 -0
- data/assets/stylesheets/bootstrap/_button-groups.scss +240 -0
- data/assets/stylesheets/bootstrap/_buttons.scss +157 -0
- data/assets/stylesheets/bootstrap/_carousel.scss +243 -0
- data/assets/stylesheets/bootstrap/_close.scss +35 -0
- data/assets/stylesheets/bootstrap/_code.scss +68 -0
- data/assets/stylesheets/bootstrap/_component-animations.scss +35 -0
- data/assets/stylesheets/bootstrap/_dropdowns.scss +215 -0
- data/assets/stylesheets/bootstrap/_forms.scss +538 -0
- data/assets/stylesheets/bootstrap/_glyphicons.scss +237 -0
- data/assets/stylesheets/bootstrap/_grid.scss +84 -0
- data/assets/stylesheets/bootstrap/_input-groups.scss +166 -0
- data/assets/stylesheets/bootstrap/_jumbotron.scss +48 -0
- data/assets/stylesheets/bootstrap/_labels.scss +66 -0
- data/assets/stylesheets/bootstrap/_list-group.scss +131 -0
- data/assets/stylesheets/bootstrap/_media.scss +56 -0
- data/assets/stylesheets/bootstrap/_mixins.scss +39 -0
- data/assets/stylesheets/bootstrap/_modals.scss +150 -0
- data/assets/stylesheets/bootstrap/_navbar.scss +659 -0
- data/assets/stylesheets/bootstrap/_navs.scss +242 -0
- data/assets/stylesheets/bootstrap/_normalize.scss +425 -0
- data/assets/stylesheets/bootstrap/_pager.scss +55 -0
- data/assets/stylesheets/bootstrap/_pagination.scss +88 -0
- data/assets/stylesheets/bootstrap/_panels.scss +243 -0
- data/assets/stylesheets/bootstrap/_popovers.scss +133 -0
- data/assets/stylesheets/bootstrap/_print.scss +101 -0
- data/assets/stylesheets/bootstrap/_progress-bars.scss +105 -0
- data/assets/stylesheets/bootstrap/_responsive-embed.scss +34 -0
- data/assets/stylesheets/bootstrap/_responsive-utilities.scss +174 -0
- data/assets/stylesheets/bootstrap/_scaffolding.scss +150 -0
- data/assets/stylesheets/bootstrap/_tables.scss +233 -0
- data/assets/stylesheets/bootstrap/_theme.scss +258 -0
- data/assets/stylesheets/bootstrap/_thumbnails.scss +38 -0
- data/assets/stylesheets/bootstrap/_tooltip.scss +95 -0
- data/assets/stylesheets/bootstrap/_type.scss +304 -0
- data/assets/stylesheets/bootstrap/_utilities.scss +57 -0
- data/assets/stylesheets/bootstrap/_variables.scss +854 -0
- data/assets/stylesheets/bootstrap/_wells.scss +29 -0
- data/assets/stylesheets/bootstrap/mixins/_alerts.scss +14 -0
- data/assets/stylesheets/bootstrap/mixins/_background-variant.scss +11 -0
- data/assets/stylesheets/bootstrap/mixins/_border-radius.scss +18 -0
- data/assets/stylesheets/bootstrap/mixins/_buttons.scss +50 -0
- data/assets/stylesheets/bootstrap/mixins/_center-block.scss +7 -0
- data/assets/stylesheets/bootstrap/mixins/_clearfix.scss +22 -0
- data/assets/stylesheets/bootstrap/mixins/_forms.scss +84 -0
- data/assets/stylesheets/bootstrap/mixins/_gradients.scss +58 -0
- data/assets/stylesheets/bootstrap/mixins/_grid-framework.scss +81 -0
- data/assets/stylesheets/bootstrap/mixins/_grid.scss +122 -0
- data/assets/stylesheets/bootstrap/mixins/_hide-text.scss +21 -0
- data/assets/stylesheets/bootstrap/mixins/_image.scss +34 -0
- data/assets/stylesheets/bootstrap/mixins/_labels.scss +12 -0
- data/assets/stylesheets/bootstrap/mixins/_list-group.scss +31 -0
- data/assets/stylesheets/bootstrap/mixins/_nav-divider.scss +10 -0
- data/assets/stylesheets/bootstrap/mixins/_nav-vertical-align.scss +9 -0
- data/assets/stylesheets/bootstrap/mixins/_opacity.scss +8 -0
- data/assets/stylesheets/bootstrap/mixins/_pagination.scss +23 -0
- data/assets/stylesheets/bootstrap/mixins/_panels.scss +24 -0
- data/assets/stylesheets/bootstrap/mixins/_progress-bar.scss +10 -0
- data/assets/stylesheets/bootstrap/mixins/_reset-filter.scss +8 -0
- data/assets/stylesheets/bootstrap/mixins/_resize.scss +6 -0
- data/assets/stylesheets/bootstrap/mixins/_responsive-visibility.scss +21 -0
- data/assets/stylesheets/bootstrap/mixins/_size.scss +10 -0
- data/assets/stylesheets/bootstrap/mixins/_tab-focus.scss +9 -0
- data/assets/stylesheets/bootstrap/mixins/_table-row.scss +28 -0
- data/assets/stylesheets/bootstrap/mixins/_text-emphasis.scss +11 -0
- data/assets/stylesheets/bootstrap/mixins/_text-overflow.scss +8 -0
- data/assets/stylesheets/bootstrap/mixins/_vendor-prefixes.scss +219 -0
- data/bootstrap-sass-backport.gemspec +36 -0
- data/bower.json +50 -0
- data/composer.json +35 -0
- data/lib/bootstrap-sass-backport.rb +71 -0
- data/lib/bootstrap-sass/engine.rb +12 -0
- data/lib/bootstrap-sass/version.rb +4 -0
- data/package.json +30 -0
- data/sache.json +5 -0
- data/tasks/bower.rake +34 -0
- data/tasks/converter.rb +80 -0
- data/tasks/converter/char_string_scanner.rb +38 -0
- data/tasks/converter/fonts_conversion.rb +16 -0
- data/tasks/converter/js_conversion.rb +45 -0
- data/tasks/converter/less_conversion.rb +670 -0
- data/tasks/converter/logger.rb +57 -0
- data/tasks/converter/network.rb +86 -0
- data/templates/project/_bootstrap-variables.sass.erb +4 -0
- data/templates/project/manifest.rb +26 -0
- data/templates/project/styles.sass +3 -0
- data/test/compass_test.rb +9 -0
- data/test/compilation_test.rb +18 -0
- data/test/dummy_node_mincer/apple-touch-icon-144-precomposed.png +0 -0
- data/test/dummy_node_mincer/application.css.ejs.scss +6 -0
- data/test/dummy_node_mincer/manifest.js +87 -0
- data/test/dummy_rails/README.rdoc +3 -0
- data/test/dummy_rails/Rakefile +6 -0
- data/test/dummy_rails/app/assets/images/.keep +0 -0
- data/test/dummy_rails/app/assets/javascripts/application.js +2 -0
- data/test/dummy_rails/app/assets/stylesheets/application.css.sass +2 -0
- data/test/dummy_rails/app/controllers/application_controller.rb +5 -0
- data/test/dummy_rails/app/controllers/pages_controller.rb +4 -0
- data/test/dummy_rails/app/helpers/application_helper.rb +2 -0
- data/test/dummy_rails/app/views/layouts/application.html.erb +14 -0
- data/test/dummy_rails/app/views/pages/root.html.slim +41 -0
- data/test/dummy_rails/bin/bundle +3 -0
- data/test/dummy_rails/bin/rails +4 -0
- data/test/dummy_rails/bin/rake +4 -0
- data/test/dummy_rails/config.ru +4 -0
- data/test/dummy_rails/config/application.rb +30 -0
- data/test/dummy_rails/config/boot.rb +5 -0
- data/test/dummy_rails/config/environment.rb +5 -0
- data/test/dummy_rails/config/environments/development.rb +26 -0
- data/test/dummy_rails/config/environments/production.rb +76 -0
- data/test/dummy_rails/config/environments/test.rb +30 -0
- data/test/dummy_rails/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy_rails/config/initializers/filter_parameter_logging.rb +4 -0
- data/test/dummy_rails/config/initializers/inflections.rb +16 -0
- data/test/dummy_rails/config/initializers/mime_types.rb +5 -0
- data/test/dummy_rails/config/initializers/secret_token.rb +18 -0
- data/test/dummy_rails/config/initializers/session_store.rb +3 -0
- data/test/dummy_rails/config/initializers/wrap_parameters.rb +14 -0
- data/test/dummy_rails/config/locales/en.yml +3 -0
- data/test/dummy_rails/config/locales/es.yml +3 -0
- data/test/dummy_rails/config/routes.rb +3 -0
- data/test/dummy_rails/db/test.sqlite3 +0 -0
- data/test/dummy_rails/lib/assets/.keep +0 -0
- data/test/dummy_rails/log/.keep +0 -0
- data/test/dummy_rails/public/404.html +58 -0
- data/test/dummy_rails/public/422.html +58 -0
- data/test/dummy_rails/public/500.html +57 -0
- data/test/dummy_rails/public/favicon.ico +0 -0
- data/test/dummy_sass_only/Gemfile +4 -0
- data/test/dummy_sass_only/compile.rb +13 -0
- data/test/dummy_sass_only/import_all.sass +2 -0
- data/test/gemfiles/sass_3_2.gemfile +6 -0
- data/test/gemfiles/sass_3_3.gemfile +6 -0
- data/test/gemfiles/sass_3_4.gemfile +7 -0
- data/test/gemfiles/sass_head.gemfile +6 -0
- data/test/node_mincer_test.rb +36 -0
- data/test/node_sass_test.rb +16 -0
- data/test/pages_test.rb +14 -0
- data/test/sass_test.rb +26 -0
- data/test/sprockets_rails_test.rb +27 -0
- data/test/support/dummy_rails_integration.rb +22 -0
- data/test/support/integration_test.rb +22 -0
- data/test/support/reporting.rb +17 -0
- data/test/test_helper.rb +35 -0
- data/test/test_helper_rails.rb +6 -0
- metadata +484 -0
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
class Converter
|
|
2
|
+
class Logger
|
|
3
|
+
include Term::ANSIColor
|
|
4
|
+
|
|
5
|
+
def log_status(status)
|
|
6
|
+
puts bold status
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def log_file_info(s)
|
|
10
|
+
puts " #{magenta s}"
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def log_transform(*args, from: caller[1][/`.*'/][1..-2].sub(/^block in /, ''))
|
|
14
|
+
puts " #{cyan from}#{cyan ": #{args * ', '}" unless args.empty?}"
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def log_processing(name)
|
|
18
|
+
puts yellow " #{File.basename(name)}"
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def log_processed(name)
|
|
22
|
+
puts green " #{name}"
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def log_http_get_file(url, cached = false)
|
|
26
|
+
s = " #{'CACHED ' if cached}GET #{url}..."
|
|
27
|
+
if cached
|
|
28
|
+
puts dark green s
|
|
29
|
+
else
|
|
30
|
+
puts dark cyan s
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def log_http_get_files(files, from, cached = false)
|
|
35
|
+
return if files.empty?
|
|
36
|
+
s = " #{'CACHED ' if cached}GET #{files.length} files from #{from} #{files * ' '}..."
|
|
37
|
+
if cached
|
|
38
|
+
puts dark green s
|
|
39
|
+
else
|
|
40
|
+
puts dark cyan s
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
def puts(*args)
|
|
45
|
+
STDERR.puts *args unless @silence
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
alias log puts
|
|
49
|
+
|
|
50
|
+
def silence_log
|
|
51
|
+
@silence = true
|
|
52
|
+
yield
|
|
53
|
+
ensure
|
|
54
|
+
@silence = false
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
class Converter
|
|
2
|
+
module Network
|
|
3
|
+
protected
|
|
4
|
+
|
|
5
|
+
def get_paths_by_type(dir, file_re, tree = get_tree(get_tree_sha(dir)))
|
|
6
|
+
tree['tree'].select { |f| f['type'] == 'blob' && f['path'] =~ file_re }.map { |f| f['path'] }
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def read_files(path, files)
|
|
10
|
+
full_path = "https://raw.githubusercontent.com/#@repo/#@branch_sha/#{path}"
|
|
11
|
+
contents = read_cached_files(path, files)
|
|
12
|
+
log_http_get_files contents.keys, full_path, true if contents.keys
|
|
13
|
+
files -= contents.keys
|
|
14
|
+
log_http_get_files files, full_path, false
|
|
15
|
+
files.map do |name|
|
|
16
|
+
Thread.start {
|
|
17
|
+
contents[name] = open("#{full_path}/#{name}").read
|
|
18
|
+
Thread.exclusive { write_cached_files path, name => contents[name] }
|
|
19
|
+
}
|
|
20
|
+
end.each(&:join)
|
|
21
|
+
contents
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def read_cached_files(path, files)
|
|
25
|
+
full_path = "#@cache_path/#@branch_sha/#{path}"
|
|
26
|
+
contents = {}
|
|
27
|
+
if File.directory?(full_path)
|
|
28
|
+
files.each do |name|
|
|
29
|
+
path = "#{full_path}/#{name}"
|
|
30
|
+
contents[name] = File.read(path, mode: 'rb') if File.exists?(path)
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
contents
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def write_cached_files(path, files)
|
|
37
|
+
full_path = "./#@cache_path/#@branch_sha/#{path}"
|
|
38
|
+
files.each do |name, content|
|
|
39
|
+
FileUtils.mkdir_p File.dirname(File.join(full_path, name))
|
|
40
|
+
File.open("#{full_path}/#{name}", 'wb') { |f| f.write content }
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def get_file(url)
|
|
46
|
+
cache_path = "./#@cache_path#{URI(url).path}"
|
|
47
|
+
FileUtils.mkdir_p File.dirname(cache_path)
|
|
48
|
+
if File.exists?(cache_path)
|
|
49
|
+
log_http_get_file url, true
|
|
50
|
+
File.read(cache_path, mode: 'rb')
|
|
51
|
+
else
|
|
52
|
+
log_http_get_file url, false
|
|
53
|
+
content = open(url).read
|
|
54
|
+
File.open(cache_path, 'wb') { |f| f.write content }
|
|
55
|
+
content
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# get sha of the branch (= the latest commit)
|
|
60
|
+
def get_branch_sha
|
|
61
|
+
return @branch if @branch =~ /\A[0-9a-f]+\z/
|
|
62
|
+
cmd = "git ls-remote 'https://github.com/#@repo' | awk '/#@branch/ {print $1}'"
|
|
63
|
+
log cmd
|
|
64
|
+
@branch_sha ||= %x[#{cmd}].chomp
|
|
65
|
+
raise 'Could not get branch sha!' unless $?.success?
|
|
66
|
+
@branch_sha
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# Get the sha of a dir
|
|
70
|
+
def get_tree_sha(dir, tree = get_trees)
|
|
71
|
+
tree['tree'].find { |t| t['path'] == dir }['sha']
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
def get_trees
|
|
75
|
+
@trees ||= get_tree(@branch_sha)
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
def get_tree(sha)
|
|
79
|
+
get_json("https://api.github.com/repos/#@repo/git/trees/#{sha}")
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
def get_json(url)
|
|
83
|
+
JSON.parse get_file(url)
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
description 'Bootstrap for Sass'
|
|
2
|
+
|
|
3
|
+
# Stylesheet importing bootstrap
|
|
4
|
+
stylesheet 'styles.sass'
|
|
5
|
+
|
|
6
|
+
manifest = Pathname.new(File.dirname(__FILE__))
|
|
7
|
+
assets = File.expand_path('../../assets', manifest)
|
|
8
|
+
|
|
9
|
+
# Provide variables files
|
|
10
|
+
bs_stylesheets = "#{assets}/stylesheets/bootstrap"
|
|
11
|
+
stylesheet '_bootstrap-variables.sass.erb',
|
|
12
|
+
:erb => true,
|
|
13
|
+
:to => '_bootstrap-variables.sass',
|
|
14
|
+
:bs_variables_path => File.expand_path("#{bs_stylesheets}/_variables.scss", manifest)
|
|
15
|
+
|
|
16
|
+
# Copy JS and fonts
|
|
17
|
+
{:javascript => 'javascripts',
|
|
18
|
+
:font => 'fonts'
|
|
19
|
+
}.each do |method, dir|
|
|
20
|
+
root = Pathname.new(assets).join(dir)
|
|
21
|
+
Dir.glob root.join('**', '*.*') do |path|
|
|
22
|
+
path = Pathname.new(path)
|
|
23
|
+
send method, path.relative_path_from(manifest).to_s,
|
|
24
|
+
:to => path.relative_path_from(root).to_s
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
require 'test_helper'
|
|
2
|
+
|
|
3
|
+
class CompassTest < Minitest::Test
|
|
4
|
+
def test_create_project
|
|
5
|
+
command = 'rm -rf tmp/new-compass-project; bundle exec compass create tmp/new-compass-project -r bootstrap-sass-backport --using bootstrap --trace --force'
|
|
6
|
+
success = silence_stdout_if(!ENV['VERBOSE']) { system(command) }
|
|
7
|
+
assert success, 'Compass project creation failed!'
|
|
8
|
+
end
|
|
9
|
+
end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
require 'test_helper'
|
|
2
|
+
require 'fileutils'
|
|
3
|
+
require 'sass'
|
|
4
|
+
|
|
5
|
+
class CompilationTest < Minitest::Test
|
|
6
|
+
def test_compilation
|
|
7
|
+
path = 'assets/stylesheets'
|
|
8
|
+
%w(_bootstrap bootstrap/_theme).each do |file|
|
|
9
|
+
FileUtils.rm_rf('.sass-cache', secure: true)
|
|
10
|
+
engine = Sass::Engine.for_file("#{path}/#{file}.scss", syntax: :scss, load_paths: [path])
|
|
11
|
+
FileUtils.mkdir_p("tmp/#{File.dirname(file)}")
|
|
12
|
+
File.open("tmp/#{file}.css", 'w') { |f|
|
|
13
|
+
f.write engine.render
|
|
14
|
+
}
|
|
15
|
+
assert true # nothing was raised
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
Binary file
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
// Build script from https://github.com/nodeca/mincer/tree/master/examples
|
|
5
|
+
|
|
6
|
+
//
|
|
7
|
+
// Require module
|
|
8
|
+
//
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
var Mincer = require('mincer');
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
//
|
|
15
|
+
// Get Mincer environment
|
|
16
|
+
//
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
//
|
|
20
|
+
// Configure Mincers logger, by default, all
|
|
21
|
+
// messages are going to the middle of nowhere
|
|
22
|
+
//
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
Mincer.logger.use(console);
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
//
|
|
29
|
+
// Create and export environment
|
|
30
|
+
//
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
var environment = new Mincer.Environment(process.cwd());
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
//
|
|
37
|
+
// Configure environment load paths (where to find ssets)
|
|
38
|
+
//
|
|
39
|
+
|
|
40
|
+
// Include bootstrap scss load path
|
|
41
|
+
var bootstrapPath = '../../';
|
|
42
|
+
environment.appendPath(bootstrapPath + 'assets/stylesheets');
|
|
43
|
+
|
|
44
|
+
// Include fonts load path
|
|
45
|
+
environment.appendPath(bootstrapPath + 'assets/fonts');
|
|
46
|
+
|
|
47
|
+
// Include dir with assets, root just for test
|
|
48
|
+
environment.appendPath('./');
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
//
|
|
52
|
+
// Define environment essential *_path helper that will be available in the
|
|
53
|
+
// processed assets. See `assets/stylesheets/app.css.ejs` for example.
|
|
54
|
+
//
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
environment.ContextClass.defineAssetPath(function (pathname, options) {
|
|
58
|
+
var asset = this.environment.findAsset(pathname, options);
|
|
59
|
+
|
|
60
|
+
if (!asset) {
|
|
61
|
+
throw new Error("File " + pathname + " not found");
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
return '/assets/' + asset.digestPath;
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
//
|
|
69
|
+
// Create and compile Manifest
|
|
70
|
+
//
|
|
71
|
+
|
|
72
|
+
var manifest_path = process.argv[2] || __dirname + '/assets';
|
|
73
|
+
|
|
74
|
+
var manifest = new Mincer.Manifest(environment, manifest_path);
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
manifest.compile(['application.css'], function (err, assetsData) {
|
|
78
|
+
if (err) {
|
|
79
|
+
console.error("Failed compile assets: " + (err.message || err.toString()));
|
|
80
|
+
process.exit(128);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
console.info('\n\nAssets were successfully compiled.\n' +
|
|
84
|
+
'Manifest data (a proper JSON) was written to:\n' +
|
|
85
|
+
manifest.path + '\n\n');
|
|
86
|
+
console.dir(assetsData);
|
|
87
|
+
});
|
|
File without changes
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<title>bootstrap-sass Dummy App</title>
|
|
5
|
+
<%= stylesheet_link_tag 'application', media: "all", 'data-turbolinks-track' => true %>
|
|
6
|
+
<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
|
|
7
|
+
<%= csrf_meta_tags %>
|
|
8
|
+
</head>
|
|
9
|
+
|
|
10
|
+
<body>
|
|
11
|
+
<%= yield %>
|
|
12
|
+
</body>
|
|
13
|
+
|
|
14
|
+
</html>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
.container
|
|
2
|
+
.panel.panel-primary
|
|
3
|
+
.panel-heading: h1 Dummy App
|
|
4
|
+
.panel-body: .row
|
|
5
|
+
.col-sm-3
|
|
6
|
+
h2 3 columns
|
|
7
|
+
ul.list-group
|
|
8
|
+
li.list-group-item: a href='#one' One
|
|
9
|
+
li.list-group-item: a href='#two' Two
|
|
10
|
+
li.list-group-item: a href='#three' Three
|
|
11
|
+
.col-sm-3
|
|
12
|
+
h2 3 columns
|
|
13
|
+
.btn-group
|
|
14
|
+
button.btn.btn-primary type='button' Button
|
|
15
|
+
button.btn.btn-primary type='button' Button
|
|
16
|
+
h2 Icons
|
|
17
|
+
ul.list-inline
|
|
18
|
+
li: i.glyphicon.glyphicon-user
|
|
19
|
+
li: i.glyphicon.glyphicon-bullhorn
|
|
20
|
+
li: i.glyphicon.glyphicon-tint
|
|
21
|
+
table.table
|
|
22
|
+
caption Table
|
|
23
|
+
tr
|
|
24
|
+
td.danger Danger!
|
|
25
|
+
td.success Success!
|
|
26
|
+
.col-sm-6
|
|
27
|
+
h2 6 columns
|
|
28
|
+
.panel.panel-primary: .panel-body
|
|
29
|
+
.row
|
|
30
|
+
.col-xs-4.col-xs-push-4
|
|
31
|
+
.panel.panel-default: h3 This is col-xs-4 col-xs-push-4
|
|
32
|
+
|
|
33
|
+
form.form-inline
|
|
34
|
+
.form-group
|
|
35
|
+
label.sr-only for="exampleInputEmail2" Email address
|
|
36
|
+
input.form-control#exampleInputEmail2 type="email" placeholder="Enter email"
|
|
37
|
+
.checkbox
|
|
38
|
+
label
|
|
39
|
+
input type="checkbox"
|
|
40
|
+
| Remember me
|
|
41
|
+
button.btn.btn-default type="submit" Sign in
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
require File.expand_path('../boot', __FILE__)
|
|
2
|
+
|
|
3
|
+
require 'rails'
|
|
4
|
+
|
|
5
|
+
%w(
|
|
6
|
+
action_controller
|
|
7
|
+
action_view
|
|
8
|
+
sprockets
|
|
9
|
+
).each do |framework|
|
|
10
|
+
require "#{framework}/railtie"
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
require 'slim-rails'
|
|
14
|
+
require 'jquery-rails'
|
|
15
|
+
require 'compass'
|
|
16
|
+
require 'bootstrap-sass-backport'
|
|
17
|
+
require 'uglifier'
|
|
18
|
+
|
|
19
|
+
module Dummy
|
|
20
|
+
class Application < Rails::Application
|
|
21
|
+
config.assets.enabled = true if config.assets.respond_to?(:enabled)
|
|
22
|
+
config.to_prepare do
|
|
23
|
+
if ENV['VERBOSE']
|
|
24
|
+
STDERR.puts "Loaded Rails #{Rails::VERSION::STRING}, Sprockets #{Sprockets::VERSION}",
|
|
25
|
+
"Asset paths: #{Rails.application.config.assets.paths}"
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
|