Skip to content

Commit

Permalink
Merge branch 'master' into 0.1.x
Browse files Browse the repository at this point in the history
  • Loading branch information
jodosha committed Jan 7, 2016
2 parents 9c53332 + 43b3b9a commit 97a16fb
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/lotus/assets/compressors/builtin_stylesheet.rb
Expand Up @@ -20,7 +20,7 @@ class BuiltinStylesheet < Stylesheet
LINE_BREAKS_REPLACEMENT = "}\n".freeze
LAST_BREAK_REPLACEMENT = "".freeze
INSIDE_LEFT_BRACKET_REPLACEMENT = " {".freeze
INSIDE_RIGHT_BRACKET_REPLACEMENT = " {".freeze
INSIDE_RIGHT_BRACKET_REPLACEMENT = "}".freeze

def compress(filename)
result = read(filename)
Expand Down
16 changes: 16 additions & 0 deletions test/compressors/builtin_stylesheet_test.rb
@@ -0,0 +1,16 @@
require 'test_helper'
require 'lotus/assets/compressors/builtin_stylesheet'

describe Lotus::Assets::Compressors::BuiltinStylesheet do
let(:compressor) { Lotus::Assets::Compressors::BuiltinStylesheet.new }

describe '#compress' do
it 'compresses given file' do
asset = __dir__ + '/../fixtures/reset.css'
expected = File.read(__dir__ + '/../fixtures/compressed-reset.css')
actual = compressor.compress(asset)

actual.must_equal(expected)
end
end
end
7 changes: 7 additions & 0 deletions test/fixtures/compressed-reset.css

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

2 changes: 1 addition & 1 deletion test/fixtures/deploy/assets-builtin.json
@@ -1 +1 @@
{"/assets/admin/jquery-ui.css":"/assets/admin/jquery-ui-e3109c9142279ee60cc50171f662858f.css","/assets/admin/jquery-ui.js":"/assets/admin/jquery-ui-ad41f3480c470e2b64c1b0357cfd78c5.js","/assets/admin/jquery-ui.structure.css":"/assets/admin/jquery-ui.structure-a3468f038c15cf741a15011576d1fef0.css","/assets/admin/jquery-ui.theme.css":"/assets/admin/jquery-ui.theme-b4ede477425ff79b75aeb1c710a7ff2f.css","/assets/admin/jquery.js":"/assets/admin/jquery-6f2e5c9e6a867fb492c33eb045e5c84a.js","/assets/admin/ui-bg_diagonals-thick_18_b81900_40x40.png":"/assets/admin/ui-bg_diagonals-thick_18_b81900_40x40-4d4e638960a1a29b0d6b693b445087da.png","/assets/admin/ui-bg_diagonals-thick_20_666666_40x40.png":"/assets/admin/ui-bg_diagonals-thick_20_666666_40x40-d0cc3ffc3dc84d3a7c48867c75e2485f.png","/assets/admin/ui-bg_flat_10_000000_40x100.png":"/assets/admin/ui-bg_flat_10_000000_40x100-c31d5fc3eb7d82c628a82e3b87024cd1.png","/assets/admin/ui-bg_glass_100_f6f6f6_1x400.png":"/assets/admin/ui-bg_glass_100_f6f6f6_1x400-c17f552e8f4697d7608c57653af36df0.png","/assets/admin/ui-bg_glass_100_fdf5ce_1x400.png":"/assets/admin/ui-bg_glass_100_fdf5ce_1x400-fe58c3539111d3021776e6833169c5e1.png","/assets/admin/ui-bg_glass_65_ffffff_1x400.png":"/assets/admin/ui-bg_glass_65_ffffff_1x400-b624f702075cd719a38f428e143025ea.png","/assets/admin/ui-bg_gloss-wave_35_f6a828_500x100.png":"/assets/admin/ui-bg_gloss-wave_35_f6a828_500x100-23932de7c235b03187b8a5de3d024490.png","/assets/admin/ui-bg_highlight-soft_100_eeeeee_1x100.png":"/assets/admin/ui-bg_highlight-soft_100_eeeeee_1x100-0b708185ce8927f18c7b3b82a7e7c247.png","/assets/admin/ui-bg_highlight-soft_75_ffe45c_1x100.png":"/assets/admin/ui-bg_highlight-soft_75_ffe45c_1x100-53acc69aaee6e2cb73b2021317e24af3.png","/assets/admin/ui-icons_222222_256x240.png":"/assets/admin/ui-icons_222222_256x240-4c27b34156b7a3776f31cc456ca01c10.png","/assets/admin/ui-icons_228ef1_256x240.png":"/assets/admin/ui-icons_228ef1_256x240-2f257489d9600ddf56d195a179ebc9df.png","/assets/admin/ui-icons_ef8c08_256x240.png":"/assets/admin/ui-icons_ef8c08_256x240-772a64d6df4b93d230e9b38e1ab7522a.png","/assets/admin/ui-icons_ffd27a_256x240.png":"/assets/admin/ui-icons_ffd27a_256x240-6686d21b904e18b100210169bb1c04ad.png","/assets/admin/ui-icons_ffffff_256x240.png":"/assets/admin/ui-icons_ffffff_256x240-a19fe1b2d726e920c12e43a65df9039a.png","/assets/bootstrap-theme.css":"/assets/bootstrap-theme-0a26e950c6586286a456de94bbb7e5a4.css","/assets/bootstrap.css":"/assets/bootstrap-481ec32a0d15c8cfa0d835ffb3f1f23c.css","/assets/bootstrap.js":"/assets/bootstrap-89d5416bc7c63b5eacc04086a12e7711.js"}
{"/assets/admin/jquery-ui.css":"/assets/admin/jquery-ui-449ca93abddb957382e0d157395dce8d.css","/assets/admin/jquery-ui.js":"/assets/admin/jquery-ui-ad41f3480c470e2b64c1b0357cfd78c5.js","/assets/admin/jquery-ui.structure.css":"/assets/admin/jquery-ui.structure-5a0c4be3549c8fe4b131282690b09b12.css","/assets/admin/jquery-ui.theme.css":"/assets/admin/jquery-ui.theme-9bf307200d9e4bc7efdb0ca1bb314368.css","/assets/admin/jquery.js":"/assets/admin/jquery-6f2e5c9e6a867fb492c33eb045e5c84a.js","/assets/admin/ui-bg_diagonals-thick_18_b81900_40x40.png":"/assets/admin/ui-bg_diagonals-thick_18_b81900_40x40-4d4e638960a1a29b0d6b693b445087da.png","/assets/admin/ui-bg_diagonals-thick_20_666666_40x40.png":"/assets/admin/ui-bg_diagonals-thick_20_666666_40x40-d0cc3ffc3dc84d3a7c48867c75e2485f.png","/assets/admin/ui-bg_flat_10_000000_40x100.png":"/assets/admin/ui-bg_flat_10_000000_40x100-c31d5fc3eb7d82c628a82e3b87024cd1.png","/assets/admin/ui-bg_glass_100_f6f6f6_1x400.png":"/assets/admin/ui-bg_glass_100_f6f6f6_1x400-c17f552e8f4697d7608c57653af36df0.png","/assets/admin/ui-bg_glass_100_fdf5ce_1x400.png":"/assets/admin/ui-bg_glass_100_fdf5ce_1x400-fe58c3539111d3021776e6833169c5e1.png","/assets/admin/ui-bg_glass_65_ffffff_1x400.png":"/assets/admin/ui-bg_glass_65_ffffff_1x400-b624f702075cd719a38f428e143025ea.png","/assets/admin/ui-bg_gloss-wave_35_f6a828_500x100.png":"/assets/admin/ui-bg_gloss-wave_35_f6a828_500x100-23932de7c235b03187b8a5de3d024490.png","/assets/admin/ui-bg_highlight-soft_100_eeeeee_1x100.png":"/assets/admin/ui-bg_highlight-soft_100_eeeeee_1x100-0b708185ce8927f18c7b3b82a7e7c247.png","/assets/admin/ui-bg_highlight-soft_75_ffe45c_1x100.png":"/assets/admin/ui-bg_highlight-soft_75_ffe45c_1x100-53acc69aaee6e2cb73b2021317e24af3.png","/assets/admin/ui-icons_222222_256x240.png":"/assets/admin/ui-icons_222222_256x240-4c27b34156b7a3776f31cc456ca01c10.png","/assets/admin/ui-icons_228ef1_256x240.png":"/assets/admin/ui-icons_228ef1_256x240-2f257489d9600ddf56d195a179ebc9df.png","/assets/admin/ui-icons_ef8c08_256x240.png":"/assets/admin/ui-icons_ef8c08_256x240-772a64d6df4b93d230e9b38e1ab7522a.png","/assets/admin/ui-icons_ffd27a_256x240.png":"/assets/admin/ui-icons_ffd27a_256x240-6686d21b904e18b100210169bb1c04ad.png","/assets/admin/ui-icons_ffffff_256x240.png":"/assets/admin/ui-icons_ffffff_256x240-a19fe1b2d726e920c12e43a65df9039a.png","/assets/bootstrap-theme.css":"/assets/bootstrap-theme-26504b58ee0ef4e1003b4d592805e861.css","/assets/bootstrap.css":"/assets/bootstrap-ee15a45d225bd56ff40767458d10a7c4.css","/assets/bootstrap.js":"/assets/bootstrap-89d5416bc7c63b5eacc04086a12e7711.js"}
49 changes: 49 additions & 0 deletions test/fixtures/reset.css
@@ -0,0 +1,49 @@
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}

0 comments on commit 97a16fb

Please sign in to comment.