rails_12factor 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a2c21639f4ac7dee459a542944ceedd99e89b71f
4
- data.tar.gz: 92010a998269ab120ced4cdc6b0214e240eaf1ce
3
+ metadata.gz: 57f5cf55fb8be3fa5bede1513b57c930fcdebf32
4
+ data.tar.gz: 487d7dbcf732d85a2f8cf670178edd4f0c982059
5
5
  SHA512:
6
- metadata.gz: a2bb874ff19b97341b568d5fa248cc90ec065e09ebb253fa204bee316f55cebe42d14e323f9e5b4783e6885933ece7b25c297dd5360572fadfa696b6e91d076b
7
- data.tar.gz: d16f99f2632dc5493a00e5933a5364bf6392ffb8ca155393fca097cf9dbca0f00e99353aa0aec2ae047c33e60ffaea095a2ded16f432efa57f78e7d3eb56c04f
6
+ metadata.gz: 8b2476a19085e0c14b401b402d69b790b4614207b5863915879c10a4533afff1fa1a5643095473c4241328cf7a6b82b74a07588ed67fb3fce9f7564a2e94f612
7
+ data.tar.gz: c2b9b1cc368b289e738bb5a4f08251e7df298d4fe0a9d86db319f4586069c4e9d247c8e4e2c7e82a2b991590a595f9e9d0813b429c2e613cc6ab056636f476e8
@@ -0,0 +1,6 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.0.0
4
+ - 1.9.3
5
+ - 1.9.2
6
+ - 1.8.7
data/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- Copyright (c) 2013, Heroku
2
- All rights reserved.
1
+ The MIT License (MIT)
3
2
 
4
- Redistribution and use in source and binary forms, with or without
5
- modification, are permitted provided that the following conditions are met:
6
- * Redistributions of source code must retain the above copyright
7
- notice, this list of conditions and the following disclaimer.
8
- * Redistributions in binary form must reproduce the above copyright
9
- notice, this list of conditions and the following disclaimer in the
10
- documentation and/or other materials provided with the distribution.
3
+ Copyright (c) 2013,2014 Heroku
11
4
 
12
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
13
- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
15
- DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
16
- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
17
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
18
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
20
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
21
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md CHANGED
@@ -1,12 +1,12 @@
1
- # Rails 12factor
1
+ # Rails 12factor [![Build Status](https://travis-ci.org/heroku/rails_12factor.png)](https://travis-ci.org/heroku/rails_12factor)
2
2
 
3
- Makes running your Rails app easier. Based on the ideas behind [12factor.net](http://twelve-factor.net)
3
+ Makes running your Rails app easier. Based on the ideas behind [12factor.net](http://12factor.net)
4
4
 
5
5
  ## What
6
6
 
7
- Rails gets a lot right when it comes to twelve-factor apps, but it could still be better. The two biggest areas right now is that in production [logs should be directed to stdout](http://www.twelve-factor.net/logs) and [dev/prod parity](http://www.twelve-factor.net/dev-prod-parity) while delivering assets.
7
+ Rails gets a lot right when it comes to twelve-factor apps, but it could still be better. The two biggest areas right now are that in production [logs should be directed to stdout](http://www.12factor.net/logs) and [dev/prod parity](http://www.12factor.net/dev-prod-parity) while delivering assets.
8
8
 
9
- This gem enables serving assets in production and setting your logger to standard out, both of which are required for to run a Rails 4 application on a twelve-factor provider.
9
+ This gem enables serving assets in production and setting your logger to standard out, both of which are required to run a Rails 4 application on a twelve-factor provider. The gem also makes the appropriate changes for Rails 3 apps.
10
10
 
11
11
  ## Install
12
12
 
@@ -26,24 +26,24 @@ Now you're good to go.
26
26
 
27
27
  ## How
28
28
 
29
- This gem adds two other gems `rails_serve_static_assets` and `rails_stdout_logging`. These gems are required to run your Rails app with both logging aggregation and static assets serving in production. All you need to do to get the functionality of both gems is to add the `rails_twelve-factor` gem to your project. Here is how they work:
29
+ This gem adds two other gems `rails_serve_static_assets` and `rails_stdout_logging`. These gems are required to run your Rails app with both logging aggregation and static assets serving in production. All you need to do to get the functionality of both gems is to add the `rails_12factor` gem to your project. Here is how they work:
30
30
 
31
31
  ## Rails 4 Logging
32
32
 
33
33
  By default Rails writes its logs to a specific file, which is convenient if you only have one log file to tail. When you start scaling to multiple instances running your app, finding a single request or failure across multiple files becomes much harder. Storing logs on disk can also take down a server if the hard drive fills up. Because of these limitations, every Rails core member we’ve talked to uses a custom logger to replace Rail's default functionality. By using the `rails_stdout_logging` gem, the logger is set for you.
34
34
 
35
- The gem `rails_stdout_logging` ensures that your logs will be sent to standard out, and from there the twelve-factor platform can send them to a log aggregation service ( like [logplex](https://github.com/heroku/logplex) on Heroku, or [Papertrail](https://papertrailapp.com)) so you can access them from one place. By using stdout instead of files, you can [treat logs as event streams](http://www.twelve-factor.net/logs).
35
+ The gem `rails_stdout_logging` ensures that your logs will be sent to standard out, and from there the twelve-factor platform can send them to a log aggregation service ( like [logplex](https://github.com/heroku/logplex) on Heroku, or [Papertrail](https://papertrailapp.com)) so you can access them from one place. By using stdout instead of files, you can [treat logs as event streams](http://www.12factor.net/logs).
36
36
 
37
37
 
38
38
  ## Rails 4 Serve Static Assets
39
39
 
40
40
  In the default Rails development environment assets are served through a middleware called [sprockets](https://github.com/sstephenson/sprockets). In production however most one-off Rails deployments will put their ruby server behind a reverse HTTP proxy server such as Nginx, which can then load balance the app and serve static files directly. When Nginx sees a request for an asset such as `/assets/rails.png` it will grab it from disk at `/public/assets/rails.png` and serve it. The Rails server will never see these requests.
41
41
 
42
- On a twelve-factor platform, Nginx is typically not required to run your application. Your app should be capable of handling requests directly, or through a [routing layer](https://devcenter.heroku.com/articles/http-routing) that may handles load balancing while you scale out horizontally. Note that the caching behavior of Nginx is not needed if your application is serving static assets through an [edge caching CDN](https://en.wikipedia.org/wiki/Content_delivery_network), which is generally recommended.
42
+ On a twelve-factor platform, Nginx is typically not required to run your application. Your app should be capable of handling requests directly, or through a [routing layer](https://devcenter.heroku.com/articles/http-routing) that may handle load balancing while you scale out horizontally. Note that the caching behavior of Nginx is not needed if your application is serving static assets through an [edge caching CDN](https://en.wikipedia.org/wiki/Content_delivery_network), which is generally recommended.
43
43
 
44
44
  By default Rails 4 will return a 404 if an asset is not handled via an external proxy such as Nginx. While this default behavior may help you debug your Nginx configuration, it makes a default Rails app with assets unusable on a twelve-factor platform. To fix this we've released a gem: `rails_serve_static_assets`.
45
45
 
46
- The `rails_serve_static_assets` gem enables your Rails server to deliver your assets directly, instead of returning a 404. You can use this to populate an edge cache CDN, or serve files directly from your web app. This gives your app total control, allowing you to do things like redirects or setting headers in your Ruby code. The gem achives this behavior in your app by simply setting a single configuration option, `config.serve_static_assets = true`. By using the `rails_serve_static_assets` gem, you do not need to set this configuration manually.
46
+ The `rails_serve_static_assets` gem enables your Rails server to deliver your assets directly, instead of returning a 404. You can use this to populate an edge cache CDN, or serve files directly from your web app. This gives your app total control, allowing you to do things like redirects or setting headers in your Ruby code. The gem achieves this behavior in your app by simply setting a single configuration option, `config.serve_static_assets = true`. By using the `rails_serve_static_assets` gem, you do not need to set this configuration manually.
47
47
 
48
48
 
49
49
 
data/Rakefile CHANGED
@@ -1,2 +1,11 @@
1
1
  #!/usr/bin/env rake
2
2
  require "bundler/gem_tasks"
3
+
4
+ require "rake/testtask"
5
+ Rake::TestTask.new do |t|
6
+ t.libs << 'test'
7
+ t.verbose = true
8
+ end
9
+
10
+ # In Soviet Travis CI default task runs you!
11
+ task :default => :test
@@ -1,3 +1,3 @@
1
1
  module Rails12factor
2
- VERSION = "0.0.2"
3
- end
2
+ VERSION = "0.0.3"
3
+ end
@@ -14,8 +14,10 @@ Gem::Specification.new do |gem|
14
14
  gem.name = "rails_12factor"
15
15
  gem.require_paths = ["lib"]
16
16
  gem.version = Rails12factor::VERSION
17
- gem.license = 'LICENSE'
17
+ gem.licenses = ['MIT']
18
18
 
19
+ gem.add_development_dependency "minitest"
20
+ gem.add_development_dependency "rake"
19
21
  gem.add_dependency "rails_serve_static_assets"
20
22
  gem.add_dependency "rails_stdout_logging"
21
23
  end
@@ -0,0 +1,5 @@
1
+ $:.unshift File.expand_path '../../lib', __FILE__
2
+
3
+ gem 'minitest'
4
+ require 'minitest/autorun'
5
+ require 'minitest/pride'
@@ -0,0 +1,11 @@
1
+ require 'helper'
2
+
3
+ class TestRails12factor < Minitest::Test
4
+ def test_gem_dependencies_are_loaded
5
+ assert !defined?(RailsServeStaticAssets)
6
+ assert !defined?(RailsStdoutLogging)
7
+ require 'rails_12factor'
8
+ assert defined?(RailsServeStaticAssets)
9
+ assert defined?(RailsStdoutLogging)
10
+ end
11
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_12factor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Schneeman
@@ -9,34 +9,62 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-06-18 00:00:00.000000000 Z
12
+ date: 2014-10-14 00:00:00.000000000 Z
13
13
  dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: minitest
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - ">="
19
+ - !ruby/object:Gem::Version
20
+ version: '0'
21
+ type: :development
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ">="
26
+ - !ruby/object:Gem::Version
27
+ version: '0'
28
+ - !ruby/object:Gem::Dependency
29
+ name: rake
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - ">="
33
+ - !ruby/object:Gem::Version
34
+ version: '0'
35
+ type: :development
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ">="
40
+ - !ruby/object:Gem::Version
41
+ version: '0'
14
42
  - !ruby/object:Gem::Dependency
15
43
  name: rails_serve_static_assets
16
44
  requirement: !ruby/object:Gem::Requirement
17
45
  requirements:
18
- - - '>='
46
+ - - ">="
19
47
  - !ruby/object:Gem::Version
20
48
  version: '0'
21
49
  type: :runtime
22
50
  prerelease: false
23
51
  version_requirements: !ruby/object:Gem::Requirement
24
52
  requirements:
25
- - - '>='
53
+ - - ">="
26
54
  - !ruby/object:Gem::Version
27
55
  version: '0'
28
56
  - !ruby/object:Gem::Dependency
29
57
  name: rails_stdout_logging
30
58
  requirement: !ruby/object:Gem::Requirement
31
59
  requirements:
32
- - - '>='
60
+ - - ">="
33
61
  - !ruby/object:Gem::Version
34
62
  version: '0'
35
63
  type: :runtime
36
64
  prerelease: false
37
65
  version_requirements: !ruby/object:Gem::Requirement
38
66
  requirements:
39
- - - '>='
67
+ - - ">="
40
68
  - !ruby/object:Gem::Version
41
69
  version: '0'
42
70
  description: Run Rails the 12factor way
@@ -47,7 +75,8 @@ executables: []
47
75
  extensions: []
48
76
  extra_rdoc_files: []
49
77
  files:
50
- - .gitignore
78
+ - ".gitignore"
79
+ - ".travis.yml"
51
80
  - Gemfile
52
81
  - LICENSE
53
82
  - README.md
@@ -55,9 +84,11 @@ files:
55
84
  - lib/rails_12factor.rb
56
85
  - lib/rails_12factor/version.rb
57
86
  - rails_12factor.gemspec
87
+ - test/helper.rb
88
+ - test/test_rails_12factor.rb
58
89
  homepage: https://github.com/heroku/rails_12factor
59
90
  licenses:
60
- - LICENSE
91
+ - MIT
61
92
  metadata: {}
62
93
  post_install_message:
63
94
  rdoc_options: []
@@ -65,19 +96,22 @@ require_paths:
65
96
  - lib
66
97
  required_ruby_version: !ruby/object:Gem::Requirement
67
98
  requirements:
68
- - - '>='
99
+ - - ">="
69
100
  - !ruby/object:Gem::Version
70
101
  version: '0'
71
102
  required_rubygems_version: !ruby/object:Gem::Requirement
72
103
  requirements:
73
- - - '>='
104
+ - - ">="
74
105
  - !ruby/object:Gem::Version
75
106
  version: '0'
76
107
  requirements: []
77
108
  rubyforge_project:
78
- rubygems_version: 2.0.2
109
+ rubygems_version: 2.2.2
79
110
  signing_key:
80
111
  specification_version: 4
81
112
  summary: Following best practices from http://12factor.net run a maintainable, clean,
82
113
  and scalable app on Rails
83
- test_files: []
114
+ test_files:
115
+ - test/helper.rb
116
+ - test/test_rails_12factor.rb
117
+ has_rdoc: