pieces 0.3.7 → 0.3.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 40ae8859a3219222e45a76520b46ee3d2cb2be80
4
- data.tar.gz: 936d5f4895bdfeeac42bc26e6d39598571035de3
3
+ metadata.gz: 779a56877fe797937693d618c05ea9f5528be171
4
+ data.tar.gz: 6af7698feea41519da8cbe0311fdaf67d5c70096
5
5
  SHA512:
6
- metadata.gz: 49cfc280a32a40df762a3bcfff13d93f6108f36a15093d09683f607dd2758c798c247e71b7b400a6cb917aed8b0c06934ffc19411d4ceb30d7ead5eb4415eb33
7
- data.tar.gz: 13f123fa2a0f53bcbcfc20f7f74bf0bae5a080a880aef12d45ffa6332993bfda7c753e43870225e1a4b9cc27be835fc992fd9d7fdd15ffd6cb8957cbd0ce6bf2
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 – [read how to](#use-as-styleguide-for-rails)
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
@@ -10,6 +10,6 @@
10
10
  * defined in the other CSS/SCSS files in this directory. It is generally better to create a new
11
11
  * file per style scope.
12
12
  *
13
- *= require_tree .
13
+ *= require_tree ./components
14
14
  *= require_self
15
15
  */
@@ -0,0 +1,4 @@
1
+ .header {
2
+ font-size: 2em;
3
+ margin: 2em;
4
+ }
@@ -1,3 +1,3 @@
1
- <header>
1
+ <header class="header">
2
2
  <%= title %>
3
3
  </header>
@@ -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/views/*/*.{css,scss,sass,less}"].each do |file|
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
@@ -8,7 +8,7 @@ module Pieces
8
8
  end
9
9
 
10
10
  def listen
11
- Listen.to("#{path}/config/", "#{path}/app/views/") do
11
+ Listen.to("#{path}/config/", "#{path}/app/") do
12
12
  print "Rebuilding #{path}... "
13
13
  build_pieces
14
14
  puts 'done.'
@@ -1,3 +1,3 @@
1
1
  module Pieces
2
- VERSION = '0.3.7'
2
+ VERSION = '0.3.8'
3
3
  end
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.7
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-08 00:00:00.000000000 Z
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