guard_boilerplate 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,8 @@
1
+ # 0.2.0 (May 17, 2011)
2
+
3
+ * Update README
4
+ * Move {haml,sass} into assets/{view,stylesheets}
5
+
1
6
  # 0.1.1 (May 17, 2011)
2
7
 
3
8
  * Update Guardfile template for better haml response.
data/README.md CHANGED
@@ -8,11 +8,13 @@ Impatient? Have Ruby installed and understand what a gem is? Use the Boilerplate
8
8
 
9
9
  1. Install the [LiveReload](https://github.com/mockko/livereload#readme) extension in your browser
10
10
  2. Install guard_boilerplate and start a new project:
11
- gem install guard_boilerplate
12
- mkdir my_site && cd my_site
13
- curl -L 'https://github.com/paulirish/html5-boilerplate/tarball/master' | tar -xzf - --strip-components 1
14
- gbp hamlize && gbp sassify
15
- gbp start
11
+ gem install guard_boilerplate
12
+ if [ `uname -s` == "Darwin" ] ; then gem install rb-fsevent ; fi
13
+ if [ `uname -s` == "Linux" ] ; then gem install rb-inotify ; fi
14
+ mkdir my_site && cd my_site
15
+ curl -L 'https://github.com/paulirish/html5-boilerplate/tarball/master' | tar -xzf - --strip-components 1
16
+ gbp hamlize && gbp sassify
17
+ gbp start
16
18
  3. Hit the LiveReload **LR** button in your browser
17
19
  4. Edit!
18
20
 
@@ -50,6 +52,14 @@ Are you ready?
50
52
 
51
53
  gem install guard_boilerplate
52
54
 
55
+ On the Mac?
56
+
57
+ gem install rb-fsevent
58
+
59
+ On Linux?
60
+
61
+ gem install rb-inotify
62
+
53
63
  Now give yourself a slap on the back.
54
64
 
55
65
  # Use!
data/bin/gbp CHANGED
@@ -27,13 +27,13 @@ class GuardBoilerPlate < Thor
27
27
 
28
28
  desc "sassify", "Migrates CSS files to SCSS files"
29
29
  def sassify
30
- if File.directory? "sass"
30
+ if File.directory? "assets/stylesheets"
31
31
  say "\nA sass/ directory already exists, so skipping\n", :red
32
32
  else
33
33
  say "Copying CSS files to SCSS...", :green
34
- FileUtils.mkdir_p "sass", :verbose => true
34
+ FileUtils.mkdir_p "assets/stylesheets", :verbose => true
35
35
  Dir["css/**/*.css"].each do |css_file|
36
- scss_file = css_file.sub(/^css/, 'sass').sub(/\.css$/, '.scss')
36
+ scss_file = css_file.sub(/^css/, 'assets/stylesheets').sub(/\.css$/, '.scss')
37
37
  FileUtils.mkdir_p(File.dirname(scss_file))
38
38
  FileUtils.cp css_file, scss_file, :verbose => true
39
39
  say "Generated #{scss_file} from #{css_file} (straight copy)", :green
@@ -43,26 +43,26 @@ class GuardBoilerPlate < Thor
43
43
 
44
44
  desc "hamlize", "Migrates your HTML files to Haml files"
45
45
  def hamlize
46
- if File.directory? "haml"
46
+ if File.directory? "assets/views"
47
47
  say "\nA haml/ directory already exists, so skipping\n", :red
48
48
  else
49
49
  say "Converting HTML files to Haml...", :green
50
- FileUtils.mkdir_p "haml", :verbose => true
50
+ FileUtils.mkdir_p "assets/views", :verbose => true
51
51
  Dir["**/*.html"].each { |html_file| html_to_haml(html_file) }
52
52
  end
53
53
  end
54
54
 
55
55
  desc "minify", "Compresses your HTML files from Haml and CSS files from SCSS"
56
56
  def minify
57
- if File.directory? "haml"
57
+ if File.directory? "assets/views"
58
58
  say "\nMinifying HTML from Haml...", :green
59
- Dir["haml/**/*.haml"].each do |haml_file|
59
+ Dir["assets/views/**/*.haml"].each do |haml_file|
60
60
  haml_to_html(haml_file, :ugly => true)
61
61
  end
62
62
  end
63
- if File.directory? "sass"
63
+ if File.directory? "assets/stylesheets"
64
64
  say "\nMinifying CSS from SCSS...", :green
65
- Dir["sass/**/*.scss"].each do |scss_file|
65
+ Dir["assets/stylesheets/**/*.scss"].each do |scss_file|
66
66
  scss_to_css(scss_file, :style => :compressed)
67
67
  end
68
68
  end
@@ -70,15 +70,15 @@ class GuardBoilerPlate < Thor
70
70
 
71
71
  desc "prettify", "Pretties your HTML files from Haml and CSS files from SCSS"
72
72
  def prettify
73
- if File.directory? "haml"
73
+ if File.directory? "assets/views"
74
74
  say "\nPrettifying HTML from Haml...", :green
75
- Dir["haml/**/*.haml"].each do |haml_file|
75
+ Dir["assets/views/**/*.haml"].each do |haml_file|
76
76
  haml_to_html(haml_file)
77
77
  end
78
78
  end
79
- if File.directory? "sass"
79
+ if File.directory? "assets/stylesheets"
80
80
  say "\nPrettifying CSS from SCSS...", :green
81
- Dir["sass/**/*.scss"].each do |scss_file|
81
+ Dir["assets/stylesheets/**/*.scss"].each do |scss_file|
82
82
  scss_to_css(scss_file)
83
83
  end
84
84
  end
@@ -91,7 +91,7 @@ class GuardBoilerPlate < Thor
91
91
  private
92
92
 
93
93
  def html_to_haml(html_file)
94
- haml_file = File.join('haml', html_file.sub(/\.html?$/, '.haml'))
94
+ haml_file = File.join('assets/views', html_file.sub(/\.html?$/, '.haml'))
95
95
 
96
96
  template = File.open(html_file, 'rb') { |f| f.read }
97
97
  output = Haml::HTML.new(template).render
@@ -102,7 +102,7 @@ class GuardBoilerPlate < Thor
102
102
 
103
103
  def haml_to_html(haml_file, options = {})
104
104
  options = { :format => :html5 }.update(options)
105
- html_file = haml_file.sub(/^haml\//, '').sub(/\.haml$/, '.html')
105
+ html_file = haml_file.sub(/^assets\/views\//, '').sub(/\.haml$/, '.html')
106
106
 
107
107
  template = File.open(haml_file, 'rb') { |f| f.read }
108
108
  output = Haml::Engine.new(template, options).render
@@ -112,7 +112,7 @@ class GuardBoilerPlate < Thor
112
112
 
113
113
  def scss_to_css(scss_file, options = {})
114
114
  options = { :syntax => :scss, :style => :expanded }.update(options)
115
- css_file = scss_file.sub(/^sass/, 'css').sub(/\.scss$/, '.css')
115
+ css_file = scss_file.sub(/^assets\/stylesheets/, 'css').sub(/\.scss$/, '.css')
116
116
 
117
117
  template = File.open(scss_file, 'rb') { |f| f.read }
118
118
  output = Sass::Engine.new(template, options).render
@@ -1,3 +1,3 @@
1
1
  module GuardBoilerPlate
2
- VERSION = "0.1.1"
2
+ VERSION = "0.2.0"
3
3
  end
@@ -1,12 +1,12 @@
1
1
  # More info at https://github.com/guard/guard#readme
2
2
 
3
- guard 'sass' do
4
- watch(%r{sass/.+\.(scss|sass)})
3
+ guard 'sass', :output => '../css' do
4
+ watch(%r{assets/stylesheets/.+\.(scss|sass)})
5
5
  end
6
6
 
7
7
  guard 'shell' do
8
- watch(%r{haml/(.+)\.haml}) do |m|
9
- `haml -f html5 #{File.join("haml", m[1])}.haml #{m[1]}.html`
8
+ watch(%r{assets/views/(.+)\.haml}) do |m|
9
+ `haml -f html5 #{File.join("assets/views", m[1])}.haml #{m[1]}.html`
10
10
  puts "Rebuilt #{m[1]}.html"
11
11
  end
12
12
  end
@@ -16,9 +16,9 @@ end
16
16
 
17
17
  guard 'livereload' do
18
18
  watch(%r{.+\.(html|htm)})
19
- watch(%r{haml/.+\.(haml)})
20
19
  watch(%r{css/.+\.(css)})
21
- watch(%r{sass/.+\.(scss|sass)})
22
20
  watch(%r{img/.+\.(png|jpeg|jpg)})
23
21
  watch(%r{js/.+\.(js)})
22
+ watch(%r{assets/views/.+\.(haml)})
23
+ watch(%r{assets/stylesheets/.+\.(scss|sass)})
24
24
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: guard_boilerplate
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 23
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 1
9
- - 1
10
- version: 0.1.1
8
+ - 2
9
+ - 0
10
+ version: 0.2.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Fletcher Nichol