smallvictories 0.0.12 → 0.0.13

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: baffd43b61e6a6923fa56e1568e1b3ea72319e19
4
- data.tar.gz: ef3e506539b5b8cf9848c8864eabf25be7f103c2
3
+ metadata.gz: 966e2ee0f8881035c9d3afa19586e41c66650fe5
4
+ data.tar.gz: 8152940979805c2ed96708a517cee27b8ed70fa4
5
5
  SHA512:
6
- metadata.gz: 28958983d8d64b723e5bf9ce83be1dda431d3a176340b0ba33b6edb2f63400d75a9621542fa0f017930616cac696528763ec1681bfa0bf388bf7bf6c2615bc14
7
- data.tar.gz: f1bddf6864e5e452eab5a24ae0603e6b2ea1f8a9a6ed9d6b29633d5e53fd6e62f8b8335001ce9fb65fb0dc23c7cf2f1e7c1a3f0041f5dcb6f9da237bb85c3588
6
+ metadata.gz: 15bf9c69e085db8a2ea9a6f9ed951d72305d6a0c31130c7e01310d74235a1f503ac17d0094d27e94fc0d3d32b00b2dda279b7928b6327072b06c1e91cbd3b712
7
+ data.tar.gz: c3cd754db14b09c714ca25739fa7b9db114e17ce6dd47ed4044e91aab57147357f81a7f181128214ddd6136876f3a3ead4d20716e2d13971a23438b0e45ebd41
data/README.md CHANGED
@@ -82,13 +82,13 @@ Command: `sv watch`
82
82
  ### Default Folder Structure
83
83
 
84
84
  The default setup for Small Victories is to have your production files in the
85
- root and your development files in the `_src` directory.
85
+ root and your development files in the `_sv` directory.
86
86
 
87
87
  ```text
88
88
  Dropbox
89
89
  └── Small Victories
90
90
  └── Your Site
91
- └── _src
91
+ └── _sv
92
92
  │ ├── _includes
93
93
  │ │ └── _head.liquid
94
94
  │ ├── _sprite
@@ -97,7 +97,6 @@ Dropbox
97
97
  │ ├── application.js
98
98
  │ ├── index.liquid
99
99
  │ └── sprite.css
100
-
101
100
  ├── _sv_custom.css
102
101
  ├── _sv_custom.js
103
102
  ├── _sv_sprite.png
@@ -105,7 +104,7 @@ Dropbox
105
104
  ```
106
105
 
107
106
  You would then run `sv watch` from within `Your Site` and Small Victories will
108
- watch for changes in `_src` and compile them to the `Your Site` folder.
107
+ watch for changes in `_sv` and compile them to the `Your Site` folder.
109
108
 
110
109
  ## How does it work with Small Victories?
111
110
 
@@ -135,7 +134,7 @@ And finally:
135
134
  With the default config, Small Victories will watch and compile your files into
136
135
  the root of your site folder.
137
136
 
138
- ## Why is there now web server?
137
+ ## Why is there no web server?
139
138
 
140
139
  There are other static site generators (like [Jekyll](http://jekyllrb.com/) or [Middleman](https://middlemanapp.com/)) that you can use to fire up a web server (and more!), Small Victories helps you build a static site for hosting on Small Victories, so if you don't need anything more than a static HTML file that can be dropped into your Small Victories folder.
141
140
 
@@ -146,18 +145,21 @@ run from.
146
145
 
147
146
  You can set the following options:
148
147
 
149
- + `source`: Relative path to find and watch files for compiling and compiling.
148
+ + `source`: Relative path to find and watch files for watching and compiling.
150
149
  + `destination`: Relative path for where to save final files.
151
150
  + `stylesheet`: Main stylesheet (Sass or CSS) to be compiled into destination.
152
151
  + `javascript`: Main javascript file (JS or CoffeeScript) to be compiled into destination.
153
152
  + `layout`: Liquid layout file to render all other html and liquid files through.
154
153
  + `includes`: Directory where liquid rendered should expect to find snippets.
154
+ + `compile_css`: Should Small Victories compile Sass/css? Default is true.
155
+ + `compile_js`: Should Small Victories compile CoffeeScript/JavaScript? Default is true.
155
156
  + `compile_html`: Should Small Victories compile HTML? Default is true.
157
+ + `compile_sprite`: Should Small Victories compile Sprite? Default is true.
156
158
 
157
159
  ### Default Configuration
158
160
 
159
161
  ```yaml
160
- source: '_src'
162
+ source: '_sv'
161
163
  destination: ''
162
164
  source_stylesheet: 'application.css'
163
165
  source_javascript: 'application.js'
@@ -167,6 +169,16 @@ layout: '_layout.liquid'
167
169
  includes: '_includes'
168
170
  compile_html: true
169
171
  ```
172
+ ## What if I want to use Liquid tags on Small Victories?
173
+
174
+ To keep liquid tags in your compiled html file for parsing on Small
175
+ Victories you should wrap the tag in a {% raw %} tag.
176
+
177
+ ```liquid
178
+ {% raw %}
179
+ {{ my tag }}
180
+ {% endraw %}
181
+ ```
170
182
 
171
183
  ## Building Locally
172
184
 
@@ -156,8 +156,10 @@ module SmallVictories
156
156
  end
157
157
 
158
158
  def sprite
159
+ sprite_directory = File.join(config.full_source_path, config.source_sprite)
160
+ return unless Dir.exists?(sprite_directory)
159
161
  css = "@import 'rails-sass-images';\n"
160
- css += SpriteFactory.run!(File.join(config.full_source_path, config.source_sprite),
162
+ css += SpriteFactory.run!(sprite_directory,
161
163
  output_image: File.join(config.full_source_path, config.destination_sprite_file),
162
164
  style: :scss,
163
165
  margin: 20,
@@ -1,3 +1,3 @@
1
1
  module SmallVictories
2
- VERSION = "0.0.12"
2
+ VERSION = "0.0.13"
3
3
  end
@@ -2,7 +2,7 @@ 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
+ let(:files) { %w(fixtures/new/_sv_config.yml fixtures/new/.sv_guardfile fixtures/new/_sv/index.liquid fixtures/new/_sv/application.css fixtures/new/_sv/application.js fixtures/new/_sv/_includes/_head.liquid fixtures/new/_sv/_layout.liquid fixtures/new/_sv/_sprite/empty.png) }
6
6
 
7
7
  context 'with folder' do
8
8
  it 'sets up default files' do
@@ -134,7 +134,7 @@ describe SmallVictories do
134
134
 
135
135
  context 'with invalid files' do
136
136
  before do
137
- allow_any_instance_of(SmallVictories::Configuration).to receive(:source).and_return('./spec/fixtures/invalid')
137
+ allow_any_instance_of(SmallVictories::Configuration).to receive(:source).and_return('./spec/fixtures/invalid')
138
138
  end
139
139
 
140
140
  it 'does not generate a css file' do
@@ -151,6 +151,11 @@ describe SmallVictories do
151
151
  compiler.compile_html
152
152
  expect(File.open(destination_html).read).to include "<html>\n<h1>Index</h1>\nLiquid error: No such template 'snippet'\n\n</html>"
153
153
  end
154
+
155
+ it 'ignores the sprite' do
156
+ compiler.compile_sprite
157
+ expect(File.exists?(destination_sprite_style)).to eq false
158
+ end
154
159
  end
155
160
 
156
161
  describe '#compile_sprite' do
@@ -5,7 +5,7 @@ describe SmallVictories do
5
5
 
6
6
  context 'with no config file' do
7
7
  it 'defaults to source directory' do
8
- expect(configuration.source).to eq '_src'
8
+ expect(configuration.source).to eq '_sv'
9
9
  end
10
10
 
11
11
  it 'defaults to destination directory' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smallvictories
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.12
4
+ version: 0.0.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Dijkstra