huge-boilerplate-middleman 0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +12 -0
- data/huge-boilerplate-middleman.gemspec +29 -0
- data/lib/huge-boilerplate-middleman/Gemfile +5 -0
- data/lib/huge-boilerplate-middleman/Gemfile.lock +213 -0
- data/lib/huge-boilerplate-middleman/README.md +4 -0
- data/lib/huge-boilerplate-middleman/RakeFile +119 -0
- data/lib/huge-boilerplate-middleman/binaries/jslint4java-2.0.0.jar +0 -0
- data/lib/huge-boilerplate-middleman/config.rb +92 -0
- data/lib/huge-boilerplate-middleman/helpers/layout.rb +17 -0
- data/lib/huge-boilerplate-middleman/helpers/util.rb +8 -0
- data/lib/huge-boilerplate-middleman/source/javascripts/global.js +0 -0
- data/lib/huge-boilerplate-middleman/source/javascripts/libs/jquery-1.7.1.js +9266 -0
- data/lib/huge-boilerplate-middleman/source/javascripts/sample-page.js +0 -0
- data/lib/huge-boilerplate-middleman/source/layout.haml +41 -0
- data/lib/huge-boilerplate-middleman/source/sample-page.html.haml +11 -0
- data/lib/huge-boilerplate-middleman/source/stylesheets/global.css.sass +3 -0
- data/lib/huge-boilerplate-middleman/source/stylesheets/globals/_html5reset.sass +292 -0
- data/lib/huge-boilerplate-middleman/source/stylesheets/globals/_placeholders.sass +31 -0
- data/lib/huge-boilerplate-middleman/source/stylesheets/sample-page.css.sass +0 -0
- metadata +126 -0
data/.gitignore
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
require "rbconfig"
|
3
|
+
|
4
|
+
$:.push File.expand_path("../lib", __FILE__)
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = "huge-boilerplate-middleman"
|
8
|
+
s.version = "0.1"
|
9
|
+
s.platform = Gem::Platform::RUBY
|
10
|
+
s.license = "MIT"
|
11
|
+
s.authors = ["Felipe Silva"]
|
12
|
+
s.email = ["felipef.silva@gmail.com"]
|
13
|
+
s.homepage = "http://middlemanapp.com"
|
14
|
+
s.summary = "Huge boilerplate to be used with middleman"
|
15
|
+
s.description = ""
|
16
|
+
|
17
|
+
s.files = `git ls-files`.split("\n")
|
18
|
+
#s.test_files = `git ls-files -- {fixtures,features}/*`.split("\n")
|
19
|
+
#s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
20
|
+
s.require_paths = ["lib"]
|
21
|
+
|
22
|
+
# TODO remove for 2.1.x
|
23
|
+
s.post_install_message = "Huge boilerplate middleman installed."
|
24
|
+
|
25
|
+
s.add_dependency("middleman", ["~> 2.0.8"])
|
26
|
+
s.add_dependency("w3c_validators")
|
27
|
+
s.add_dependency("term-ansicolor")
|
28
|
+
end
|
29
|
+
|
@@ -0,0 +1,213 @@
|
|
1
|
+
GEM
|
2
|
+
remote: http://rubygems.org/
|
3
|
+
specs:
|
4
|
+
actionmailer (3.1.1)
|
5
|
+
actionpack (= 3.1.1)
|
6
|
+
mail (~> 2.3.0)
|
7
|
+
actionpack (3.1.1)
|
8
|
+
activemodel (= 3.1.1)
|
9
|
+
activesupport (= 3.1.1)
|
10
|
+
builder (~> 3.0.0)
|
11
|
+
erubis (~> 2.7.0)
|
12
|
+
i18n (~> 0.6)
|
13
|
+
rack (~> 1.3.2)
|
14
|
+
rack-cache (~> 1.1)
|
15
|
+
rack-mount (~> 0.8.2)
|
16
|
+
rack-test (~> 0.6.1)
|
17
|
+
sprockets (~> 2.0.2)
|
18
|
+
activemodel (3.1.1)
|
19
|
+
activesupport (= 3.1.1)
|
20
|
+
builder (~> 3.0.0)
|
21
|
+
i18n (~> 0.6)
|
22
|
+
activerecord (3.1.1)
|
23
|
+
activemodel (= 3.1.1)
|
24
|
+
activesupport (= 3.1.1)
|
25
|
+
arel (~> 2.2.1)
|
26
|
+
tzinfo (~> 0.3.29)
|
27
|
+
activeresource (3.1.1)
|
28
|
+
activemodel (= 3.1.1)
|
29
|
+
activesupport (= 3.1.1)
|
30
|
+
activesupport (3.1.1)
|
31
|
+
multi_json (~> 1.0)
|
32
|
+
addressable (2.2.6)
|
33
|
+
arel (2.2.1)
|
34
|
+
builder (3.0.0)
|
35
|
+
childprocess (0.2.2)
|
36
|
+
ffi (~> 1.0.6)
|
37
|
+
chunky_png (1.2.5)
|
38
|
+
coffee-script (2.2.0)
|
39
|
+
coffee-script-source
|
40
|
+
execjs
|
41
|
+
coffee-script-source (1.1.2)
|
42
|
+
compass (0.11.5)
|
43
|
+
chunky_png (~> 1.2)
|
44
|
+
fssm (>= 0.2.7)
|
45
|
+
sass (~> 3.1)
|
46
|
+
daemons (1.1.4)
|
47
|
+
diff-lcs (1.1.3)
|
48
|
+
em-websocket (0.3.5)
|
49
|
+
addressable (>= 2.1.1)
|
50
|
+
eventmachine (>= 0.12.9)
|
51
|
+
erubis (2.7.0)
|
52
|
+
eventmachine (0.12.10)
|
53
|
+
execjs (1.2.9)
|
54
|
+
multi_json (~> 1.0)
|
55
|
+
ffi (1.0.9)
|
56
|
+
fssm (0.2.7)
|
57
|
+
guard (0.6.3)
|
58
|
+
thor (~> 0.14.6)
|
59
|
+
guard-livereload (0.3.1)
|
60
|
+
em-websocket (>= 0.2.0)
|
61
|
+
guard (>= 0.4.0)
|
62
|
+
multi_json (~> 1.0.3)
|
63
|
+
haml (3.1.3)
|
64
|
+
hike (1.2.1)
|
65
|
+
http_router (0.10.2)
|
66
|
+
rack (>= 1.0.0)
|
67
|
+
url_mount (~> 0.2.1)
|
68
|
+
i18n (0.6.0)
|
69
|
+
jasmine (1.1.0)
|
70
|
+
jasmine-core (>= 1.1.0)
|
71
|
+
rack (>= 1.1)
|
72
|
+
rspec (>= 1.3.1)
|
73
|
+
selenium-webdriver (>= 0.1.3)
|
74
|
+
jasmine-core (1.1.0)
|
75
|
+
json (1.6.1)
|
76
|
+
json_pure (1.6.1)
|
77
|
+
mail (2.3.0)
|
78
|
+
i18n (>= 0.4.0)
|
79
|
+
mime-types (~> 1.16)
|
80
|
+
treetop (~> 1.4.8)
|
81
|
+
maruku (0.6.0)
|
82
|
+
syntax (>= 1.0.0)
|
83
|
+
middleman (2.0.13.1)
|
84
|
+
coffee-script (~> 2.2.0)
|
85
|
+
compass (~> 0.11.3)
|
86
|
+
execjs (~> 1.2.7)
|
87
|
+
guard (~> 0.6.2)
|
88
|
+
haml (~> 3.1.0)
|
89
|
+
maruku (~> 0.6.0)
|
90
|
+
middleman-livereload (~> 0.2.0)
|
91
|
+
padrino-core (~> 0.10.5)
|
92
|
+
padrino-helpers (~> 0.10.5)
|
93
|
+
rack (~> 1.3.5)
|
94
|
+
rack-test (~> 0.6.1)
|
95
|
+
sass (~> 3.1.7)
|
96
|
+
sinatra (~> 1.3.1)
|
97
|
+
slim (~> 1.0.2)
|
98
|
+
sprockets (~> 2.0.3)
|
99
|
+
thin (~> 1.2.11)
|
100
|
+
thor (~> 0.14.0)
|
101
|
+
tilt (~> 1.3.1)
|
102
|
+
uglifier (~> 1.0.0)
|
103
|
+
middleman-livereload (0.2.1)
|
104
|
+
guard-livereload (~> 0.3.1)
|
105
|
+
mime-types (1.17.1)
|
106
|
+
multi_json (1.0.3)
|
107
|
+
nokogiri (1.5.0)
|
108
|
+
padrino-core (0.10.5)
|
109
|
+
activesupport (~> 3.1.0)
|
110
|
+
http_router (~> 0.10.2)
|
111
|
+
sinatra (~> 1.3.1)
|
112
|
+
thor (~> 0.14.3)
|
113
|
+
tilt (~> 1.3.0)
|
114
|
+
padrino-helpers (0.10.5)
|
115
|
+
i18n (~> 0.6)
|
116
|
+
padrino-core (= 0.10.5)
|
117
|
+
polyglot (0.3.2)
|
118
|
+
rack (1.3.5)
|
119
|
+
rack-cache (1.1)
|
120
|
+
rack (>= 0.4)
|
121
|
+
rack-mount (0.8.3)
|
122
|
+
rack (>= 1.0.0)
|
123
|
+
rack-protection (1.1.4)
|
124
|
+
rack
|
125
|
+
rack-ssl (1.3.2)
|
126
|
+
rack
|
127
|
+
rack-test (0.6.1)
|
128
|
+
rack (>= 1.0)
|
129
|
+
rails (3.1.1)
|
130
|
+
actionmailer (= 3.1.1)
|
131
|
+
actionpack (= 3.1.1)
|
132
|
+
activerecord (= 3.1.1)
|
133
|
+
activeresource (= 3.1.1)
|
134
|
+
activesupport (= 3.1.1)
|
135
|
+
bundler (~> 1.0)
|
136
|
+
railties (= 3.1.1)
|
137
|
+
railties (3.1.1)
|
138
|
+
actionpack (= 3.1.1)
|
139
|
+
activesupport (= 3.1.1)
|
140
|
+
rack-ssl (~> 1.3.2)
|
141
|
+
rake (>= 0.8.7)
|
142
|
+
rdoc (~> 3.4)
|
143
|
+
thor (~> 0.14.6)
|
144
|
+
rake (0.9.2.2)
|
145
|
+
rdoc (3.11)
|
146
|
+
json (~> 1.4)
|
147
|
+
rspec (2.7.0)
|
148
|
+
rspec-core (~> 2.7.0)
|
149
|
+
rspec-expectations (~> 2.7.0)
|
150
|
+
rspec-mocks (~> 2.7.0)
|
151
|
+
rspec-core (2.7.1)
|
152
|
+
rspec-expectations (2.7.0)
|
153
|
+
diff-lcs (~> 1.1.2)
|
154
|
+
rspec-mocks (2.7.0)
|
155
|
+
rspec-rails (2.7.0)
|
156
|
+
actionpack (~> 3.0)
|
157
|
+
activesupport (~> 3.0)
|
158
|
+
railties (~> 3.0)
|
159
|
+
rspec (~> 2.7.0)
|
160
|
+
rubyzip (0.9.4)
|
161
|
+
sass (3.1.10)
|
162
|
+
selenium-client (1.2.18)
|
163
|
+
selenium-rc (2.4.0)
|
164
|
+
selenium-client (>= 1.2.18)
|
165
|
+
selenium-webdriver (2.9.1)
|
166
|
+
childprocess (>= 0.2.1)
|
167
|
+
ffi (= 1.0.9)
|
168
|
+
json_pure
|
169
|
+
rubyzip
|
170
|
+
sinatra (1.3.1)
|
171
|
+
rack (~> 1.3, >= 1.3.4)
|
172
|
+
rack-protection (~> 1.1, >= 1.1.2)
|
173
|
+
tilt (~> 1.3, >= 1.3.3)
|
174
|
+
slim (1.0.3)
|
175
|
+
temple (~> 0.3.4)
|
176
|
+
tilt (~> 1.3.2)
|
177
|
+
sprockets (2.0.3)
|
178
|
+
hike (~> 1.2)
|
179
|
+
rack (~> 1.0)
|
180
|
+
tilt (~> 1.1, != 1.3.0)
|
181
|
+
syntax (1.0.0)
|
182
|
+
temple (0.3.4)
|
183
|
+
term-ansicolor (1.0.7)
|
184
|
+
thin (1.2.11)
|
185
|
+
daemons (>= 1.0.9)
|
186
|
+
eventmachine (>= 0.12.6)
|
187
|
+
rack (>= 1.0.0)
|
188
|
+
thor (0.14.6)
|
189
|
+
tilt (1.3.3)
|
190
|
+
treetop (1.4.10)
|
191
|
+
polyglot
|
192
|
+
polyglot (>= 0.3.1)
|
193
|
+
tzinfo (0.3.30)
|
194
|
+
uglifier (1.0.4)
|
195
|
+
execjs (>= 0.3.0)
|
196
|
+
multi_json (>= 1.0.2)
|
197
|
+
url_mount (0.2.1)
|
198
|
+
rack
|
199
|
+
w3c_validators (1.2)
|
200
|
+
json
|
201
|
+
nokogiri
|
202
|
+
|
203
|
+
PLATFORMS
|
204
|
+
ruby
|
205
|
+
|
206
|
+
DEPENDENCIES
|
207
|
+
jasmine
|
208
|
+
middleman (~> 2.0.8)
|
209
|
+
rails
|
210
|
+
rspec-rails
|
211
|
+
selenium-rc
|
212
|
+
term-ansicolor
|
213
|
+
w3c_validators
|
@@ -0,0 +1,119 @@
|
|
1
|
+
require './helpers/util'
|
2
|
+
require 'term/ansicolor'
|
3
|
+
|
4
|
+
desc "Validate one specific file"
|
5
|
+
task :validate, [:file] => :create_build do |t, args|
|
6
|
+
require 'w3c_validators'
|
7
|
+
include W3CValidators
|
8
|
+
include Term::ANSIColor
|
9
|
+
|
10
|
+
@validator = MarkupValidator.new
|
11
|
+
|
12
|
+
file = args.file
|
13
|
+
results = @validator.validate_file(file)
|
14
|
+
|
15
|
+
if results.errors.length > 0
|
16
|
+
filename = file.split('/').last
|
17
|
+
puts filename.red.bold
|
18
|
+
|
19
|
+
results.errors.each do |err|
|
20
|
+
puts err.to_s
|
21
|
+
end
|
22
|
+
else
|
23
|
+
puts file.green.bold
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
desc "Validating all batches"
|
28
|
+
task :"validate:all" => :create_build do
|
29
|
+
require 'w3c_validators'
|
30
|
+
include W3CValidators
|
31
|
+
include Term::ANSIColor
|
32
|
+
|
33
|
+
success = 0
|
34
|
+
@validator = MarkupValidator.new
|
35
|
+
|
36
|
+
Dir.glob("build/*.html").each do |file|
|
37
|
+
if file != "build/index.html"
|
38
|
+
results = @validator.validate_file(file)
|
39
|
+
|
40
|
+
if results.errors.length > 0
|
41
|
+
success = -1
|
42
|
+
filename = file.split('/').last
|
43
|
+
puts filename.red.bold
|
44
|
+
|
45
|
+
results.errors.each do |err|
|
46
|
+
puts err.to_s
|
47
|
+
end
|
48
|
+
else
|
49
|
+
puts file.green
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
exit success
|
55
|
+
end
|
56
|
+
|
57
|
+
desc "Check the JavaScript source with JSLint"
|
58
|
+
task :jslint do
|
59
|
+
include Term::ANSIColor
|
60
|
+
|
61
|
+
success = 0
|
62
|
+
|
63
|
+
Dir.glob("source/javascripts/*.js").each do |file|
|
64
|
+
cmd = "java -jar binaries/jslint4java-2.0.0.jar #{file} --white --sloppy --undef --vars --confusion --nomen"
|
65
|
+
results = %x{#{cmd}}
|
66
|
+
|
67
|
+
if results.length > 1
|
68
|
+
puts results.bold.red
|
69
|
+
success = -1
|
70
|
+
else
|
71
|
+
puts file.bold.green
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
exit success
|
76
|
+
end
|
77
|
+
|
78
|
+
desc "Ensure that the latest has been pulled from git."
|
79
|
+
task :ensure_current do
|
80
|
+
include PackageHelper
|
81
|
+
include Term::ANSIColor
|
82
|
+
|
83
|
+
case ask "Please ensure sure you've pulled the latest from git before proceeding.\nWould you like to continue? (y/n): "
|
84
|
+
when ("y" || "Y" || "yes" || "YES")
|
85
|
+
# nothing
|
86
|
+
else
|
87
|
+
puts "Process aborted".red
|
88
|
+
abort
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
desc "Create a build of flat files."
|
93
|
+
task :create_build do
|
94
|
+
include PackageHelper
|
95
|
+
include Term::ANSIColor
|
96
|
+
|
97
|
+
puts "Creating a build".yellow
|
98
|
+
sh %{ middleman build } do |ok, res|
|
99
|
+
if !ok
|
100
|
+
puts "There was a problem while creating build. Please try again. (status = #{res.exitstatus})".red
|
101
|
+
end
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
105
|
+
######## Sample - deploying to server ########
|
106
|
+
# desc "Deploy to Dev server"
|
107
|
+
# task :'deploy:olddev' => [:ensure_current, :create_build] do
|
108
|
+
# include PackageHelper
|
109
|
+
# include Term::ANSIColor
|
110
|
+
#
|
111
|
+
# puts "Deploying to DEV Server (nyicolo-dev177 /var/www/html)".yellow
|
112
|
+
# sh %{ rsync -rhltvz -e ssh --progress --delete build/* agt@nyicolo-dev177:/var/www/html } do |ok, res|
|
113
|
+
# if !ok
|
114
|
+
# puts "There was a problem deploying via rsync. Please try again. (status = #{res.exitstatus})".red
|
115
|
+
# end
|
116
|
+
# end
|
117
|
+
# puts "Deployment complete.".green
|
118
|
+
# end
|
119
|
+
|
Binary file
|
@@ -0,0 +1,92 @@
|
|
1
|
+
###
|
2
|
+
# Compass
|
3
|
+
###
|
4
|
+
|
5
|
+
# Susy grids in Compass
|
6
|
+
# First: gem install compass-susy-plugin
|
7
|
+
# require 'susy'
|
8
|
+
|
9
|
+
# Change Compass configuration
|
10
|
+
# compass_config do |config|
|
11
|
+
# config.output_style = :compact
|
12
|
+
# end
|
13
|
+
|
14
|
+
###
|
15
|
+
# Haml
|
16
|
+
###
|
17
|
+
|
18
|
+
# CodeRay syntax highlighting in Haml
|
19
|
+
# First: gem install haml-coderay
|
20
|
+
# require 'haml-coderay'
|
21
|
+
|
22
|
+
# CoffeeScript filters in Haml
|
23
|
+
# First: gem install coffee-filter
|
24
|
+
# require 'coffee-filter'
|
25
|
+
|
26
|
+
# Automatic image dimensions on image_tag helper
|
27
|
+
# activate :automatic_image_sizes
|
28
|
+
|
29
|
+
###
|
30
|
+
# Page command
|
31
|
+
###
|
32
|
+
|
33
|
+
# Per-page layout changes:
|
34
|
+
#
|
35
|
+
# With no layout
|
36
|
+
# page "/sample-page.html", :layout => false
|
37
|
+
#
|
38
|
+
# With alternative layout
|
39
|
+
# page "/sample-page.html", :layout => :sample_page_layout
|
40
|
+
#
|
41
|
+
# A path which all have the same layout
|
42
|
+
# with_layout :admin do
|
43
|
+
# page "/admin/*"
|
44
|
+
# end
|
45
|
+
|
46
|
+
# Proxy (fake) files
|
47
|
+
# page "/this-page-has-no-template.html", :proxy => "/template-file.html" do
|
48
|
+
# @which_fake_page = "Rendering a fake page with a variable"
|
49
|
+
# end
|
50
|
+
|
51
|
+
###
|
52
|
+
# Helpers
|
53
|
+
###
|
54
|
+
|
55
|
+
set :haml, { :attr_wrapper => "\"" }
|
56
|
+
|
57
|
+
Dir["./helpers/*.rb"].each {|file| require file }
|
58
|
+
helpers do
|
59
|
+
include LayoutHelper
|
60
|
+
end
|
61
|
+
|
62
|
+
# Change the CSS directory
|
63
|
+
# set :css_dir, "alternative_css_directory"
|
64
|
+
|
65
|
+
# Change the JS directory
|
66
|
+
# set :js_dir, "alternative_js_directory"
|
67
|
+
|
68
|
+
# Change the images directory
|
69
|
+
# set :images_dir, "alternative_image_directory"
|
70
|
+
|
71
|
+
# Build-specific configuration
|
72
|
+
configure :build do
|
73
|
+
# For example, change the Compass output style for deployment
|
74
|
+
# activate :minify_css
|
75
|
+
|
76
|
+
# Minify Javascript on build
|
77
|
+
# activate :minify_javascript
|
78
|
+
|
79
|
+
# Enable cache buster
|
80
|
+
# activate :cache_buster
|
81
|
+
|
82
|
+
# Use relative URLs
|
83
|
+
# activate :relative_assets
|
84
|
+
|
85
|
+
# Compress PNGs after build
|
86
|
+
# First: gem install middleman-smusher
|
87
|
+
# require "middleman-smusher"
|
88
|
+
# activate :smusher
|
89
|
+
|
90
|
+
# Or use a different image path
|
91
|
+
# set :http_path, "/Content/images/"
|
92
|
+
end
|