Skip to content

Commit 3a2c27b

Browse files
committed
Production "ready" environment.
1 parent 0d58bd8 commit 3a2c27b

File tree

7 files changed

+34
-15
lines changed

7 files changed

+34
-15
lines changed

Diff for: .env-sample

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
###
2+
# Archivo con variables de entorno.
3+
###
4+
ENV=production

Diff for: .gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
.env
12
_site
23
.DS_Store
34
.sass-cache/

Diff for: .ruby-version

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2.0.0-p247

Diff for: Gemfile

+1
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ gem 'compass', '~> 0.12.2'
66
gem 'liquid', '~> 2.5.3'
77
gem 'maruku', '~> 0.7.0'
88
gem 'redcarpet', '~> 2.3.0'
9+
gem 'dotenv', '~> 0.9.0'

Diff for: Gemfile.lock

+2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ GEM
1919
fssm (>= 0.2.7)
2020
sass (~> 3.1)
2121
directory_watcher (1.4.1)
22+
dotenv (0.9.0)
2223
fast-stemmer (1.0.2)
2324
fssm (0.2.10)
2425
highline (1.6.19)
@@ -49,6 +50,7 @@ PLATFORMS
4950
DEPENDENCIES
5051
bootstrap-sass (~> 3.0.0.0)!
5152
compass (~> 0.12.2)
53+
dotenv (~> 0.9.0)
5254
jekyll (~> 1.2.1)
5355
liquid (~> 2.5.3)
5456
maruku (~> 0.7.0)

Diff for: Rakefile

+19-11
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,25 @@
1+
require 'dotenv/tasks'
12
# Rubygems compile rake task.
23
desc "compile and run the site"
3-
task :server do
4-
pids = [
5-
spawn("jekyll serve --watch --drafts"),
6-
spawn("bundle exec compass watch")
7-
]
4+
task :server => :dotenv do
5+
env = ENV['ENV'] || "development"
6+
if env.eql? "production"
7+
system %Q{bundle exec compass compile}
8+
sleep(3)
9+
system %Q{jekyll build}
10+
else
11+
pids = [
12+
spawn("jekyll serve --watch --drafts"),
13+
spawn("bundle exec compass watch")
14+
]
815

9-
trap "INT" do
10-
Process.kill 0, *pids
11-
exit 0
12-
end
16+
trap "INT" do
17+
Process.kill 0, *pids
18+
exit 0
19+
end
1320

14-
loop do
15-
sleep 1
21+
loop do
22+
sleep 1
23+
end
1624
end
1725
end

Diff for: config.rb

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
require 'bootstrap-sass'
2+
require 'dotenv'
3+
Dotenv.load
24

5+
environment = ENV['ENV'].to_sym || :development
6+
project_type = :stand_alone
7+
relative_assets = true
8+
output_style = (environment.eql? :production) ? :compressed : :expanded
39
css_dir = "assets/stylesheets/"
410
sass_dir = css_dir
511
javascripts_dir = "assets/javascript/"
612
images_dir = "assets/images/"
713
fonts_dir = "assets/fonts/"
8-
project_type = :stand_alone
9-
environment = :development
10-
output_style = :compressed
11-
relative_assets = true

0 commit comments

Comments
 (0)