Skip to content
This repository has been archived by the owner on Jul 2, 2024. It is now read-only.

Commit

Permalink
Fix Grunt tasks for repository
Browse files Browse the repository at this point in the history
  • Loading branch information
willmendesneto committed Jan 18, 2015
2 parents f65f691 + b186a82 commit 02ea2fe
Show file tree
Hide file tree
Showing 7 changed files with 132 additions and 41 deletions.
61 changes: 59 additions & 2 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,23 @@ module.exports = function (grunt) {
dist: ['<%= yeoman.dist %>/*.html']
},

rsync: {
options: {
args: ['--verbose'],
exclude: ['.git*','*.scss','node_modules'],
recursive: true
},
prod: {
options: {
src: '<%= yeoman.dist %>/',
dest: '/home/linguagil/linguagil.com.br/',
host: '[email protected]',
syncDestIgnoreExcl: true
}
}
},


// Allow the use of non-minsafe AngularJS files. Automatically makes it
// minsafe compatible so Uglify does not destroy the ng references
ngAnnotate: {
Expand Down Expand Up @@ -374,7 +391,7 @@ module.exports = function (grunt) {

grunt.registerTask('modifyImageLinkInScript', 'Task for replace image link in script file.', function(filename, imageTarget) {
var fs = require('fs'),
SCRIPTS_DIST_DIR = 'dist/js',
SCRIPTS_DIST_DIR = 'dist/scripts',
IMAGE_DIST_DIR = 'dist/images',
oldestImage = imageTarget
;
Expand All @@ -398,6 +415,32 @@ module.exports = function (grunt) {

});

grunt.registerTask('modifyImageLinkInStyles', 'Task for replace image link in stylesheet file.', function(filename, imageTarget) {
var fs = require('fs'),
STYLES_DIST_DIR = 'dist/styles',
IMAGE_DIST_DIR = 'dist/images',
oldestImage = imageTarget
;

fs.readdirSync(STYLES_DIST_DIR).forEach(function(file) {
if ( file.indexOf(filename) !== (-1) ) {
filename = STYLES_DIST_DIR+'/'+file;
}
});

fs.readdirSync(IMAGE_DIST_DIR).forEach(function(file) {
if ( file.indexOf(oldestImage) !== (-1) ) {
imageTarget = file;
}
});

var data = fs.readFileSync(filename, 'utf8');
data = data.replace(new RegExp(oldestImage, 'g'), imageTarget);

fs.writeFileSync(filename, data, 'utf8');

});

grunt.registerTask('serve', function (target) {
if (target === 'dist') {
return grunt.task.run(['build', 'connect:dist:keepalive']);
Expand Down Expand Up @@ -442,12 +485,26 @@ module.exports = function (grunt) {
'rev',
'usemin',
'htmlmin',
'modifyImageLinkInScript:scripts.js:pin.png'
'modifyImageLinkInScript:scripts.js:pin.png',
'modifyImageLinkInStyles:main.css:home-background.jpg'
]);

grunt.registerTask('default', [
'newer:jshint',
'test',
'build'
]);

grunt.registerTask('travis', [
'bower-install',
'jshint',
'build',
'htmllint:dist'
]);

grunt.registerTask('deploy', [
'travis',
'rsync:prod'
]);

};
34 changes: 34 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,40 @@ Estamos usando ferramentas javascript. É preciso ter o node.js maior que 0.10.0

Para instalar todos os pacotes e ver o site rodando localmente, use:

Instale o grunt globalmente:

```
npm -g install grunt-cli
```


### Bower

Instale o bower globalmente e as definições do bower.json

```
npm -g install bower
bower install
```

### Outros pacotes

Instale o resto que está descrito no package.json.

```
npm install
```

## Desenvolvimento

Para ver as modificações acontecendo quando os arquivos forem salvos:

```
grunt server
```

Para executar os testes.

```
npm start
```
6 changes: 3 additions & 3 deletions app/codigo-de-conduta.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

<link href="http://fonts.googleapis.com/css?family=Open+Sans:400,600,300" rel="stylesheet" type="text/css" />
<link href="//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.0.3/css/font-awesome.min.css" rel="stylesheet">
<!-- build:css({.tmp,app}) css/main.css -->
<!-- build:css({.tmp,app}) styles/main.css -->
<link rel="stylesheet" type="text/css" href="bower_components/bootstrap/dist/css/bootstrap.min.css"/>

<link rel="stylesheet" href="bower_components/mediaelement/build/mediaelementplayer.min.css"/>
Expand Down Expand Up @@ -146,7 +146,7 @@ <h3 class="col-md-12 col-lg-12 col-xs-12 col-sm-12 text-center"><span class="par
<!-- /Footer -->

<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script>
<!-- build:js js/plugins.js -->
<!-- build:js scripts/plugins.js -->
<script type="text/javascript" src="bower_components/fastclick/lib/fastclick.js"></script>
<script src="http://code.jquery.com/jquery-2.0.3.min.js"></script>
<script type="text/javascript">
Expand All @@ -160,7 +160,7 @@ <h3 class="col-md-12 col-lg-12 col-xs-12 col-sm-12 text-center"><span class="par
<script type="text/javascript" src="bower_components/gmaps/gmaps.js"></script>
<!-- endbuild -->

<!-- build:js({.tmp,app}) js/scripts.js -->
<!-- build:js({.tmp,app}) scripts/scripts.js -->
<script src="scripts/main.js"></script>
<!-- endbuild -->

Expand Down
8 changes: 4 additions & 4 deletions app/eventos-anteriores.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

<link href="http://fonts.googleapis.com/css?family=Open+Sans:400,600,300" rel="stylesheet" type="text/css" />
<link href="//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.0.3/css/font-awesome.min.css" rel="stylesheet">
<!-- build:css({.tmp,app}) css/main.css -->
<!-- build:css({.tmp,app}) styles/main.css -->
<link rel="stylesheet" type="text/css" href="bower_components/bootstrap/dist/css/bootstrap.min.css"/>

<link rel="stylesheet" href="bower_components/mediaelement/build/mediaelementplayer.min.css"/>
Expand Down Expand Up @@ -54,7 +54,7 @@
<!-- /Side Menu -->

<!-- Full Page Image Header Area -->
<div id="top" class="header conduct-code">
<div id="top" class="header conduct-code" >
<div class="vert-text">
<h1><img src="images/linguagil-logo.png" width="350" height="178" alt="Linguágil 2015" /></h1>
<h2><span class="parallax-text square-reticle">Eventos anteriores</span></h2>
Expand Down Expand Up @@ -203,7 +203,7 @@ <h3 class="col-md-12 col-lg-12 col-xs-12 col-sm-12 text-center"><span class="par
<!-- /Footer -->

<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script>
<!-- build:js js/plugins.js -->
<!-- build:js scripts/plugins.js -->
<script type="text/javascript" src="bower_components/fastclick/lib/fastclick.js"></script>
<script src="http://code.jquery.com/jquery-2.0.3.min.js"></script>
<script type="text/javascript">
Expand All @@ -217,7 +217,7 @@ <h3 class="col-md-12 col-lg-12 col-xs-12 col-sm-12 text-center"><span class="par
<script type="text/javascript" src="bower_components/gmaps/gmaps.js"></script>
<!-- endbuild -->

<!-- build:js({.tmp,app}) js/scripts.js -->
<!-- build:js({.tmp,app}) scripts/scripts.js -->
<script src="scripts/main.js"></script>
<!-- endbuild -->

Expand Down
8 changes: 4 additions & 4 deletions app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

<link href="http://fonts.googleapis.com/css?family=Open+Sans:400,600,300" rel="stylesheet" type="text/css" />
<link href="//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.0.3/css/font-awesome.min.css" rel="stylesheet">
<!-- build:css({.tmp,app}) css/main.css -->
<!-- build:css({.tmp,app}) styles/main.css -->
<link rel="stylesheet" type="text/css" href="bower_components/bootstrap/dist/css/bootstrap.min.css"/>

<link rel="stylesheet" href="bower_components/mediaelement/build/mediaelementplayer.min.css"/>
Expand Down Expand Up @@ -163,7 +163,7 @@ <h2>Inscrições</h2>
<div class="row">
<div class="col-md-10 col-md-offset-1 text-center">
<a href="https://eventioz.com.br/e/linguagil-2015" class="btn btn-default btn-lg btn-danger btn-registration-form">Inscreva-se no LinguÁgil 2015</a>
<iframe id="iframe-inscricao" class="registration-form" src="https://eventioz.com.br/e/linguagil-2015/registrations/new?iframe=" width="600" height="1000" frameborder="0" scrolling="yes" style="width:600;height:1000;border:none; "></iframe>
<iframe id="iframe-inscricao" class="registration-form" src="https://eventioz.com.br/e/linguagil-2015/registrations/new?iframe=" width="600" height="1000" style="width:600;height:1000;border:none; "></iframe>

</div>
</div>
Expand Down Expand Up @@ -267,7 +267,7 @@ <h3 class="col-md-12 col-lg-12 col-xs-12 col-sm-12 text-center"><span class="par
<!-- /Footer -->

<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script>
<!-- build:js js/plugins.js -->
<!-- build:js scripts/plugins.js -->
<script type="text/javascript" src="bower_components/fastclick/lib/fastclick.js"></script>
<script src="http://code.jquery.com/jquery-2.0.3.min.js"></script>
<script type="text/javascript">
Expand All @@ -281,7 +281,7 @@ <h3 class="col-md-12 col-lg-12 col-xs-12 col-sm-12 text-center"><span class="par
<script type="text/javascript" src="bower_components/gmaps/gmaps.js"></script>
<!-- endbuild -->

<!-- build:js({.tmp,app}) js/scripts.js -->
<!-- build:js({.tmp,app}) scripts/scripts.js -->
<script src="scripts/main.js"></script>
<!-- endbuild -->

Expand Down
Loading

0 comments on commit 02ea2fe

Please sign in to comment.