blogue 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +20 -0
- data/README.md +99 -0
- data/Rakefile +32 -0
- data/app/models/blogue/post.rb +105 -0
- data/lib/blogue/engine.rb +18 -0
- data/lib/blogue/version.rb +3 -0
- data/lib/blogue.rb +34 -0
- data/lib/kramdown/converter/blogue.rb +13 -0
- data/lib/tasks/blogue_tasks.rake +4 -0
- data/test/dummy/README.rdoc +28 -0
- data/test/dummy/Rakefile +6 -0
- data/test/dummy/app/controllers/application_controller.rb +5 -0
- data/test/dummy/app/controllers/posts_controller.rb +9 -0
- data/test/dummy/app/models/post.rb +2 -0
- data/test/dummy/app/views/layouts/application.html.erb +14 -0
- data/test/dummy/app/views/posts/show.html.erb +9 -0
- data/test/dummy/bin/bundle +3 -0
- data/test/dummy/bin/rails +4 -0
- data/test/dummy/bin/rake +4 -0
- data/test/dummy/config/application.rb +31 -0
- data/test/dummy/config/boot.rb +5 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +27 -0
- data/test/dummy/config/environments/production.rb +80 -0
- data/test/dummy/config/environments/test.rb +36 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/blogue.rb +1 -0
- data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/test/dummy/config/initializers/inflections.rb +16 -0
- data/test/dummy/config/initializers/mime_types.rb +5 -0
- data/test/dummy/config/initializers/secret_token.rb +12 -0
- data/test/dummy/config/initializers/session_store.rb +3 -0
- data/test/dummy/config/initializers/wrap_parameters.rb +9 -0
- data/test/dummy/config/locales/en.yml +23 -0
- data/test/dummy/config/routes.rb +5 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/log/test.log +3728 -0
- data/test/dummy/public/404.html +58 -0
- data/test/dummy/public/422.html +58 -0
- data/test/dummy/public/500.html +57 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/88c7acce0f27ad4785c977981dcffdbd +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/f59336706d1f8f55cfacfc5e139dfd9a +0 -0
- data/test/fixtures/posts/assets/dogue.jpg +0 -0
- data/test/fixtures/posts/code-block.md +7 -0
- data/test/fixtures/posts/header-title.md +9 -0
- data/test/fixtures/posts/meta.md +14 -0
- data/test/fixtures/posts/minimal-post.md +10 -0
- data/test/integration/configuration_test.rb +18 -0
- data/test/models/blogue/post_test.rb +51 -0
- data/test/test_helper.rb +10 -0
- metadata +192 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: a505062d8b893b86710be42e7cb204f57ba97875
|
4
|
+
data.tar.gz: 56d0545a6467270da541208b03b045e39b78ec7b
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 53fd19e403ba6c0cbe77b4c02fc801e8a86e1db055486781277945f302dccaf419f1c93b99524f909a1d06e06763f681d9816f059d50648e6e3fd2d995f5a699
|
7
|
+
data.tar.gz: 27d788f14d0c01486e2488f9fe9bd850d17da1509896f38fd3681aee89df905e3f5f2cc4e60dabc120ce48b35a1c1a392bbeb131cbf07056f7c610a3580c4fd4
|
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright 2013 Maxim Chernyak
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,99 @@
|
|
1
|
+
# Blogue
|
2
|
+
|
3
|
+
Blogue is the static page blog that is also a rails engine. It means that you get all of rails, yet your blog is static. Best of both worlds.
|
4
|
+
|
5
|
+
## What you get
|
6
|
+
|
7
|
+
* A `Blogue::Post` model
|
8
|
+
* Handler for ".md" views ([kramdown](https://github.com/gettalong/kramdown/) by default)
|
9
|
+
* Syntax highlighting for code blocks ([rouge](https://github.com/jayferd/rouge) by default)
|
10
|
+
|
11
|
+
## What you don't get
|
12
|
+
|
13
|
+
* Mountable endpoint
|
14
|
+
* Default controllers
|
15
|
+
* Default views
|
16
|
+
* Generators
|
17
|
+
|
18
|
+
You just hook it up by hand any way you want.
|
19
|
+
|
20
|
+
## Usage
|
21
|
+
|
22
|
+
1. Generate a rails app (or use existing)
|
23
|
+
2. Add `gem 'blogue'` to Gemfile and bundle
|
24
|
+
3. Create a model `app/models/post.rb` (the name 'Post' is chosen at random)
|
25
|
+
~~~ruby
|
26
|
+
class Post < Blogue::Post
|
27
|
+
# Here you can override inherited methods any way you like.
|
28
|
+
# See app/models/blogue/post.rb to see what you have
|
29
|
+
end
|
30
|
+
~~~
|
31
|
+
|
32
|
+
4. Create a controller `app/controllers/posts_controller.rb`
|
33
|
+
~~~ruby
|
34
|
+
class PostsController < ApplicationController
|
35
|
+
def index
|
36
|
+
@posts = Post.all
|
37
|
+
end
|
38
|
+
|
39
|
+
def show
|
40
|
+
@post = Post.find(id)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
~~~
|
44
|
+
|
45
|
+
5. Add a route to your `config/routes.rb` like this
|
46
|
+
~~~ruby
|
47
|
+
# If you want an index page
|
48
|
+
root to: 'posts#index'
|
49
|
+
|
50
|
+
# Whitelist of your posts
|
51
|
+
Post.all.each { |post| get "/#{post.id}", to: 'posts#show', id: post.id }
|
52
|
+
~~~
|
53
|
+
|
54
|
+
6. Add `app/views/posts/index.html.erb` for your index page
|
55
|
+
~~~erb
|
56
|
+
<% @posts.each do |post| %>
|
57
|
+
<p>
|
58
|
+
<%= link_to post.title, post.id %>
|
59
|
+
|
60
|
+
<% if post.tldr %>
|
61
|
+
<blockquote>
|
62
|
+
<%= post.tldr %>
|
63
|
+
</blockquote>
|
64
|
+
<% end %>
|
65
|
+
</p>
|
66
|
+
<% end %>
|
67
|
+
~~~
|
68
|
+
|
69
|
+
7. Add `app/views/posts/show.html.erb` for your post page
|
70
|
+
~~~erb
|
71
|
+
<%= link_to 'index', root_path %>
|
72
|
+
|
73
|
+
<%=raw render file: @post.path %>
|
74
|
+
|
75
|
+
<% if @post.date %>
|
76
|
+
<p>Published on <%= @post.date.to_s(:long) %></p>
|
77
|
+
<% end %>
|
78
|
+
~~~
|
79
|
+
|
80
|
+
8. Create a directory `app/posts` (that's default location of posts)
|
81
|
+
9. Create a directory `app/posts/assets` (it's added to assets paths by default)
|
82
|
+
10. Add a post like `app/posts/my-first-post.md`
|
83
|
+
~~~markdown
|
84
|
+
# Yay my first post
|
85
|
+
|
86
|
+
This is some text.
|
87
|
+
|
88
|
+
![picture](/assets/picture.jpg)
|
89
|
+
|
90
|
+
~~~ruby
|
91
|
+
foo = 'foo' # a codeblock
|
92
|
+
~~~
|
93
|
+
|
94
|
+
<!--meta
|
95
|
+
date: 2013-10-21
|
96
|
+
tldr: Awesome
|
97
|
+
-->
|
98
|
+
~~~
|
99
|
+
11. Start server and go to http://localhost:3000/my-first-post
|
data/Rakefile
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
begin
|
2
|
+
require 'bundler/setup'
|
3
|
+
rescue LoadError
|
4
|
+
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
5
|
+
end
|
6
|
+
|
7
|
+
require 'rdoc/task'
|
8
|
+
|
9
|
+
RDoc::Task.new(:rdoc) do |rdoc|
|
10
|
+
rdoc.rdoc_dir = 'rdoc'
|
11
|
+
rdoc.title = 'Blogue'
|
12
|
+
rdoc.options << '--line-numbers'
|
13
|
+
rdoc.rdoc_files.include('README.rdoc')
|
14
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
15
|
+
end
|
16
|
+
|
17
|
+
|
18
|
+
|
19
|
+
|
20
|
+
Bundler::GemHelper.install_tasks
|
21
|
+
|
22
|
+
require 'rake/testtask'
|
23
|
+
|
24
|
+
Rake::TestTask.new(:test) do |t|
|
25
|
+
t.libs << 'lib'
|
26
|
+
t.libs << 'test'
|
27
|
+
t.pattern = 'test/**/*_test.rb'
|
28
|
+
t.verbose = false
|
29
|
+
end
|
30
|
+
|
31
|
+
|
32
|
+
task default: :test
|
@@ -0,0 +1,105 @@
|
|
1
|
+
module Blogue
|
2
|
+
class Post
|
3
|
+
class << self
|
4
|
+
def find(id)
|
5
|
+
all.find{ |p| p.id == id }
|
6
|
+
end
|
7
|
+
|
8
|
+
def all
|
9
|
+
all_post_paths.map(&method(:new)).sort(&method(:sort_posts))
|
10
|
+
end
|
11
|
+
|
12
|
+
def all_post_paths
|
13
|
+
all_paths_in_posts_dir.select(&method(:post_file?))
|
14
|
+
end
|
15
|
+
|
16
|
+
def all_paths_in_posts_dir
|
17
|
+
Dir["#{Blogue.posts_path}/*"]
|
18
|
+
end
|
19
|
+
|
20
|
+
def post_file?(path)
|
21
|
+
File.file?(path) && !File.basename(path).starts_with?('.')
|
22
|
+
end
|
23
|
+
|
24
|
+
def extract_post_id(path)
|
25
|
+
File.basename(path)[/[^\.]+/]
|
26
|
+
end
|
27
|
+
|
28
|
+
def sort_posts(post_a, post_b)
|
29
|
+
post_b.time <=> post_a.time
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
attr_reader :path
|
34
|
+
|
35
|
+
def initialize(path)
|
36
|
+
@path = path
|
37
|
+
end
|
38
|
+
|
39
|
+
def id
|
40
|
+
self.class.extract_post_id(path)
|
41
|
+
end
|
42
|
+
|
43
|
+
def date
|
44
|
+
time.try(:to_date)
|
45
|
+
end
|
46
|
+
|
47
|
+
def time
|
48
|
+
meta_time || file_ctime
|
49
|
+
end
|
50
|
+
|
51
|
+
def title
|
52
|
+
meta_title || parsed_title || filename_title
|
53
|
+
end
|
54
|
+
|
55
|
+
def body
|
56
|
+
File.read(path)
|
57
|
+
end
|
58
|
+
|
59
|
+
def tldr
|
60
|
+
meta['tldr']
|
61
|
+
end
|
62
|
+
|
63
|
+
def meta
|
64
|
+
YAML.load(
|
65
|
+
body.lines.select do |line|
|
66
|
+
!!(line[/^<!--\s*meta/]..line[/--!>$/])
|
67
|
+
end[1..-2].try(:join, "\n") || ''
|
68
|
+
) || {}
|
69
|
+
end
|
70
|
+
|
71
|
+
def to_partial_path
|
72
|
+
'posts/post'
|
73
|
+
end
|
74
|
+
|
75
|
+
def to_helper_name
|
76
|
+
id.underscore
|
77
|
+
end
|
78
|
+
|
79
|
+
private
|
80
|
+
|
81
|
+
def meta_time
|
82
|
+
Time.parse(meta['date'])
|
83
|
+
rescue TypeError
|
84
|
+
nil
|
85
|
+
end
|
86
|
+
|
87
|
+
def file_ctime
|
88
|
+
File.ctime(path)
|
89
|
+
end
|
90
|
+
|
91
|
+
def meta_title
|
92
|
+
meta['title']
|
93
|
+
end
|
94
|
+
|
95
|
+
def parsed_title
|
96
|
+
if body.lines.first =~ /^\s*#\s+(.+)$/
|
97
|
+
$1
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
def filename_title
|
102
|
+
id.split(/[-_]/).join(' ').capitalize
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module Blogue
|
2
|
+
class Engine < ::Rails::Engine
|
3
|
+
isolate_namespace Blogue
|
4
|
+
|
5
|
+
initializer 'blogue.append_asset_path' do |app|
|
6
|
+
app.config.assets.paths << (
|
7
|
+
Blogue.assets_path || "#{Blogue.posts_path}/assets"
|
8
|
+
)
|
9
|
+
end
|
10
|
+
|
11
|
+
config.after_initialize do
|
12
|
+
if defined?(Kramdown)
|
13
|
+
Blogue.setup_kramdown_for_handling_md_files
|
14
|
+
Blogue.use_rouge_codeblock_handler if defined?(Rouge)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
data/lib/blogue.rb
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
require "blogue/engine"
|
2
|
+
|
3
|
+
module Blogue
|
4
|
+
mattr_accessor :posts_path
|
5
|
+
mattr_accessor :assets_path
|
6
|
+
mattr_accessor :markdown_format_handler
|
7
|
+
mattr_accessor :kramdown_codeblock_handler
|
8
|
+
|
9
|
+
self.posts_path = 'app/posts'
|
10
|
+
|
11
|
+
def self.setup_kramdown_for_handling_md_files
|
12
|
+
require 'kramdown/converter/blogue'
|
13
|
+
|
14
|
+
self.markdown_format_handler ||= -> template {
|
15
|
+
mdown = ActionView::Template.registered_template_handler(:erb).(template)
|
16
|
+
"Kramdown::Document.new(begin;#{mdown};end).to_blogue"
|
17
|
+
}
|
18
|
+
|
19
|
+
ActionView::Template.register_template_handler :md, markdown_format_handler
|
20
|
+
end
|
21
|
+
|
22
|
+
def self.use_rouge_codeblock_handler
|
23
|
+
self.kramdown_codeblock_handler ||= -> el, indent {
|
24
|
+
attr = el.attr.dup
|
25
|
+
lang = extract_code_language!(attr)
|
26
|
+
|
27
|
+
begin
|
28
|
+
Rouge.highlight(el.value, lang || 'text', 'html')
|
29
|
+
rescue RuntimeError
|
30
|
+
Rouge.highlight(el.value, 'text', 'html')
|
31
|
+
end
|
32
|
+
}
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
== README
|
2
|
+
|
3
|
+
This README would normally document whatever steps are necessary to get the
|
4
|
+
application up and running.
|
5
|
+
|
6
|
+
Things you may want to cover:
|
7
|
+
|
8
|
+
* Ruby version
|
9
|
+
|
10
|
+
* System dependencies
|
11
|
+
|
12
|
+
* Configuration
|
13
|
+
|
14
|
+
* Database creation
|
15
|
+
|
16
|
+
* Database initialization
|
17
|
+
|
18
|
+
* How to run the test suite
|
19
|
+
|
20
|
+
* Services (job queues, cache servers, search engines, etc.)
|
21
|
+
|
22
|
+
* Deployment instructions
|
23
|
+
|
24
|
+
* ...
|
25
|
+
|
26
|
+
|
27
|
+
Please feel free to use a different markup language if you do not plan to run
|
28
|
+
<tt>rake doc:app</tt>.
|
data/test/dummy/Rakefile
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>Dummy</title>
|
5
|
+
<%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %>
|
6
|
+
<%= javascript_include_tag "application", "data-turbolinks-track" => true %>
|
7
|
+
<%= csrf_meta_tags %>
|
8
|
+
</head>
|
9
|
+
<body>
|
10
|
+
|
11
|
+
<%= yield %>
|
12
|
+
|
13
|
+
</body>
|
14
|
+
</html>
|
data/test/dummy/bin/rake
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
require File.expand_path('../boot', __FILE__)
|
2
|
+
|
3
|
+
# Pick the frameworks you want:
|
4
|
+
# require "active_record/railtie"
|
5
|
+
require "action_controller/railtie"
|
6
|
+
require "action_mailer/railtie"
|
7
|
+
require "sprockets/railtie"
|
8
|
+
require "rails/test_unit/railtie"
|
9
|
+
|
10
|
+
Bundler.require(*Rails.groups)
|
11
|
+
|
12
|
+
require "kramdown"
|
13
|
+
require "rouge"
|
14
|
+
require "blogue"
|
15
|
+
|
16
|
+
module Dummy
|
17
|
+
class Application < Rails::Application
|
18
|
+
# Settings in config/environments/* take precedence over those specified here.
|
19
|
+
# Application configuration should go into files in config/initializers
|
20
|
+
# -- all .rb files in that directory are automatically loaded.
|
21
|
+
|
22
|
+
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
|
23
|
+
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
|
24
|
+
# config.time_zone = 'Central Time (US & Canada)'
|
25
|
+
|
26
|
+
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
27
|
+
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
28
|
+
# config.i18n.default_locale = :de
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
@@ -0,0 +1,27 @@
|
|
1
|
+
Dummy::Application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb.
|
3
|
+
|
4
|
+
# In the development environment your application's code is reloaded on
|
5
|
+
# every request. This slows down response time but is perfect for development
|
6
|
+
# since you don't have to restart the web server when you make code changes.
|
7
|
+
config.cache_classes = false
|
8
|
+
|
9
|
+
# Do not eager load code on boot.
|
10
|
+
config.eager_load = false
|
11
|
+
|
12
|
+
# Show full error reports and disable caching.
|
13
|
+
config.consider_all_requests_local = true
|
14
|
+
config.action_controller.perform_caching = false
|
15
|
+
|
16
|
+
# Don't care if the mailer can't send.
|
17
|
+
config.action_mailer.raise_delivery_errors = false
|
18
|
+
|
19
|
+
# Print deprecation notices to the Rails logger.
|
20
|
+
config.active_support.deprecation = :log
|
21
|
+
|
22
|
+
|
23
|
+
# Debug mode disables concatenation and preprocessing of assets.
|
24
|
+
# This option may cause significant delays in view rendering with a large
|
25
|
+
# number of complex assets.
|
26
|
+
config.assets.debug = true
|
27
|
+
end
|
@@ -0,0 +1,80 @@
|
|
1
|
+
Dummy::Application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb.
|
3
|
+
|
4
|
+
# Code is not reloaded between requests.
|
5
|
+
config.cache_classes = true
|
6
|
+
|
7
|
+
# Eager load code on boot. This eager loads most of Rails and
|
8
|
+
# your application in memory, allowing both thread web servers
|
9
|
+
# and those relying on copy on write to perform better.
|
10
|
+
# Rake tasks automatically ignore this option for performance.
|
11
|
+
config.eager_load = true
|
12
|
+
|
13
|
+
# Full error reports are disabled and caching is turned on.
|
14
|
+
config.consider_all_requests_local = false
|
15
|
+
config.action_controller.perform_caching = true
|
16
|
+
|
17
|
+
# Enable Rack::Cache to put a simple HTTP cache in front of your application
|
18
|
+
# Add `rack-cache` to your Gemfile before enabling this.
|
19
|
+
# For large-scale production use, consider using a caching reverse proxy like nginx, varnish or squid.
|
20
|
+
# config.action_dispatch.rack_cache = true
|
21
|
+
|
22
|
+
# Disable Rails's static asset server (Apache or nginx will already do this).
|
23
|
+
config.serve_static_assets = false
|
24
|
+
|
25
|
+
# Compress JavaScripts and CSS.
|
26
|
+
config.assets.js_compressor = :uglifier
|
27
|
+
# config.assets.css_compressor = :sass
|
28
|
+
|
29
|
+
# Do not fallback to assets pipeline if a precompiled asset is missed.
|
30
|
+
config.assets.compile = false
|
31
|
+
|
32
|
+
# Generate digests for assets URLs.
|
33
|
+
config.assets.digest = true
|
34
|
+
|
35
|
+
# Version of your assets, change this if you want to expire all your assets.
|
36
|
+
config.assets.version = '1.0'
|
37
|
+
|
38
|
+
# Specifies the header that your server uses for sending files.
|
39
|
+
# config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
|
40
|
+
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
|
41
|
+
|
42
|
+
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
43
|
+
# config.force_ssl = true
|
44
|
+
|
45
|
+
# Set to :debug to see everything in the log.
|
46
|
+
config.log_level = :info
|
47
|
+
|
48
|
+
# Prepend all log lines with the following tags.
|
49
|
+
# config.log_tags = [ :subdomain, :uuid ]
|
50
|
+
|
51
|
+
# Use a different logger for distributed setups.
|
52
|
+
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
|
53
|
+
|
54
|
+
# Use a different cache store in production.
|
55
|
+
# config.cache_store = :mem_cache_store
|
56
|
+
|
57
|
+
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
|
58
|
+
# config.action_controller.asset_host = "http://assets.example.com"
|
59
|
+
|
60
|
+
# Precompile additional assets.
|
61
|
+
# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
|
62
|
+
# config.assets.precompile += %w( search.js )
|
63
|
+
|
64
|
+
# Ignore bad email addresses and do not raise email delivery errors.
|
65
|
+
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
|
66
|
+
# config.action_mailer.raise_delivery_errors = false
|
67
|
+
|
68
|
+
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
69
|
+
# the I18n.default_locale when a translation can not be found).
|
70
|
+
config.i18n.fallbacks = true
|
71
|
+
|
72
|
+
# Send deprecation notices to registered listeners.
|
73
|
+
config.active_support.deprecation = :notify
|
74
|
+
|
75
|
+
# Disable automatic flushing of the log to improve performance.
|
76
|
+
# config.autoflush_log = false
|
77
|
+
|
78
|
+
# Use default logging formatter so that PID and timestamp are not suppressed.
|
79
|
+
config.log_formatter = ::Logger::Formatter.new
|
80
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
Dummy::Application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb.
|
3
|
+
|
4
|
+
# The test environment is used exclusively to run your application's
|
5
|
+
# test suite. You never need to work with it otherwise. Remember that
|
6
|
+
# your test database is "scratch space" for the test suite and is wiped
|
7
|
+
# and recreated between test runs. Don't rely on the data there!
|
8
|
+
config.cache_classes = true
|
9
|
+
|
10
|
+
# Do not eager load code on boot. This avoids loading your whole application
|
11
|
+
# just for the purpose of running a single test. If you are using a tool that
|
12
|
+
# preloads Rails for running tests, you may have to set it to true.
|
13
|
+
config.eager_load = false
|
14
|
+
|
15
|
+
# Configure static asset server for tests with Cache-Control for performance.
|
16
|
+
config.serve_static_assets = true
|
17
|
+
config.static_cache_control = "public, max-age=3600"
|
18
|
+
|
19
|
+
# Show full error reports and disable caching.
|
20
|
+
config.consider_all_requests_local = true
|
21
|
+
config.action_controller.perform_caching = false
|
22
|
+
|
23
|
+
# Raise exceptions instead of rendering exception templates.
|
24
|
+
config.action_dispatch.show_exceptions = false
|
25
|
+
|
26
|
+
# Disable request forgery protection in test environment.
|
27
|
+
config.action_controller.allow_forgery_protection = false
|
28
|
+
|
29
|
+
# Tell Action Mailer not to deliver emails to the real world.
|
30
|
+
# The :test delivery method accumulates sent emails in the
|
31
|
+
# ActionMailer::Base.deliveries array.
|
32
|
+
config.action_mailer.delivery_method = :test
|
33
|
+
|
34
|
+
# Print deprecation notices to the stderr.
|
35
|
+
config.active_support.deprecation = :stderr
|
36
|
+
end
|
@@ -0,0 +1,7 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
|
4
|
+
# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
|
5
|
+
|
6
|
+
# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
|
7
|
+
# Rails.backtrace_cleaner.remove_silencers!
|
@@ -0,0 +1 @@
|
|
1
|
+
Blogue.posts_path = File.expand_path('../../../../fixtures/posts', __FILE__)
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# Add new inflection rules using the following format. Inflections
|
4
|
+
# are locale specific, and you may define rules for as many different
|
5
|
+
# locales as you wish. All of these examples are active by default:
|
6
|
+
# ActiveSupport::Inflector.inflections(:en) do |inflect|
|
7
|
+
# inflect.plural /^(ox)$/i, '\1en'
|
8
|
+
# inflect.singular /^(ox)en/i, '\1'
|
9
|
+
# inflect.irregular 'person', 'people'
|
10
|
+
# inflect.uncountable %w( fish sheep )
|
11
|
+
# end
|
12
|
+
|
13
|
+
# These inflection rules are supported but not enabled by default:
|
14
|
+
# ActiveSupport::Inflector.inflections(:en) do |inflect|
|
15
|
+
# inflect.acronym 'RESTful'
|
16
|
+
# end
|