Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

wip

  • Loading branch information...
commit 31b7001077215e99977ec00643674360d7e81153 1 parent ae3190d
@rudionrails authored
View
7 Gemfile
@@ -3,3 +3,10 @@ source "http://rubygems.org"
# Specify your gem's dependencies in yell-rails.gemspec
gemspec
+group :development, :test do
+ gem "rake"
+
+ gem "rspec"
+ gem "rr"
+end
+
View
1  lib/yell/rails.rb
@@ -5,6 +5,7 @@
module Yell #:nodoc:
class Railtie < ::Rails::Railtie
+ railtie_name 'yell-rails'
initializer 'yell.logger', :group => :all, :before => :initialize_logger do |app|
# behave like the standard rails logger and create the log dir
View
42 spec/fixtures/yell.yml
@@ -0,0 +1,42 @@
+# The following is an example config file for yell with all possible options available.
+#
+# To learn about the possible configuration options via a YAML file, read the wiki
+# on github: https://github.com/rudionrails/yell/wiki/101-configuration-with-yaml
+
+development: &development
+ # Enable colorized log output with the following. It is handy for development
+ # or testing, but should not be turned on for staging or production. Otherwise
+ # you will see those annoying ANSI color codes when on the remote production
+ # machine.
+ :colors: true
+
+# we use the same settings for test that we defined for development
+test: *development
+
+# In production, you should configure yell somewhat more specific. The following
+# is an example config - change it at your own will.
+production:
+ # Set the minimum (global) log level for Yell. If you prefer a different setup
+ # you may comine various log levels, like:
+ # # this will only log between :info and :fatal level
+ # :level: 'gte.info lte.fatal'
+ :level: 'gte.info'
+
+ # Keep a max of 7 files for every adapter per default. You can leave this option
+ # if you wish to keep all files, otherwise, Yell will cleanup any :datefile
+ # after a rollover of 7 times.
+ :keep: 7
+
+ # define multiple adapters: one for notice and one for error messages
+ :adapters:
+ # this adapter writes all messages with a log level of warn or lower
+ # and writes to production.log (because this is your Rails.env)
+ - :datefile:
+ :level: 'lte.warn'
+
+ # this adapter writes all messages with a log level of error or higher
+ # and writes to error.log
+ - :datefile:
+ :level: 'gte.error'
+ :filename: 'log/error.log'
+
View
20 spec/spec_helper.rb
@@ -0,0 +1,20 @@
+$:.unshift File.expand_path('..', __FILE__)
+$:.unshift File.expand_path('../../lib', __FILE__)
+
+require 'yell/rails'
+require 'rails/all'
+
+require 'rspec'
+require 'rr'
+
+RSpec.configure do |config|
+ config.mock_framework = :rr
+
+ private
+
+ def fixture_path
+ File.dirname(__FILE__) + '/fixtures'
+ end
+
+end
+
View
27 spec/yell/railtie_spec.rb
@@ -0,0 +1,27 @@
+require 'spec_helper'
+
+# Yell Rails applicatio class
+module Yell
+ class Application < Rails::Application
+ end
+end
+
+describe Yell::Railtie do
+ let( :file ) { File.join(fixture_path, 'yell.yml') }
+
+ before do
+ mock( Rails.root ).join('config', 'yell.yml') { config_file }
+
+ Yell::Application.initialize!
+ end
+
+ it "should have the right railtie name" do
+ Yell::Railtie.railtie_name.should == 'yell-rails'
+ end
+
+ # it "should set the rails logger for the Yell::Repository" do
+ # Rails.logger.should == Yell['rails']
+ # end
+
+end
+
View
4 yell-rails.gemspec
@@ -17,6 +17,8 @@ Gem::Specification.new do |s|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
s.require_paths = ["lib"]
- s.add_runtime_dependency "rails", ">= 3"
s.add_runtime_dependency "yell", ">= 0.13.2"
+
+ s.add_development_dependency "rails", ">= 3.0.0"
end
+
Please sign in to comment.
Something went wrong with that request. Please try again.