embargo 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +26 -0
- data/Rakefile +1 -0
- data/bin/embargo +85 -0
- data/boilerplate/project/Gemfile +3 -0
- data/boilerplate/project/Gemfile.lock +67 -0
- data/boilerplate/project/Procfile +2 -0
- data/boilerplate/project/Procfile.prod +1 -0
- data/boilerplate/project/README.md +29 -0
- data/boilerplate/project/assets/gulpfile.js +150 -0
- data/boilerplate/project/assets/package.json +31 -0
- data/boilerplate/project/assets/src/apple-touch-icon-precomposed.png +0 -0
- data/boilerplate/project/assets/src/coffee/_site_init.coffee +6 -0
- data/boilerplate/project/assets/src/favicon.ico +0 -0
- data/boilerplate/project/assets/src/humans.txt +14 -0
- data/boilerplate/project/assets/src/robots.txt +5 -0
- data/boilerplate/project/config/local_variables.rb +0 -0
- data/boilerplate/project/config.ru +3 -0
- data/boilerplate/project/public/apple-touch-icon-precomposed.png +0 -0
- data/boilerplate/project/public/favicon.ico +0 -0
- data/boilerplate/project/public/humans.txt +14 -0
- data/boilerplate/project/public/robots.txt +5 -0
- data/boilerplate/project/views/index.haml +9 -0
- data/boilerplate/project/views/layout.haml +16 -0
- data/boilerplate/project/views/partials/_footer.haml +0 -0
- data/boilerplate/project/views/partials/_nav-homepage.haml +14 -0
- data/lib/config/environments/development.rb +5 -0
- data/lib/config/init.rb +14 -0
- data/lib/config/unicorn.rb +16 -0
- data/lib/content_for.rb +16 -0
- data/lib/embargo.rb +48 -0
- metadata +247 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 8b1612230b501d654f76f4f81574ede7f0850dc3
|
4
|
+
data.tar.gz: 48dd920b65d48edcbad2ca95140b93900aa4f7f9
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: d80091c676c2cca0706d32cd99654ae99fc9feb8c7777d7a5546c50888f6c8795278f344c9da640a6f343b0305b885e4d8bf7f6a89ece3ae038623a4293213b5
|
7
|
+
data.tar.gz: b2984ccd6e48643c51482cbe0abc5c7533e00b1afa823e6bd7105f3236a8ef54c6df3eaa6fb7daa0601b088e33c74c76d046bf546c840b2f2d8e0614658fafae
|
data/README.md
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
Getting Started
|
2
|
+
|
3
|
+
1. Install [node](http://nodejs.org/)
|
4
|
+
1. Install gulp dependencies `(cd frontend && npm install)`
|
5
|
+
1. Install [rvm](http://rvm.io/)
|
6
|
+
1. Return to root directory `cd ..`
|
7
|
+
1. Install ruby 2.1.2 `rvm install 2.1.2`
|
8
|
+
1. Install bundler `gem install bundler`
|
9
|
+
1. Run `bundle` in this directory
|
10
|
+
1. Start the server with `foreman start`
|
11
|
+
|
12
|
+
Development Details
|
13
|
+
========
|
14
|
+
When you run `foreman start` the server is started and a [gulp task](http://github.com/traitify/homepage/frontend/gulpfile.js) is also started. This allows you to edit the files in the [frontend](http://github.com/traitify/homepage/frontend) directory and see your changes in the website.
|
15
|
+
|
16
|
+
The gulp task will compile your sass, image, etc. changes and move them to the public folder. The public folder is auto-generated and should not be modified. Any code you place manually in the public folder will be overwritten.
|
17
|
+
|
18
|
+
The app has live-reload enabled so when you make a change to one of the files it is watching, the browser will refresh for you automatically.
|
19
|
+
|
20
|
+
If you would like to run the app in production mode, you can do so by running:
|
21
|
+
|
22
|
+
```
|
23
|
+
foreman start -f Procfile.prod
|
24
|
+
```
|
25
|
+
|
26
|
+
View in your browser on port 5000.
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
data/bin/embargo
ADDED
@@ -0,0 +1,85 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# Copyright (c) 2014 Carson Wright
|
4
|
+
#
|
5
|
+
require 'fileutils'
|
6
|
+
require 'active_support/inflector'
|
7
|
+
spec = Gem::Specification.find_by_name("embargo")
|
8
|
+
gem_root = spec.gem_dir
|
9
|
+
gem_lib = gem_root + "/lib"
|
10
|
+
|
11
|
+
|
12
|
+
case ARGV[0]
|
13
|
+
when "new"
|
14
|
+
puts "Creating your app!"
|
15
|
+
local_path = File.expand_path("..", File.dirname(__FILE__))
|
16
|
+
|
17
|
+
type = ARGV[1] == "plugin" ? "plugin" : "project"
|
18
|
+
name = type == "project" ? ARGV[1] : ARGV[2]
|
19
|
+
FileUtils.cp_r local_path + "/boilerplate/#{type}", name
|
20
|
+
|
21
|
+
if type == "project"
|
22
|
+
Dir.chdir(name+'/assets') do
|
23
|
+
exec("npm install && cd .. && bundle install")
|
24
|
+
end
|
25
|
+
|
26
|
+
elsif type == "plugin"
|
27
|
+
Dir.glob("#{ARGV[2]}/**/*your_embargo_plugin*").each do |file_name|
|
28
|
+
new_file_name = file_name.gsub(/your_embargo_plugin/, ARGV[2].underscore)
|
29
|
+
File.rename(file_name, new_file_name)
|
30
|
+
end
|
31
|
+
|
32
|
+
Dir.glob("#{ARGV[2]}/*your_embargo_plugin*").each do |file_name|
|
33
|
+
new_file_name = file_name.gsub(/your_embargo_plugin/, ARGV[2].underscore)
|
34
|
+
File.rename(file_name, new_file_name)
|
35
|
+
end
|
36
|
+
|
37
|
+
Dir.glob("#{ARGV[2]}/lib/#{ARGV[2].underscore}/*.rb").each do |file_name|
|
38
|
+
text = File.read(file_name)
|
39
|
+
text = text.gsub(/YourEmbargoPlugin/, ARGV[2].camelcase)
|
40
|
+
text = text.gsub(/your_embargo_plugin/, ARGV[2].underscore)
|
41
|
+
|
42
|
+
f = File.new(file_name, "w")
|
43
|
+
f.write(text)
|
44
|
+
f.close
|
45
|
+
|
46
|
+
File.write(file_name, text)
|
47
|
+
end
|
48
|
+
|
49
|
+
Dir.glob("#{ARGV[2]}/lib/*.rb").each do |file_name|
|
50
|
+
text = File.read(file_name)
|
51
|
+
text = text.gsub(/YourEmbargoPlugin/, ARGV[2].camelcase)
|
52
|
+
text = text.gsub(/your_embargo_plugin/, ARGV[2].underscore)
|
53
|
+
|
54
|
+
f = File.new(file_name, "w")
|
55
|
+
f.write(text)
|
56
|
+
f.close
|
57
|
+
|
58
|
+
File.write(file_name, text)
|
59
|
+
end
|
60
|
+
|
61
|
+
Dir.glob("#{ARGV[2]}/*.*").each do |file_name|
|
62
|
+
text = File.read(file_name)
|
63
|
+
text = text.gsub(/YourEmbargoPlugin/, ARGV[2].camelcase)
|
64
|
+
text = text.gsub(/your_embargo_plugin/, ARGV[2].underscore)
|
65
|
+
|
66
|
+
f = File.new(file_name, "w")
|
67
|
+
f.write(text)
|
68
|
+
f.close
|
69
|
+
|
70
|
+
File.write(file_name, text)
|
71
|
+
end
|
72
|
+
end
|
73
|
+
when "server"
|
74
|
+
ENV['RACK_ENV']="development"
|
75
|
+
exec("foreman start")
|
76
|
+
when "test"
|
77
|
+
ENV['RACK_ENV']="test"
|
78
|
+
exec("foreman start")
|
79
|
+
else
|
80
|
+
puts "Please pass an argument"
|
81
|
+
puts "Your options are:"
|
82
|
+
puts " New - To create an application"
|
83
|
+
puts " Server - To run a server"
|
84
|
+
end
|
85
|
+
|
@@ -0,0 +1,67 @@
|
|
1
|
+
GEM
|
2
|
+
remote: https://rubygems.org/
|
3
|
+
specs:
|
4
|
+
coderay (1.1.0)
|
5
|
+
cuba (3.3.0)
|
6
|
+
rack
|
7
|
+
daemons (1.1.9)
|
8
|
+
dotenv (0.11.1)
|
9
|
+
dotenv-deployment (~> 0.0.2)
|
10
|
+
dotenv-deployment (0.0.2)
|
11
|
+
eventmachine (1.0.3)
|
12
|
+
faraday (0.9.0)
|
13
|
+
multipart-post (>= 1.2, < 3)
|
14
|
+
faraday_middleware (0.9.1)
|
15
|
+
faraday (>= 0.7.4, < 0.10)
|
16
|
+
foreman (0.75.0)
|
17
|
+
dotenv (~> 0.11.1)
|
18
|
+
thor (~> 0.19.1)
|
19
|
+
haml (4.0.5)
|
20
|
+
tilt
|
21
|
+
hashie (3.3.1)
|
22
|
+
kgio (2.9.2)
|
23
|
+
method_source (0.8.2)
|
24
|
+
multipart-post (2.0.0)
|
25
|
+
pry (0.10.1)
|
26
|
+
coderay (~> 1.1.0)
|
27
|
+
method_source (~> 0.8.1)
|
28
|
+
slop (~> 3.4)
|
29
|
+
rack (1.5.2)
|
30
|
+
rack-livereload (0.3.15)
|
31
|
+
rack
|
32
|
+
raindrops (0.13.0)
|
33
|
+
rb-fsevent (0.9.4)
|
34
|
+
sass (3.4.2)
|
35
|
+
shotgun (0.9)
|
36
|
+
rack (>= 1.0)
|
37
|
+
slop (3.6.0)
|
38
|
+
thin (1.6.2)
|
39
|
+
daemons (>= 1.0.9)
|
40
|
+
eventmachine (>= 1.0.0)
|
41
|
+
rack (>= 1.0.0)
|
42
|
+
thor (0.19.1)
|
43
|
+
tilt (1.4.1)
|
44
|
+
traitify (1.5.0)
|
45
|
+
faraday (~> 0.9.0)
|
46
|
+
faraday_middleware (~> 0.9.0)
|
47
|
+
hashie
|
48
|
+
unicorn (4.8.3)
|
49
|
+
kgio (~> 2.6)
|
50
|
+
rack
|
51
|
+
raindrops (~> 0.7)
|
52
|
+
|
53
|
+
PLATFORMS
|
54
|
+
ruby
|
55
|
+
|
56
|
+
DEPENDENCIES
|
57
|
+
cuba
|
58
|
+
foreman
|
59
|
+
haml
|
60
|
+
pry
|
61
|
+
rack-livereload
|
62
|
+
rb-fsevent
|
63
|
+
sass
|
64
|
+
shotgun
|
65
|
+
thin
|
66
|
+
traitify
|
67
|
+
unicorn
|
@@ -0,0 +1 @@
|
|
1
|
+
server: WEB_CONCURRENCY=16 unicorn -p $PORT -E production -c ./config/unicorn.rb
|
@@ -0,0 +1,29 @@
|
|
1
|
+
Getting Started
|
2
|
+
|
3
|
+
1. Install [node](http://nodejs.org/)
|
4
|
+
2. Install [rvm](http://rvm.io/)
|
5
|
+
3. Install ruby 2.1.2 `rvm install 2.1.2`
|
6
|
+
4. Install bundler `gem install bundler`
|
7
|
+
5. Install Embargo `gem install embargo`
|
8
|
+
6. Create your application `embargo new your-application`
|
9
|
+
7. Move into your project directory `cd your-application`
|
10
|
+
8. Start your server `embargo server`
|
11
|
+
|
12
|
+
|
13
|
+
|
14
|
+
|
15
|
+
Development Details
|
16
|
+
========
|
17
|
+
When you run `embargo server` the server is started and a [gulp task](http://github.com/traitify/homepage/frontend/gulpfile.js) is also started. This allows you to edit the files in the [assets](http://github.com/traitify/embargo/assets) directory and see your changes in the website.
|
18
|
+
|
19
|
+
The gulp task will compile your sass, image, etc. changes and move them to the public folder. The public folder is auto-generated and should not be modified. Any code you place manually in the public folder will be overwritten.
|
20
|
+
|
21
|
+
The app has live-reload enabled so when you make a change to one of the files it is watching, the browser will refresh for you automatically.
|
22
|
+
|
23
|
+
If you would like to run the app in production mode, you can do so by running:
|
24
|
+
|
25
|
+
```
|
26
|
+
foreman start -f Procfile.prod
|
27
|
+
```
|
28
|
+
|
29
|
+
View in your browser on port 5000.
|
@@ -0,0 +1,150 @@
|
|
1
|
+
// Load plugins
|
2
|
+
var gulp = require('gulp'),
|
3
|
+
coffee = require('gulp-coffee'),
|
4
|
+
gzip = require('gulp-gzip'),
|
5
|
+
sass = require('gulp-ruby-sass'),
|
6
|
+
autoprefixer = require('gulp-autoprefixer'),
|
7
|
+
minifycss = require('gulp-minify-css'),
|
8
|
+
haml = require('gulp-ruby-haml'),
|
9
|
+
uglify = require('gulp-uglify'),
|
10
|
+
uglify = require('gulp-uglify'),
|
11
|
+
imagemin = require('gulp-imagemin'),
|
12
|
+
rename = require('gulp-rename'),
|
13
|
+
concat = require('gulp-concat'),
|
14
|
+
notify = require('gulp-notify'),
|
15
|
+
cache = require('gulp-cache'),
|
16
|
+
browserSync = require('browser-sync'),
|
17
|
+
del = require('del'),
|
18
|
+
svgSprite = require("gulp-svg-sprites"),
|
19
|
+
livereload = require('gulp-livereload'),
|
20
|
+
gutil = require('gulp-util');
|
21
|
+
|
22
|
+
// Paths
|
23
|
+
var paths = {
|
24
|
+
haml: ['./../views/*.haml'],
|
25
|
+
scss: ['./src/scss/styles.scss', './src/scss/secondary.scss'],
|
26
|
+
coffee: ['./src/coffee/**/*.coffee'],
|
27
|
+
js: ['./src/js/**/*.js'],
|
28
|
+
img: ['./src/img/**/*.{png,svg,jpg,jpeg,gif}'],
|
29
|
+
extras: ['./src/*.*','./src/.htaccess'],
|
30
|
+
fonts: ['./src/scss/fonts.css'],
|
31
|
+
libs: ['./src/js/vendor/**/*.js'],
|
32
|
+
dist: {
|
33
|
+
css: './../public/css/',
|
34
|
+
coffee: './src/js/',
|
35
|
+
js: './../public/js/',
|
36
|
+
img: './../public/img/',
|
37
|
+
extras: './../public/',
|
38
|
+
fonts: './../public/css/',
|
39
|
+
libs: './../public/js/'
|
40
|
+
}
|
41
|
+
};
|
42
|
+
|
43
|
+
// Styles
|
44
|
+
gulp.task('styles', function() {
|
45
|
+
return gulp.src(paths.scss)
|
46
|
+
.pipe(sass({ style: 'expanded', }))
|
47
|
+
.pipe(autoprefixer('last 2 version', 'safari 5', 'ie 8', 'ie 9', 'opera 12.1', 'ios 6', 'android 4'))
|
48
|
+
.pipe(gulp.dest(paths.dist.css))
|
49
|
+
.pipe(rename({ suffix: '.min' }))
|
50
|
+
.pipe(minifycss())
|
51
|
+
.pipe(gulp.dest(paths.dist.css))
|
52
|
+
.pipe(gzip())
|
53
|
+
.pipe(gulp.dest(paths.dist.css))
|
54
|
+
.pipe(notify({ message: 'Styles task complete' }))
|
55
|
+
.pipe(livereload());
|
56
|
+
});
|
57
|
+
|
58
|
+
// Scripts
|
59
|
+
gulp.task('coffee', function() {
|
60
|
+
var c = coffee({bare: true});
|
61
|
+
c.on('error', function(e){
|
62
|
+
gutil.log(e);
|
63
|
+
c.end();
|
64
|
+
});
|
65
|
+
return gulp.src(paths.coffee)
|
66
|
+
.pipe(c)
|
67
|
+
.pipe(gulp.dest(paths.dist.coffee));
|
68
|
+
});
|
69
|
+
|
70
|
+
gulp.task('scripts', ['coffee'], function() {
|
71
|
+
return gulp.src(paths.js)
|
72
|
+
.pipe(concat('scripts.js'))
|
73
|
+
.pipe(gulp.dest(paths.dist.js))
|
74
|
+
.pipe(rename({ suffix: '.min' }))
|
75
|
+
.pipe(uglify())
|
76
|
+
.pipe(gulp.dest(paths.dist.js))
|
77
|
+
.pipe(gzip())
|
78
|
+
.pipe(gulp.dest(paths.dist.js))
|
79
|
+
.pipe(notify({ message: 'Scripts task complete' }))
|
80
|
+
.pipe(livereload());
|
81
|
+
});
|
82
|
+
|
83
|
+
// Images
|
84
|
+
gulp.task('images', function() {
|
85
|
+
return gulp.src(paths.img)
|
86
|
+
.pipe(cache(imagemin({ optimizationLevel: 5, interlaced: true })))
|
87
|
+
.pipe(gulp.dest(paths.dist.img))
|
88
|
+
.pipe(gzip())
|
89
|
+
.pipe(gulp.dest(paths.dist.img))
|
90
|
+
.pipe(notify({ message: 'Images task complete' }))
|
91
|
+
.pipe(livereload());
|
92
|
+
});
|
93
|
+
|
94
|
+
// SVG Sprites
|
95
|
+
gulp.task('sprites', function () {
|
96
|
+
return gulp.src('./src/img/*.svg')
|
97
|
+
.pipe(svgSprite())
|
98
|
+
.pipe(gulp.dest(paths.dist.img))
|
99
|
+
.pipe(livereload());
|
100
|
+
});
|
101
|
+
|
102
|
+
// Extras
|
103
|
+
gulp.task('extras', function() {
|
104
|
+
return gulp.src(paths.extras)
|
105
|
+
.pipe(gulp.dest(paths.dist.extras))
|
106
|
+
.pipe(livereload());
|
107
|
+
});
|
108
|
+
|
109
|
+
// Fonts
|
110
|
+
gulp.task('fonts', function() {
|
111
|
+
return gulp.src(paths.fonts)
|
112
|
+
.pipe(gulp.dest(paths.dist.fonts))
|
113
|
+
.pipe(livereload());
|
114
|
+
});
|
115
|
+
|
116
|
+
gulp.task('haml', function() {
|
117
|
+
return gulp.src(paths.haml)
|
118
|
+
.pipe(livereload());
|
119
|
+
});
|
120
|
+
|
121
|
+
// Delete the dist directory and start fresh
|
122
|
+
gulp.task('clean', function(cb) {
|
123
|
+
cache.clearAll(del(['./../public'], {force: true}, cb));
|
124
|
+
});
|
125
|
+
|
126
|
+
// Default task
|
127
|
+
gulp.task('default', ['clean'], function() {
|
128
|
+
gulp.start('styles', 'scripts', 'images', 'extras', 'fonts', 'watch');
|
129
|
+
});
|
130
|
+
|
131
|
+
// Watch
|
132
|
+
gulp.task('watch', function() {
|
133
|
+
livereload.listen();
|
134
|
+
// Watch .scss files
|
135
|
+
gulp.watch('./src/scss/**/*.scss', ['styles']);
|
136
|
+
// Watch .coffee files
|
137
|
+
gulp.watch(paths.coffee, ['scripts']);
|
138
|
+
// Watch .js files
|
139
|
+
gulp.watch(paths.js, ['scripts']);
|
140
|
+
// Watch image files
|
141
|
+
gulp.watch(paths.img, ['images']);
|
142
|
+
// Watch extra files
|
143
|
+
gulp.watch(paths.extras, ['extras']);
|
144
|
+
gulp.watch(paths.fonts, ['fonts']);
|
145
|
+
|
146
|
+
gulp.watch(paths.haml, ['haml']);
|
147
|
+
|
148
|
+
// Watch any files in dist/, reload on change
|
149
|
+
//gulp.watch(['./dist']).on('change', browserSync.reload);
|
150
|
+
});
|
@@ -0,0 +1,31 @@
|
|
1
|
+
{
|
2
|
+
"name": "katie-harron-boilerplate",
|
3
|
+
"version": "1.0.0",
|
4
|
+
"description": "Boilerplate for projects with SCSS, JS, images",
|
5
|
+
"main": "index.js",
|
6
|
+
"scripts": {
|
7
|
+
"start": "gulp"
|
8
|
+
},
|
9
|
+
"author": "Katie Harron",
|
10
|
+
"license": "BSD-2-Clause",
|
11
|
+
"devDependencies": {
|
12
|
+
"browser-sync": "^1.5.7",
|
13
|
+
"del": "^0.1.3",
|
14
|
+
"gulp": "~3.8.8",
|
15
|
+
"gulp-autoprefixer": "~1.0.1",
|
16
|
+
"gulp-cache": "~0.2.2",
|
17
|
+
"gulp-coffee": "~2.2.0",
|
18
|
+
"gulp-concat": "~2.4.1",
|
19
|
+
"gulp-gzip": "~0.0.8",
|
20
|
+
"gulp-imagemin": "~1.0.1",
|
21
|
+
"gulp-livereload": "~2.1.0",
|
22
|
+
"gulp-minify-css": "~0.3.10",
|
23
|
+
"gulp-notify": "~1.8.0",
|
24
|
+
"gulp-rename": "~1.2.0",
|
25
|
+
"gulp-ruby-haml": "0.0.3",
|
26
|
+
"gulp-ruby-sass": "~0.7.1",
|
27
|
+
"gulp-svg-sprites": "^1.0.3",
|
28
|
+
"gulp-uglify": "~1.0.1",
|
29
|
+
"gulp-util": "~3.0.1"
|
30
|
+
}
|
31
|
+
}
|
Binary file
|
Binary file
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# humanstxt.org/
|
2
|
+
# The humans responsible & technology colophon
|
3
|
+
|
4
|
+
# TEAM
|
5
|
+
|
6
|
+
Traitify -- http://www.traitify.com
|
7
|
+
|
8
|
+
Katie Harron -- Front-End Web Developer
|
9
|
+
-- http://dev.pibby.com/about/
|
10
|
+
|
11
|
+
|
12
|
+
# TECHNOLOGY COLOPHON
|
13
|
+
|
14
|
+
HTML5, CSS3, Sass, Gulp
|
File without changes
|
Binary file
|
Binary file
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# humanstxt.org/
|
2
|
+
# The humans responsible & technology colophon
|
3
|
+
|
4
|
+
# TEAM
|
5
|
+
|
6
|
+
Traitify -- http://www.traitify.com
|
7
|
+
|
8
|
+
Katie Harron -- Front-End Web Developer
|
9
|
+
-- http://dev.pibby.com/about/
|
10
|
+
|
11
|
+
|
12
|
+
# TECHNOLOGY COLOPHON
|
13
|
+
|
14
|
+
HTML5, CSS3, Sass, Gulp
|
@@ -0,0 +1,16 @@
|
|
1
|
+
!!! 5
|
2
|
+
%html(lang="en")
|
3
|
+
%head
|
4
|
+
%meta(charset="utf-8")
|
5
|
+
%meta(http-equiv="X-UA-Compatible" content="IE=edge")
|
6
|
+
|
7
|
+
- if content_for :title
|
8
|
+
= content_for :title
|
9
|
+
- else
|
10
|
+
%title Here is the title
|
11
|
+
%body{class: body_class}
|
12
|
+
= partial("partials/_nav-homepage")
|
13
|
+
|
14
|
+
= content
|
15
|
+
|
16
|
+
= partial("partials/_footer")
|
File without changes
|
@@ -0,0 +1,14 @@
|
|
1
|
+
%header.header(role="banner")
|
2
|
+
.wrapper
|
3
|
+
.row
|
4
|
+
.header__icon
|
5
|
+
%div
|
6
|
+
%svg(version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" preserveAspectRatio="none")
|
7
|
+
%circle(cx="8" cy="8" r="6.24" transform="rotate(90 8 8)")
|
8
|
+
|
9
|
+
%nav.header__nav
|
10
|
+
%ul
|
11
|
+
%li
|
12
|
+
%a(href="#page" title="How It Works") how it works?
|
13
|
+
%li
|
14
|
+
%a(href="mailto:support@yoursite.com" title="Contact") contact
|
data/lib/config/init.rb
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
if ENV['RACK_ENV']
|
2
|
+
Embargo.require_file("environments/#{ENV['RACK_ENV']}.rb")
|
3
|
+
end
|
4
|
+
|
5
|
+
Encoding.default_external = "UTF-8"
|
6
|
+
|
7
|
+
Cuba.use Rack::Deflater
|
8
|
+
Cuba.use Rack::Static, root: "public", urls: ["/css","/js","/img"]
|
9
|
+
|
10
|
+
Cuba.plugin(Cuba::Render)
|
11
|
+
|
12
|
+
Cuba.settings[:render][:template_engine] = "haml"
|
13
|
+
|
14
|
+
Embargo.require_file('local_variables.rb')
|
@@ -0,0 +1,16 @@
|
|
1
|
+
worker_processes Integer(ENV["WEB_CONCURRENCY"] || 4)
|
2
|
+
timeout 15
|
3
|
+
preload_app true
|
4
|
+
|
5
|
+
before_fork do |server, worker|
|
6
|
+
Signal.trap 'TERM' do
|
7
|
+
puts 'Unicorn master intercepting TERM and sending myself QUIT instead'
|
8
|
+
Process.kill 'QUIT', Process.pid
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
after_fork do |server, worker|
|
13
|
+
Signal.trap 'TERM' do
|
14
|
+
puts 'Unicorn worker intercepting TERM and doing nothing. Wait for master to send QUIT'
|
15
|
+
end
|
16
|
+
end
|
data/lib/content_for.rb
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
class Cuba
|
2
|
+
module Render
|
3
|
+
def content_for(key, &block)
|
4
|
+
if block
|
5
|
+
@_content_for ||= {}
|
6
|
+
buf_was = @haml_buffer.buffer
|
7
|
+
@haml_buffer.buffer = ''
|
8
|
+
yield
|
9
|
+
@_content_for[key] = @haml_buffer.buffer
|
10
|
+
@haml_buffer.buffer = buf_was
|
11
|
+
elsif @_content_for
|
12
|
+
@_content_for[key]
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
data/lib/embargo.rb
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
require 'cuba'
|
2
|
+
require 'cuba/render'
|
3
|
+
require 'tilt/haml'
|
4
|
+
require 'haml'
|
5
|
+
|
6
|
+
class Embargo
|
7
|
+
def self.application
|
8
|
+
Cuba
|
9
|
+
end
|
10
|
+
|
11
|
+
def self.app_directory
|
12
|
+
@@magis_working_directory ||= Dir.pwd
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.directory
|
16
|
+
@@magis_directory ||= __FILE__
|
17
|
+
end
|
18
|
+
|
19
|
+
def self.require_file(file_name)
|
20
|
+
project_file_name = Embargo.app_directory + "/" + file_name
|
21
|
+
project_file_exists = File.exist?(project_file_name)
|
22
|
+
|
23
|
+
magis_file_name = Embargo.directory + "/" + file_name
|
24
|
+
magis_file_exists = File.exist?(magis_file_name)
|
25
|
+
|
26
|
+
if project_file_exists
|
27
|
+
require home_file_name
|
28
|
+
elsif magis_file_exists
|
29
|
+
require magis_file_name
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
Embargo.require_file 'config/init.rb'
|
35
|
+
Embargo.require_file 'lib/content_for.rb'
|
36
|
+
|
37
|
+
|
38
|
+
Cuba.define do
|
39
|
+
on get do
|
40
|
+
on root do
|
41
|
+
res.write("home")
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
Dir[Embargo.app_directory+"/api/*.rb"].each {|file| require file }
|
47
|
+
|
48
|
+
Dir[Embargo.app_directory+"/models/*.rb"].each {|file| require file }
|
metadata
ADDED
@@ -0,0 +1,247 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: embargo
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Eric Fleming
|
8
|
+
- Carson Wright
|
9
|
+
- Katie Harron
|
10
|
+
autorequire:
|
11
|
+
bindir: bin
|
12
|
+
cert_chain: []
|
13
|
+
date: 2014-12-12 00:00:00.000000000 Z
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: activesupport-inflector
|
17
|
+
requirement: !ruby/object:Gem::Requirement
|
18
|
+
requirements:
|
19
|
+
- - ">="
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
requirements:
|
26
|
+
- - ">="
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
version: '0'
|
29
|
+
- !ruby/object:Gem::Dependency
|
30
|
+
name: i18n
|
31
|
+
requirement: !ruby/object:Gem::Requirement
|
32
|
+
requirements:
|
33
|
+
- - ">="
|
34
|
+
- !ruby/object:Gem::Version
|
35
|
+
version: '0'
|
36
|
+
type: :runtime
|
37
|
+
prerelease: false
|
38
|
+
version_requirements: !ruby/object:Gem::Requirement
|
39
|
+
requirements:
|
40
|
+
- - ">="
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: '0'
|
43
|
+
- !ruby/object:Gem::Dependency
|
44
|
+
name: cuba
|
45
|
+
requirement: !ruby/object:Gem::Requirement
|
46
|
+
requirements:
|
47
|
+
- - ">="
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: '0'
|
50
|
+
type: :runtime
|
51
|
+
prerelease: false
|
52
|
+
version_requirements: !ruby/object:Gem::Requirement
|
53
|
+
requirements:
|
54
|
+
- - ">="
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: '0'
|
57
|
+
- !ruby/object:Gem::Dependency
|
58
|
+
name: foreman
|
59
|
+
requirement: !ruby/object:Gem::Requirement
|
60
|
+
requirements:
|
61
|
+
- - ">="
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
version: '0'
|
64
|
+
type: :runtime
|
65
|
+
prerelease: false
|
66
|
+
version_requirements: !ruby/object:Gem::Requirement
|
67
|
+
requirements:
|
68
|
+
- - ">="
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: '0'
|
71
|
+
- !ruby/object:Gem::Dependency
|
72
|
+
name: haml
|
73
|
+
requirement: !ruby/object:Gem::Requirement
|
74
|
+
requirements:
|
75
|
+
- - ">="
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
78
|
+
type: :runtime
|
79
|
+
prerelease: false
|
80
|
+
version_requirements: !ruby/object:Gem::Requirement
|
81
|
+
requirements:
|
82
|
+
- - ">="
|
83
|
+
- !ruby/object:Gem::Version
|
84
|
+
version: '0'
|
85
|
+
- !ruby/object:Gem::Dependency
|
86
|
+
name: sass
|
87
|
+
requirement: !ruby/object:Gem::Requirement
|
88
|
+
requirements:
|
89
|
+
- - ">="
|
90
|
+
- !ruby/object:Gem::Version
|
91
|
+
version: '0'
|
92
|
+
type: :runtime
|
93
|
+
prerelease: false
|
94
|
+
version_requirements: !ruby/object:Gem::Requirement
|
95
|
+
requirements:
|
96
|
+
- - ">="
|
97
|
+
- !ruby/object:Gem::Version
|
98
|
+
version: '0'
|
99
|
+
- !ruby/object:Gem::Dependency
|
100
|
+
name: unicorn
|
101
|
+
requirement: !ruby/object:Gem::Requirement
|
102
|
+
requirements:
|
103
|
+
- - ">="
|
104
|
+
- !ruby/object:Gem::Version
|
105
|
+
version: '0'
|
106
|
+
type: :runtime
|
107
|
+
prerelease: false
|
108
|
+
version_requirements: !ruby/object:Gem::Requirement
|
109
|
+
requirements:
|
110
|
+
- - ">="
|
111
|
+
- !ruby/object:Gem::Version
|
112
|
+
version: '0'
|
113
|
+
- !ruby/object:Gem::Dependency
|
114
|
+
name: pry
|
115
|
+
requirement: !ruby/object:Gem::Requirement
|
116
|
+
requirements:
|
117
|
+
- - ">="
|
118
|
+
- !ruby/object:Gem::Version
|
119
|
+
version: '0'
|
120
|
+
type: :development
|
121
|
+
prerelease: false
|
122
|
+
version_requirements: !ruby/object:Gem::Requirement
|
123
|
+
requirements:
|
124
|
+
- - ">="
|
125
|
+
- !ruby/object:Gem::Version
|
126
|
+
version: '0'
|
127
|
+
- !ruby/object:Gem::Dependency
|
128
|
+
name: rb-fsevent
|
129
|
+
requirement: !ruby/object:Gem::Requirement
|
130
|
+
requirements:
|
131
|
+
- - ">="
|
132
|
+
- !ruby/object:Gem::Version
|
133
|
+
version: '0'
|
134
|
+
type: :runtime
|
135
|
+
prerelease: false
|
136
|
+
version_requirements: !ruby/object:Gem::Requirement
|
137
|
+
requirements:
|
138
|
+
- - ">="
|
139
|
+
- !ruby/object:Gem::Version
|
140
|
+
version: '0'
|
141
|
+
- !ruby/object:Gem::Dependency
|
142
|
+
name: shotgun
|
143
|
+
requirement: !ruby/object:Gem::Requirement
|
144
|
+
requirements:
|
145
|
+
- - ">="
|
146
|
+
- !ruby/object:Gem::Version
|
147
|
+
version: '0'
|
148
|
+
type: :runtime
|
149
|
+
prerelease: false
|
150
|
+
version_requirements: !ruby/object:Gem::Requirement
|
151
|
+
requirements:
|
152
|
+
- - ">="
|
153
|
+
- !ruby/object:Gem::Version
|
154
|
+
version: '0'
|
155
|
+
- !ruby/object:Gem::Dependency
|
156
|
+
name: thin
|
157
|
+
requirement: !ruby/object:Gem::Requirement
|
158
|
+
requirements:
|
159
|
+
- - ">="
|
160
|
+
- !ruby/object:Gem::Version
|
161
|
+
version: '0'
|
162
|
+
type: :runtime
|
163
|
+
prerelease: false
|
164
|
+
version_requirements: !ruby/object:Gem::Requirement
|
165
|
+
requirements:
|
166
|
+
- - ">="
|
167
|
+
- !ruby/object:Gem::Version
|
168
|
+
version: '0'
|
169
|
+
- !ruby/object:Gem::Dependency
|
170
|
+
name: rack-livereload
|
171
|
+
requirement: !ruby/object:Gem::Requirement
|
172
|
+
requirements:
|
173
|
+
- - ">="
|
174
|
+
- !ruby/object:Gem::Version
|
175
|
+
version: '0'
|
176
|
+
type: :runtime
|
177
|
+
prerelease: false
|
178
|
+
version_requirements: !ruby/object:Gem::Requirement
|
179
|
+
requirements:
|
180
|
+
- - ">="
|
181
|
+
- !ruby/object:Gem::Version
|
182
|
+
version: '0'
|
183
|
+
description: Embargo framework!
|
184
|
+
email:
|
185
|
+
- eric@traitify.com
|
186
|
+
- carson@traitify.com
|
187
|
+
- "@traitify.com"
|
188
|
+
executables:
|
189
|
+
- embargo
|
190
|
+
extensions: []
|
191
|
+
extra_rdoc_files: []
|
192
|
+
files:
|
193
|
+
- README.md
|
194
|
+
- Rakefile
|
195
|
+
- bin/embargo
|
196
|
+
- boilerplate/project/Gemfile
|
197
|
+
- boilerplate/project/Gemfile.lock
|
198
|
+
- boilerplate/project/Procfile
|
199
|
+
- boilerplate/project/Procfile.prod
|
200
|
+
- boilerplate/project/README.md
|
201
|
+
- boilerplate/project/assets/gulpfile.js
|
202
|
+
- boilerplate/project/assets/package.json
|
203
|
+
- boilerplate/project/assets/src/apple-touch-icon-precomposed.png
|
204
|
+
- boilerplate/project/assets/src/coffee/_site_init.coffee
|
205
|
+
- boilerplate/project/assets/src/favicon.ico
|
206
|
+
- boilerplate/project/assets/src/humans.txt
|
207
|
+
- boilerplate/project/assets/src/robots.txt
|
208
|
+
- boilerplate/project/config.ru
|
209
|
+
- boilerplate/project/config/local_variables.rb
|
210
|
+
- boilerplate/project/public/apple-touch-icon-precomposed.png
|
211
|
+
- boilerplate/project/public/favicon.ico
|
212
|
+
- boilerplate/project/public/humans.txt
|
213
|
+
- boilerplate/project/public/robots.txt
|
214
|
+
- boilerplate/project/views/index.haml
|
215
|
+
- boilerplate/project/views/layout.haml
|
216
|
+
- boilerplate/project/views/partials/_footer.haml
|
217
|
+
- boilerplate/project/views/partials/_nav-homepage.haml
|
218
|
+
- lib/config/environments/development.rb
|
219
|
+
- lib/config/init.rb
|
220
|
+
- lib/config/unicorn.rb
|
221
|
+
- lib/content_for.rb
|
222
|
+
- lib/embargo.rb
|
223
|
+
homepage: https://rubygems.org/gems/embargo
|
224
|
+
licenses:
|
225
|
+
- MIT
|
226
|
+
metadata: {}
|
227
|
+
post_install_message:
|
228
|
+
rdoc_options: []
|
229
|
+
require_paths:
|
230
|
+
- lib
|
231
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
232
|
+
requirements:
|
233
|
+
- - ">="
|
234
|
+
- !ruby/object:Gem::Version
|
235
|
+
version: 2.1.2
|
236
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
237
|
+
requirements:
|
238
|
+
- - ">="
|
239
|
+
- !ruby/object:Gem::Version
|
240
|
+
version: '0'
|
241
|
+
requirements: []
|
242
|
+
rubyforge_project:
|
243
|
+
rubygems_version: 2.2.2
|
244
|
+
signing_key:
|
245
|
+
specification_version: 4
|
246
|
+
summary: Embargo
|
247
|
+
test_files: []
|