smallvictories 0.0.11 → 0.0.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +21 -4
- data/bin/sv +2 -1
- data/lib/smallvictories/builder.rb +6 -0
- data/lib/smallvictories/compiler.rb +29 -4
- data/lib/smallvictories/configuration.rb +29 -1
- data/lib/smallvictories/constants.rb +4 -1
- data/lib/smallvictories/version.rb +1 -1
- data/lib/smallvictories/watcher.rb +2 -0
- data/smallvictories.gemspec +3 -0
- data/spec/builder_spec.rb +5 -8
- data/spec/compiler_spec.rb +49 -0
- data/spec/configuration_spec.rb +57 -0
- data/spec/fixtures/source/_sprite/.gitkeep +0 -0
- data/spec/fixtures/source/_sprite/blank.png +0 -0
- data/spec/fixtures/source/_sv_config.yml +7 -0
- data/spec/spec_helper.rb +1 -1
- data/src/empty.png +0 -0
- metadata +49 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: baffd43b61e6a6923fa56e1568e1b3ea72319e19
|
4
|
+
data.tar.gz: ef3e506539b5b8cf9848c8864eabf25be7f103c2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 28958983d8d64b723e5bf9ce83be1dda431d3a176340b0ba33b6edb2f63400d75a9621542fa0f017930616cac696528763ec1681bfa0bf388bf7bf6c2615bc14
|
7
|
+
data.tar.gz: f1bddf6864e5e452eab5a24ae0603e6b2ea1f8a9a6ed9d6b29633d5e53fd6e62f8b8335001ce9fb65fb0dc23c7cf2f1e7c1a3f0041f5dcb6f9da237bb85c3588
|
data/README.md
CHANGED
@@ -19,7 +19,11 @@ includes folder.
|
|
19
19
|
|
20
20
|
You don't have to use a layout file if you don't want to, the files will still
|
21
21
|
be copied to the destination folder.
|
22
|
-
|
22
|
+
|
23
|
+
[Sprite Factory](https://github.com/jakesgordon/sprite-factory) looks for image
|
24
|
+
files in the sprite folder and generates a single sprite png and sprite
|
25
|
+
stylesheet.
|
26
|
+
|
23
27
|
[Guard LiveReload](https://github.com/guard/guard-livereload) is used to notify
|
24
28
|
the browser to automatically reload. It needs to be used with
|
25
29
|
the [LiveReload Safari/Chrome/Firefox extension](http://livereload.com/extensions#installing-sections).
|
@@ -30,6 +34,14 @@ the [LiveReload Safari/Chrome/Firefox extension](http://livereload.com/extension
|
|
30
34
|
gem install smallvictories
|
31
35
|
```
|
32
36
|
|
37
|
+
To use the [Sprite Factory](https://github.com/jakesgordon/sprite-factory) to
|
38
|
+
generate Sprite CSS you will need to install image magick which you can do with
|
39
|
+
homebrew:
|
40
|
+
|
41
|
+
```
|
42
|
+
brew install imagemagick
|
43
|
+
```
|
44
|
+
|
33
45
|
## Commands
|
34
46
|
|
35
47
|
### Bootstrap
|
@@ -50,7 +62,7 @@ Command: `sv bootstrap my-folder`
|
|
50
62
|
|
51
63
|
Compile files.
|
52
64
|
|
53
|
-
Renders Sass/CSS, JavaScript/CoffeeScript, HTML/Liquid in the destination
|
65
|
+
Renders Sass/CSS, JavaScript/CoffeeScript, HTML/Liquid and Sprite in the destination
|
54
66
|
folder.
|
55
67
|
|
56
68
|
Command: `sv compile`
|
@@ -79,13 +91,16 @@ Dropbox
|
|
79
91
|
└── _src
|
80
92
|
│ ├── _includes
|
81
93
|
│ │ └── _head.liquid
|
94
|
+
│ ├── _sprite
|
82
95
|
│ ├── _layout.liquid
|
83
|
-
│ ├──
|
96
|
+
│ ├── applscation.css
|
84
97
|
│ ├── application.js
|
85
|
-
│
|
98
|
+
│ ├── index.liquid
|
99
|
+
│ └── sprite.css
|
86
100
|
│
|
87
101
|
├── _sv_custom.css
|
88
102
|
├── _sv_custom.js
|
103
|
+
├── _sv_sprite.png
|
89
104
|
└── index.html
|
90
105
|
```
|
91
106
|
|
@@ -137,6 +152,7 @@ You can set the following options:
|
|
137
152
|
+ `javascript`: Main javascript file (JS or CoffeeScript) to be compiled into destination.
|
138
153
|
+ `layout`: Liquid layout file to render all other html and liquid files through.
|
139
154
|
+ `includes`: Directory where liquid rendered should expect to find snippets.
|
155
|
+
+ `compile_html`: Should Small Victories compile HTML? Default is true.
|
140
156
|
|
141
157
|
### Default Configuration
|
142
158
|
|
@@ -149,6 +165,7 @@ destination_stylesheet: '_sv_custom.css'
|
|
149
165
|
destination_javascript: '_sv_custom.js'
|
150
166
|
layout: '_layout.liquid'
|
151
167
|
includes: '_includes'
|
168
|
+
compile_html: true
|
152
169
|
```
|
153
170
|
|
154
171
|
## Building Locally
|
data/bin/sv
CHANGED
@@ -16,7 +16,7 @@ def help
|
|
16
16
|
|
17
17
|
Options:
|
18
18
|
-h, --help Prints this help document
|
19
|
-
-v, --version Prints the
|
19
|
+
-v, --version Prints the small victories gem version
|
20
20
|
|
21
21
|
See https://github.com/xxix/smallvictories-gem for additional documentation.
|
22
22
|
)
|
@@ -32,6 +32,7 @@ end
|
|
32
32
|
def compile
|
33
33
|
config = SmallVictories::Configuration.new
|
34
34
|
compiler = SmallVictories::Compiler.new(config: config)
|
35
|
+
compiler.compile_sprite
|
35
36
|
compiler.compile_css
|
36
37
|
compiler.compile_js
|
37
38
|
compiler.compile_html
|
@@ -18,6 +18,7 @@ module SmallVictories
|
|
18
18
|
setup_stylesheet
|
19
19
|
setup_javascript
|
20
20
|
setup_html
|
21
|
+
setup_sprite
|
21
22
|
end
|
22
23
|
|
23
24
|
def folder_path
|
@@ -81,5 +82,10 @@ module SmallVictories
|
|
81
82
|
create_src_file('layout.liquid', File.join(folder_source_path, config.layout))
|
82
83
|
create_src_file('index.liquid', File.join(folder_source_path, 'index.liquid'))
|
83
84
|
end
|
85
|
+
|
86
|
+
def setup_sprite
|
87
|
+
setup_directory File.join(folder_source_path, config.source_sprite)
|
88
|
+
create_src_file('empty.png', File.join(folder_source_path, config.source_sprite, 'empty.png'))
|
89
|
+
end
|
84
90
|
end
|
85
91
|
end
|
@@ -2,6 +2,8 @@ require 'sprockets'
|
|
2
2
|
require 'autoprefixer-rails'
|
3
3
|
require 'liquid'
|
4
4
|
require 'premailer'
|
5
|
+
require 'sprite_factory'
|
6
|
+
require 'rails-sass-images'
|
5
7
|
|
6
8
|
module SmallVictories
|
7
9
|
class Compiler
|
@@ -12,15 +14,19 @@ module SmallVictories
|
|
12
14
|
end
|
13
15
|
|
14
16
|
def compile_css
|
15
|
-
package [config.stylesheets]
|
17
|
+
package [config.stylesheets] if config.compile_css
|
16
18
|
end
|
17
19
|
|
18
20
|
def compile_js
|
19
|
-
package [config.javascripts]
|
21
|
+
package [config.javascripts] if config.compile_js
|
20
22
|
end
|
21
23
|
|
22
24
|
def compile_html
|
23
|
-
liquid
|
25
|
+
liquid if config.compile_html
|
26
|
+
end
|
27
|
+
|
28
|
+
def compile_sprite
|
29
|
+
sprite if config.compile_sprite
|
24
30
|
end
|
25
31
|
|
26
32
|
def inline_html
|
@@ -47,7 +53,7 @@ module SmallVictories
|
|
47
53
|
folder_path = pathname.dirname.to_s.gsub(config.full_source_path, '')
|
48
54
|
full_output_path = File.join(config.full_destination_path, folder_path)
|
49
55
|
|
50
|
-
next if file_name =~ /^_/ # do not render partials
|
56
|
+
next if file_name =~ /^_/ # do not render partials or layout
|
51
57
|
|
52
58
|
file = File.open(path).read
|
53
59
|
liquid = Liquid::Template.parse(file)
|
@@ -80,6 +86,7 @@ module SmallVictories
|
|
80
86
|
environment.js_compressor = options[:js_compressor] || :uglify
|
81
87
|
environment.css_compressor = options[:css_compressor] || :sass
|
82
88
|
end
|
89
|
+
RailsSassImages.install(sprockets)
|
83
90
|
|
84
91
|
sprockets.append_path('.')
|
85
92
|
bundles.each do |bundle|
|
@@ -147,5 +154,23 @@ module SmallVictories
|
|
147
154
|
end
|
148
155
|
end
|
149
156
|
end
|
157
|
+
|
158
|
+
def sprite
|
159
|
+
css = "@import 'rails-sass-images';\n"
|
160
|
+
css += SpriteFactory.run!(File.join(config.full_source_path, config.source_sprite),
|
161
|
+
output_image: File.join(config.full_source_path, config.destination_sprite_file),
|
162
|
+
style: :scss,
|
163
|
+
margin: 20,
|
164
|
+
layout: :vertical,
|
165
|
+
nocss: true,
|
166
|
+
sanitizer: true) do |images|
|
167
|
+
images.map do |image_name, image_data|
|
168
|
+
".sprite-#{image_name} { background-image: url('#{config.destination_sprite_file}'); background-size: (image-width('#{File.join(config.destination_sprite_file)}')/2) auto; background-repeat: no-repeat; background-position: (#{image_data[:cssx]}px/-2) (#{image_data[:cssy]}px/-2); height: (#{image_data[:cssh]}px/2) + 1px; width: (#{image_data[:cssw]}px/2) + 1px;}"
|
169
|
+
end.join("\n")
|
170
|
+
end
|
171
|
+
FileUtils.cp(File.join(config.full_source_path, config.destination_sprite_file), File.join(config.full_destination_path, config.destination_sprite_file))
|
172
|
+
File.open(File.join(config.full_source_path, config.destination_sprite_style), 'w') { |file| file.write(css) }
|
173
|
+
SmallVictories.logger.info "compiled #{File.join(config.destination, config.destination_sprite_style)}"
|
174
|
+
end
|
150
175
|
end
|
151
176
|
end
|
@@ -13,7 +13,7 @@ module SmallVictories
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def config_file key
|
16
|
-
config[key.to_s].chomp("/").reverse.chomp("/").reverse if config.has_key?(key.to_s)
|
16
|
+
config[key.to_s].to_s.chomp("/").reverse.chomp("/").reverse if config.has_key?(key.to_s)
|
17
17
|
end
|
18
18
|
|
19
19
|
def source
|
@@ -56,6 +56,18 @@ module SmallVictories
|
|
56
56
|
[source_stylesheet, destination_stylesheet]
|
57
57
|
end
|
58
58
|
|
59
|
+
def source_sprite
|
60
|
+
config_file(:source_sprite) || DEFAULT_SOURCE_SPRITE
|
61
|
+
end
|
62
|
+
|
63
|
+
def destination_sprite_file
|
64
|
+
config_file(:destination_sprite_file) || DEFAULT_DESTINATION_SPRITE_FILE
|
65
|
+
end
|
66
|
+
|
67
|
+
def destination_sprite_style
|
68
|
+
config_file(:destination_sprite_style) || DEFAULT_DESTINATION_SPRITE_STYLE
|
69
|
+
end
|
70
|
+
|
59
71
|
def layout
|
60
72
|
config_file(:layout) || DEFAULT_LAYOUT
|
61
73
|
end
|
@@ -71,5 +83,21 @@ module SmallVictories
|
|
71
83
|
def full_includes_path
|
72
84
|
File.join(full_source_path, includes)
|
73
85
|
end
|
86
|
+
|
87
|
+
def compile_css
|
88
|
+
eval config_file(:compile_css) || 'true'
|
89
|
+
end
|
90
|
+
|
91
|
+
def compile_html
|
92
|
+
eval config_file(:compile_html) || 'true'
|
93
|
+
end
|
94
|
+
|
95
|
+
def compile_js
|
96
|
+
eval config_file(:compile_js) || 'true'
|
97
|
+
end
|
98
|
+
|
99
|
+
def compile_sprite
|
100
|
+
eval config_file(:compile_sprite) || 'true'
|
101
|
+
end
|
74
102
|
end
|
75
103
|
end
|
@@ -1,11 +1,14 @@
|
|
1
1
|
module SmallVictories
|
2
2
|
CONFIG_FILE = '_sv_config.yml'
|
3
|
-
DEFAULT_SOURCE = '
|
3
|
+
DEFAULT_SOURCE = '_sv'
|
4
4
|
DEFAULT_DESTINATION = ''
|
5
5
|
DEFAULT_SOURCE_STYLESHEET = 'application.css'
|
6
6
|
DEFAULT_SOURCE_JAVASCRIPT = 'application.js'
|
7
|
+
DEFAULT_SOURCE_SPRITE = '_sprite'
|
7
8
|
DEFAULT_DESTINATION_STYLESHEET = '_sv_custom.css'
|
8
9
|
DEFAULT_DESTINATION_JAVASCRIPT = '_sv_custom.js'
|
10
|
+
DEFAULT_DESTINATION_SPRITE_FILE = '_sv_sprite.png'
|
11
|
+
DEFAULT_DESTINATION_SPRITE_STYLE = 'sprite.scss'
|
9
12
|
DEFAULT_LAYOUT = '_layout.liquid'
|
10
13
|
DEFAULT_INCLUDES = '_includes'
|
11
14
|
ROOT = Dir.pwd
|
@@ -28,6 +28,8 @@ module SmallVictories
|
|
28
28
|
compiler.compile_js
|
29
29
|
when '.liquid', '.html'
|
30
30
|
compiler.compile_html
|
31
|
+
when '.png', '.jpg', '.jpeg', '.gif'
|
32
|
+
compiler.compile_sprite unless paths.find { |path| path == File.join(compiler.config.full_source_path, compiler.config.destination_sprite_file) }
|
31
33
|
else
|
32
34
|
end
|
33
35
|
end
|
data/smallvictories.gemspec
CHANGED
@@ -31,6 +31,9 @@ Gem::Specification.new do |spec|
|
|
31
31
|
spec.add_runtime_dependency 'closure-compiler', '~> 1.1'
|
32
32
|
spec.add_runtime_dependency 'premailer', '~> 1.8'
|
33
33
|
spec.add_runtime_dependency 'nokogiri', '~> 1.4'
|
34
|
+
spec.add_runtime_dependency 'sprite-factory', '~> 1.7'
|
35
|
+
spec.add_runtime_dependency 'rmagick', '~> 2.15'
|
36
|
+
spec.add_runtime_dependency 'rails-sass-images', '~> 1.0'
|
34
37
|
|
35
38
|
spec.add_development_dependency "bundler", "~> 1.7"
|
36
39
|
spec.add_development_dependency "rake", "~> 10.0"
|
data/spec/builder_spec.rb
CHANGED
@@ -2,21 +2,18 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe SmallVictories do
|
4
4
|
let(:builder) { SmallVictories::Builder.new(config: SmallVictories::Configuration.new) }
|
5
|
+
let(:files) { %w(fixtures/new/_sv_config.yml fixtures/new/.sv_guardfile fixtures/new/_src/index.liquid fixtures/new/_src/application.css fixtures/new/_src/application.js fixtures/new/_src/_includes/_head.liquid fixtures/new/_src/_layout.liquid fixtures/new/_src/_sprite/empty.png) }
|
5
6
|
|
6
7
|
context 'with folder' do
|
7
8
|
it 'sets up default files' do
|
8
9
|
builder.setup 'spec/fixtures/new'
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
expect(File.exists?('fixtures/new/_src/index.liquid')).to eq true
|
13
|
-
expect(File.exists?('fixtures/new/_src/_includes/_head.liquid')).to eq true
|
14
|
-
expect(File.exists?('fixtures/new/_src/application.js')).to eq true
|
15
|
-
expect(File.exists?('fixtures/new/_src/application.css')).to eq true
|
10
|
+
files.each do |file|
|
11
|
+
expect(File.exists?(file)).to eq true
|
12
|
+
end
|
16
13
|
end
|
17
14
|
|
18
15
|
after do
|
19
|
-
|
16
|
+
files.each { |path| clean_file(path) }
|
20
17
|
end
|
21
18
|
end
|
22
19
|
end
|
data/spec/compiler_spec.rb
CHANGED
@@ -4,6 +4,9 @@ describe SmallVictories do
|
|
4
4
|
let(:destination_css) { './fixtures/destination/_sv_custom.css' }
|
5
5
|
let(:destination_js) { './fixtures/destination/_sv_custom.js' }
|
6
6
|
let(:destination_html) { './fixtures/destination/index.html' }
|
7
|
+
let(:destination_sprite_file) { './fixtures/destination/_sv_sprite.png' }
|
8
|
+
let(:source_sprite_file) { './fixtures/source/_sv_sprite.png' }
|
9
|
+
let(:destination_sprite_style) { './fixtures/source/sprite.scss' }
|
7
10
|
let(:compiler) { SmallVictories::Compiler.new(config: SmallVictories::Configuration.new) }
|
8
11
|
|
9
12
|
before do
|
@@ -43,6 +46,17 @@ describe SmallVictories do
|
|
43
46
|
compiler.compile_css
|
44
47
|
expect(File.open(destination_css).read).to include '.bootstrap{color:black;box-sizing:content-box}html{background:white}body div{background:red}p{font-size:30px}'
|
45
48
|
end
|
49
|
+
|
50
|
+
context 'with compile disabled' do
|
51
|
+
before do
|
52
|
+
allow_any_instance_of(SmallVictories::Configuration).to receive(:compile_css).and_return(false)
|
53
|
+
end
|
54
|
+
|
55
|
+
it 'does not compile the liquid files' do
|
56
|
+
compiler.compile_css
|
57
|
+
expect(File.exists?(destination_css)).to eq false
|
58
|
+
end
|
59
|
+
end
|
46
60
|
end
|
47
61
|
|
48
62
|
describe '#minify_css' do
|
@@ -57,6 +71,17 @@ describe SmallVictories do
|
|
57
71
|
compiler.compile_js
|
58
72
|
expect(File.open(destination_js).read).to include '(function(){alert("hi")}).call(this),console.log("hi");'
|
59
73
|
end
|
74
|
+
|
75
|
+
context 'with compile disabled' do
|
76
|
+
before do
|
77
|
+
allow_any_instance_of(SmallVictories::Configuration).to receive(:compile_js).and_return(false)
|
78
|
+
end
|
79
|
+
|
80
|
+
it 'does not compile the liquid files' do
|
81
|
+
compiler.compile_js
|
82
|
+
expect(File.exists?(destination_js)).to eq false
|
83
|
+
end
|
84
|
+
end
|
60
85
|
end
|
61
86
|
|
62
87
|
describe '#minify_js' do
|
@@ -72,6 +97,17 @@ describe SmallVictories do
|
|
72
97
|
expect(File.open(destination_html).read).to include "<html>\n<h1>Index</h1>\n<p>My snippet</p>\n\n\n</html>"
|
73
98
|
end
|
74
99
|
|
100
|
+
context 'with compile disabled' do
|
101
|
+
before do
|
102
|
+
allow_any_instance_of(SmallVictories::Configuration).to receive(:compile_html).and_return(false)
|
103
|
+
end
|
104
|
+
|
105
|
+
it 'does not compile the liquid files' do
|
106
|
+
compiler.compile_html
|
107
|
+
expect(File.exists?(destination_html)).to eq false
|
108
|
+
end
|
109
|
+
end
|
110
|
+
|
75
111
|
context 'with no layout' do
|
76
112
|
before do
|
77
113
|
allow_any_instance_of(SmallVictories::Configuration).to receive(:layout).and_return('no-file-here')
|
@@ -116,4 +152,17 @@ describe SmallVictories do
|
|
116
152
|
expect(File.open(destination_html).read).to include "<html>\n<h1>Index</h1>\nLiquid error: No such template 'snippet'\n\n</html>"
|
117
153
|
end
|
118
154
|
end
|
155
|
+
|
156
|
+
describe '#compile_sprite' do
|
157
|
+
it 'compiles the image files into a sprite' do
|
158
|
+
compiler.compile_sprite
|
159
|
+
expect(File.exists?(destination_sprite_file)).to eq true
|
160
|
+
expect(File.exists?(source_sprite_file)).to eq true
|
161
|
+
end
|
162
|
+
|
163
|
+
it 'compiles the css for the image sprite' do
|
164
|
+
compiler.compile_sprite
|
165
|
+
expect(File.exists?(destination_sprite_style)).to eq true
|
166
|
+
end
|
167
|
+
end
|
119
168
|
end
|
data/spec/configuration_spec.rb
CHANGED
@@ -28,6 +28,18 @@ describe SmallVictories do
|
|
28
28
|
expect(configuration.destination_javascript).to eq '_sv_custom.js'
|
29
29
|
end
|
30
30
|
|
31
|
+
it 'defaults source sprite folder' do
|
32
|
+
expect(configuration.source_sprite).to eq '_sprite'
|
33
|
+
end
|
34
|
+
|
35
|
+
it 'defaults destination sprite file' do
|
36
|
+
expect(configuration.destination_sprite_file).to eq '_sv_sprite.png'
|
37
|
+
end
|
38
|
+
|
39
|
+
it 'defaults destination sprite style' do
|
40
|
+
expect(configuration.destination_sprite_style).to eq 'sprite.scss'
|
41
|
+
end
|
42
|
+
|
31
43
|
it 'defaults layout file' do
|
32
44
|
expect(configuration.layout).to eq '_layout.liquid'
|
33
45
|
end
|
@@ -35,6 +47,22 @@ describe SmallVictories do
|
|
35
47
|
it 'defaults includes folder' do
|
36
48
|
expect(configuration.includes).to eq '_includes'
|
37
49
|
end
|
50
|
+
|
51
|
+
it 'defaults compile css' do
|
52
|
+
expect(configuration.compile_css).to eq true
|
53
|
+
end
|
54
|
+
|
55
|
+
it 'defaults compile js' do
|
56
|
+
expect(configuration.compile_js).to eq true
|
57
|
+
end
|
58
|
+
|
59
|
+
it 'defaults compile html' do
|
60
|
+
expect(configuration.compile_html).to eq true
|
61
|
+
end
|
62
|
+
|
63
|
+
it 'defaults compile sprite' do
|
64
|
+
expect(configuration.compile_sprite).to eq true
|
65
|
+
end
|
38
66
|
end
|
39
67
|
|
40
68
|
context 'with config file' do
|
@@ -58,6 +86,19 @@ describe SmallVictories do
|
|
58
86
|
expect(configuration.source_javascript).to eq 'my-javascript.js'
|
59
87
|
end
|
60
88
|
|
89
|
+
it 'reads source sprite folder' do
|
90
|
+
expect(configuration.source_sprite).to eq 'my-sprite'
|
91
|
+
end
|
92
|
+
|
93
|
+
it 'reads destination sprite file' do
|
94
|
+
expect(configuration.destination_sprite_file).to eq 'my-sprite.png'
|
95
|
+
end
|
96
|
+
|
97
|
+
it 'reads destination sprite style' do
|
98
|
+
expect(configuration.destination_sprite_style).to eq 'my-sprite.css'
|
99
|
+
end
|
100
|
+
|
101
|
+
|
61
102
|
it 'reads layout file' do
|
62
103
|
expect(configuration.layout).to eq '_my-template.liquid'
|
63
104
|
end
|
@@ -65,5 +106,21 @@ describe SmallVictories do
|
|
65
106
|
it 'reads includes folder' do
|
66
107
|
expect(configuration.includes).to eq 'snippets'
|
67
108
|
end
|
109
|
+
|
110
|
+
it 'reads compile css' do
|
111
|
+
expect(configuration.compile_css).to eq false
|
112
|
+
end
|
113
|
+
|
114
|
+
it 'reads compile js' do
|
115
|
+
expect(configuration.compile_js).to eq false
|
116
|
+
end
|
117
|
+
|
118
|
+
it 'reads compile html' do
|
119
|
+
expect(configuration.compile_html).to eq false
|
120
|
+
end
|
121
|
+
|
122
|
+
it 'reads compile sprite' do
|
123
|
+
expect(configuration.compile_sprite).to eq false
|
124
|
+
end
|
68
125
|
end
|
69
126
|
end
|
File without changes
|
Binary file
|
@@ -2,7 +2,14 @@ source: '/my-source-folder/'
|
|
2
2
|
destination: 'my-site-folder/'
|
3
3
|
source_stylesheet: 'my-stylesheet.css'
|
4
4
|
source_javascript: 'my-javascript.js'
|
5
|
+
source_sprite: 'my-sprite'
|
5
6
|
destination_stylesheet: 'stylesheet.css'
|
6
7
|
destination_javascript: 'javascript.js'
|
8
|
+
destination_sprite_file: 'my-sprite.png'
|
9
|
+
destination_sprite_style: 'my-sprite.css'
|
7
10
|
layout: '_my-template.liquid'
|
8
11
|
includes: 'snippets'
|
12
|
+
compile_html: false
|
13
|
+
compile_js: false
|
14
|
+
compile_css: false
|
15
|
+
compile_sprite: false
|
data/spec/spec_helper.rb
CHANGED
@@ -9,7 +9,7 @@ RSpec.configure do |config|
|
|
9
9
|
end
|
10
10
|
|
11
11
|
config.after do
|
12
|
-
%w(./fixtures/destination/_sv_custom.css ./fixtures/destination/_sv_custom.js ./fixtures/destination/index.html ./_sv_config.yml).each { |path| clean_file(path) }
|
12
|
+
%w(./fixtures/destination/_sv_custom.css ./fixtures/destination/_sv_custom.js ./fixtures/destination/index.html ./_sv_config.yml ./fixtures/source/_sv_sprite.png ./fixtures/destination/_sv_sprite.png ./fixtures/source/sprite.scss).each { |path| clean_file(path) }
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
data/src/empty.png
ADDED
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: smallvictories
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Dijkstra
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-02-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: autoprefixer-rails
|
@@ -192,6 +192,48 @@ dependencies:
|
|
192
192
|
- - "~>"
|
193
193
|
- !ruby/object:Gem::Version
|
194
194
|
version: '1.4'
|
195
|
+
- !ruby/object:Gem::Dependency
|
196
|
+
name: sprite-factory
|
197
|
+
requirement: !ruby/object:Gem::Requirement
|
198
|
+
requirements:
|
199
|
+
- - "~>"
|
200
|
+
- !ruby/object:Gem::Version
|
201
|
+
version: '1.7'
|
202
|
+
type: :runtime
|
203
|
+
prerelease: false
|
204
|
+
version_requirements: !ruby/object:Gem::Requirement
|
205
|
+
requirements:
|
206
|
+
- - "~>"
|
207
|
+
- !ruby/object:Gem::Version
|
208
|
+
version: '1.7'
|
209
|
+
- !ruby/object:Gem::Dependency
|
210
|
+
name: rmagick
|
211
|
+
requirement: !ruby/object:Gem::Requirement
|
212
|
+
requirements:
|
213
|
+
- - "~>"
|
214
|
+
- !ruby/object:Gem::Version
|
215
|
+
version: '2.15'
|
216
|
+
type: :runtime
|
217
|
+
prerelease: false
|
218
|
+
version_requirements: !ruby/object:Gem::Requirement
|
219
|
+
requirements:
|
220
|
+
- - "~>"
|
221
|
+
- !ruby/object:Gem::Version
|
222
|
+
version: '2.15'
|
223
|
+
- !ruby/object:Gem::Dependency
|
224
|
+
name: rails-sass-images
|
225
|
+
requirement: !ruby/object:Gem::Requirement
|
226
|
+
requirements:
|
227
|
+
- - "~>"
|
228
|
+
- !ruby/object:Gem::Version
|
229
|
+
version: '1.0'
|
230
|
+
type: :runtime
|
231
|
+
prerelease: false
|
232
|
+
version_requirements: !ruby/object:Gem::Requirement
|
233
|
+
requirements:
|
234
|
+
- - "~>"
|
235
|
+
- !ruby/object:Gem::Version
|
236
|
+
version: '1.0'
|
195
237
|
- !ruby/object:Gem::Dependency
|
196
238
|
name: bundler
|
197
239
|
requirement: !ruby/object:Gem::Requirement
|
@@ -277,6 +319,8 @@ files:
|
|
277
319
|
- spec/fixtures/source/_javascripts/scripts.coffee
|
278
320
|
- spec/fixtures/source/_javascripts/scripts.js
|
279
321
|
- spec/fixtures/source/_layout.liquid
|
322
|
+
- spec/fixtures/source/_sprite/.gitkeep
|
323
|
+
- spec/fixtures/source/_sprite/blank.png
|
280
324
|
- spec/fixtures/source/_stylesheets/bootstrap.scss
|
281
325
|
- spec/fixtures/source/_stylesheets/extra.scss
|
282
326
|
- spec/fixtures/source/_stylesheets/stylesheet.scss
|
@@ -287,6 +331,7 @@ files:
|
|
287
331
|
- spec/spec_helper.rb
|
288
332
|
- src/Guardfile
|
289
333
|
- src/config.yml
|
334
|
+
- src/empty.png
|
290
335
|
- src/head.liquid
|
291
336
|
- src/index.liquid
|
292
337
|
- src/javascript.js
|
@@ -333,6 +378,8 @@ test_files:
|
|
333
378
|
- spec/fixtures/source/_javascripts/scripts.coffee
|
334
379
|
- spec/fixtures/source/_javascripts/scripts.js
|
335
380
|
- spec/fixtures/source/_layout.liquid
|
381
|
+
- spec/fixtures/source/_sprite/.gitkeep
|
382
|
+
- spec/fixtures/source/_sprite/blank.png
|
336
383
|
- spec/fixtures/source/_stylesheets/bootstrap.scss
|
337
384
|
- spec/fixtures/source/_stylesheets/extra.scss
|
338
385
|
- spec/fixtures/source/_stylesheets/stylesheet.scss
|