pieces 0.3.7 → 0.3.8
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 +4 -4
- data/README.md +20 -5
- data/examples/rails_app/app/assets/stylesheets/application.css +1 -1
- data/examples/rails_app/app/assets/stylesheets/components/header.css +4 -0
- data/examples/rails_app/app/views/application/header.html.erb +1 -1
- data/lib/pieces/compilers/style_compiler.rb +5 -1
- data/lib/pieces/listener.rb +1 -1
- data/lib/pieces/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 779a56877fe797937693d618c05ea9f5528be171
|
4
|
+
data.tar.gz: 6af7698feea41519da8cbe0311fdaf67d5c70096
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9add60074936b9675f114efa17c68dfea9f7de8e8ca3500f743deb9d6e201c989ec4b04a2af71bdfc488431e7d22d8117b3269e397f1dab39cf262e1809377cf
|
7
|
+
data.tar.gz: 8cfd9ea75a80b2270edbcc47614dd7e9ba7c2c3d653a7a181d666d1aa6deb98f4470244bb08b5064a30ac90a3acc6489735e731e14ec6bcb715f1322b366aea2
|
data/README.md
CHANGED
@@ -8,11 +8,9 @@
|
|
8
8
|
This gem will take your HTML and CSS components and compile them into a static
|
9
9
|
site.
|
10
10
|
|
11
|
-
- Build static sites and blogs
|
12
|
-
- Produce styleguides for your rails applications
|
13
|
-
- Mock up designs
|
14
|
-
|
15
|
-
## Define your HTML and CSS together
|
11
|
+
- <h5>Build static sites and blogs</h5>
|
12
|
+
- <h5>Produce styleguides for your rails applications</h5>
|
13
|
+
- <h5>Mock up designs</h5>
|
16
14
|
|
17
15
|
With pieces, you define the view of your application with components. Even
|
18
16
|
your layout is just another component.
|
@@ -45,6 +43,23 @@ the rails world.
|
|
45
43
|
</article>
|
46
44
|
```
|
47
45
|
|
46
|
+
You should have a one to one relationship between components, and stylesheets.
|
47
|
+
For example, `.article` should be defined like so.
|
48
|
+
|
49
|
+
**`app/assets/stylesheets/components/article.css`:**
|
50
|
+
|
51
|
+
```css
|
52
|
+
.article {
|
53
|
+
padding: 1em;
|
54
|
+
}
|
55
|
+
|
56
|
+
.article__content {
|
57
|
+
padding-top: 1em;
|
58
|
+
}
|
59
|
+
```
|
60
|
+
|
61
|
+
You can use `.css`, `.scss`, `.sass` and `.less` with pieces.
|
62
|
+
|
48
63
|
**`app/views/layouts/application.html.erb`:**
|
49
64
|
|
50
65
|
``` erb
|
@@ -8,7 +8,11 @@ module Pieces
|
|
8
8
|
|
9
9
|
def compile(files)
|
10
10
|
files.merge('compiled.css' => { contents: '', type: 'css' }).tap do |files|
|
11
|
-
Dir["#{path}/app/
|
11
|
+
Dir["#{path}/app/assets/stylesheets/components/**/*.{css,scss,sass,less}"].each do |file|
|
12
|
+
files['compiled.css'][:contents] << ::Tilt.new(file).render
|
13
|
+
end
|
14
|
+
|
15
|
+
Dir["#{path}/app/views/**/*.{css,scss,sass,less}"].each do |file|
|
12
16
|
files['compiled.css'][:contents] << ::Tilt.new(file).render
|
13
17
|
end
|
14
18
|
end
|
data/lib/pieces/listener.rb
CHANGED
data/lib/pieces/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pieces
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Luke Morton
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-08-
|
11
|
+
date: 2015-08-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tilt
|
@@ -186,6 +186,7 @@ files:
|
|
186
186
|
- examples/rails_app/app/assets/images/.keep
|
187
187
|
- examples/rails_app/app/assets/javascripts/application.js
|
188
188
|
- examples/rails_app/app/assets/stylesheets/application.css
|
189
|
+
- examples/rails_app/app/assets/stylesheets/components/header.css
|
189
190
|
- examples/rails_app/app/controllers/application_controller.rb
|
190
191
|
- examples/rails_app/app/controllers/concerns/.keep
|
191
192
|
- examples/rails_app/app/helpers/application_helper.rb
|