Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

wip

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

0 notes on commit 31b7001

Please sign in to comment.
Something went wrong with that request. Please try again.