Skip to content
This repository has been archived by the owner on Apr 23, 2019. It is now read-only.

Feature/gzip support #158

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Feature/gzip support #158

wants to merge 7 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Jan 15, 2015

@@ -7,3 +7,11 @@
end

end

describe file('/etc/nginx/sites-available/intercity_sample_app.conf') do

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

gzip_static on;
expires max;
add_header Cache-Control public;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpicking here, but the } is not placed correctly yet ;)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, I've got some issues with rendering partials, the first line is always shifted 2 spaces right

@michiels
Copy link
Member

@oiuzikov Looks good! The only thing I'm missing is an option to enable/disable gzipped assets. So in the node JSON configuration we would want an option to enable it.

@ghost
Copy link
Author

ghost commented Jan 16, 2015

@michiels what would be the default option?

@michiels
Copy link
Member

@oiuzikov i think disable it, because you need to do some rails configuring to make static gzip work so most people have it disabled by default

@@ -53,7 +53,8 @@
"username": "<db username, max 10 characters>",
"password": "<enter a random password>",
"database": "<appname>_<stage>"
}
},
"gzip_enabled": true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it be better to have the sample default to false? Since people do have to perform some task on their rails apps to make this work

describe file("/etc/nginx/sites-available/intercity_sample_app.conf") do
it { should be_file }

its(:content) do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you but a context block around this? so it tells a bit more about what you're testing. So you get something like:

describe file("/etc/nginx/sites-available/intercity_sample_app.conf") do
  it { should be_file }

  context "GZip support enabled" do
    its(:content) do
      should match /location ~ \^\/\(assets\)\/.*gzip_static on;/m
    end
  end
end

@ghost ghost added this to the 2.4.0 milestone Feb 2, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants