Skip to content

Commit 76baccd

Browse files
committed
Add Gulp tasks
1 parent ed2b08f commit 76baccd

29 files changed

Lines changed: 492 additions & 19 deletions

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ capybara-*.html
99
/public/system
1010
/coverage/
1111
/spec/tmp
12+
/node_modules
1213
**.orig
1314
rerun.txt
1415
pickle-email-*.html
Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,10 @@
11
// This is a manifest file that'll be compiled into application.js, which will include all the files
22
// listed below.
33
//
4-
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5-
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
6-
//
7-
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8-
// compiled file.
9-
//
10-
// Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
11-
// about supported directives.
4+
// Only include gem installed javascript assets here. All other js develoment should use Common JS
5+
// and will be compiled with Gulp and Browserify
126
//
137
//= require jquery
148
//= require jquery_ujs
159
//= require turbolinks
16-
//= require_tree .
10+
//= require compiled/global.js

app/assets/javascripts/global.coffee

Whitespace-only changes.

app/assets/stylesheets/application.css

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,8 @@
22
* This is a manifest file that'll be compiled into application.css, which will include all the files
33
* listed below.
44
*
5-
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6-
* or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
5+
* Use this file to include any stylesheet assets from installed gems. All other css is compiled with
6+
* libsass with Gulp.
77
*
8-
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
9-
* compiled file so the styles you add here take precedence over styles defined in any styles
10-
* defined in the other CSS/SCSS files in this directory. It is generally better to create a new
11-
* file per style scope.
12-
*
13-
*= require_tree .
14-
*= require_self
8+
*= require compiled/global.css
159
*/

app/assets/stylesheets/global.sass

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
body
2+
background: blue
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
class WelcomeController < ApplicationController
2+
def index
3+
end
4+
end

app/helpers/welcome_helper.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
module WelcomeHelper
2+
end

app/views/welcome/index.html.erb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<h1>Welcome#index</h1>
2+
<p>Find me in app/views/welcome/index.html.erb</p>

config/routes.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
Rails.application.routes.draw do
2+
get 'welcome/index'
3+
24
# The priority is based upon order of creation: first created -> highest priority.
35
# See how all your routes lay out with "rake routes".
46

57
# You can have the root of your site routed with "root"
6-
# root 'welcome#index'
8+
root 'welcome#index'
79

810
# Example of regular route:
911
# get 'products/:id' => 'catalog#view'

gulp/config.js

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
var assets = "./app/assets";
2+
3+
module.exports = {
4+
browserSync: {
5+
proxy: 'localhost:3000'
6+
},
7+
sass: {
8+
src: assets + "/stylesheets/*.{sass,scss}",
9+
dest: assets + "/stylesheets/compiled",
10+
settings: {
11+
indentedSyntax: true, // Enable .sass syntax!
12+
imagePath: 'images' // Used by the image-url helper
13+
}
14+
},
15+
images: {
16+
src: assets + "/images/**",
17+
dest: assets + "/images"
18+
},
19+
iconFonts: {
20+
name: 'Gulp Rails Icons',
21+
src: assets + "/images/icons/*.svg",
22+
dest: assets + '/fonts',
23+
sassDest: assets + '/stylesheets/base',
24+
template: './gulp/tasks/iconFont/template.sass.swig',
25+
sassOutputName: '_icons.sass',
26+
fontPath: 'fonts',
27+
className: 'icon',
28+
options: {
29+
fontName: 'gulp-rails-icons',
30+
appendCodepoints: true,
31+
normalize: false
32+
}
33+
},
34+
browserify: {
35+
bundleConfigs: [{
36+
entries: assets + '/javascripts/global.coffee',
37+
dest: assets + '/javascripts/compiled',
38+
outputName: 'global.js',
39+
extensions: ['.js','.coffee']
40+
}]
41+
}
42+
};

0 commit comments

Comments
 (0)