errogant 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README ADDED
@@ -0,0 +1,13 @@
1
+ Errogant
2
+ ========
3
+
4
+ Pretty errors for Rails.
5
+
6
+
7
+ Example
8
+ =======
9
+
10
+ Soon, I swear.
11
+
12
+
13
+ Copyright (c) 2010 Zack Parker, released under the MIT license
@@ -0,0 +1,23 @@
1
+ require 'rake'
2
+ require 'rake/testtask'
3
+ require 'rake/rdoctask'
4
+
5
+ desc 'Default: run unit tests.'
6
+ task :default => :test
7
+
8
+ desc 'Test the errogant plugin.'
9
+ Rake::TestTask.new(:test) do |t|
10
+ t.libs << 'lib'
11
+ t.libs << 'test'
12
+ t.pattern = 'test/**/*_test.rb'
13
+ t.verbose = true
14
+ end
15
+
16
+ desc 'Generate documentation for the errogant plugin.'
17
+ Rake::RDocTask.new(:rdoc) do |rdoc|
18
+ rdoc.rdoc_dir = 'rdoc'
19
+ rdoc.title = 'Errogant'
20
+ rdoc.options << '--line-numbers' << '--inline-source'
21
+ rdoc.rdoc_files.include('README')
22
+ rdoc.rdoc_files.include('lib/**/*.rb')
23
+ end
@@ -0,0 +1,22 @@
1
+ module Errogant
2
+
3
+ VERSION = '0.0.1'
4
+
5
+ @error_map = { }
6
+
7
+ def pretty_errors(model)
8
+ map_key = model.class.name
9
+
10
+ if !error_map[map_key]
11
+ return model.errors.full_messages.join('. ')
12
+ end
13
+
14
+ end
15
+
16
+ def error_map(model_class = nil, model_hash = nil)
17
+ if !model_class && !model_hash
18
+ return @error_map
19
+ end
20
+ end
21
+
22
+ end
@@ -0,0 +1,4 @@
1
+ # desc "Explaining what the task does"
2
+ # task :errogant do
3
+ # # Task goes here
4
+ # end
@@ -0,0 +1 @@
1
+ ActionController::Base.send :include, Errogant
@@ -0,0 +1,8 @@
1
+ require 'test_helper'
2
+
3
+ class ErrogantTest < ActiveSupport::TestCase
4
+ # Replace this with your real tests.
5
+ test "the truth" do
6
+ assert true
7
+ end
8
+ end
@@ -0,0 +1,3 @@
1
+ require 'rubygems'
2
+ require 'active_support'
3
+ require 'active_support/test_case'
metadata ADDED
@@ -0,0 +1,74 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: errogant
3
+ version: !ruby/object:Gem::Version
4
+ hash: 29
5
+ prerelease: false
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 1
10
+ version: 0.0.1
11
+ platform: ruby
12
+ authors:
13
+ - Zack Parker
14
+ - Kazu Omatsu
15
+ autorequire:
16
+ bindir: bin
17
+ cert_chain: []
18
+
19
+ date: 2011-01-20 00:00:00 -08:00
20
+ default_executable:
21
+ dependencies: []
22
+
23
+ description: Check out the summary!!!
24
+ email: zack@yammer-inc.com
25
+ executables: []
26
+
27
+ extensions: []
28
+
29
+ extra_rdoc_files: []
30
+
31
+ files:
32
+ - Rakefile
33
+ - lib/errogant.rb
34
+ - lib/tasks/errogant.rake
35
+ - rails/init.rb
36
+ - test/errogant_test.rb
37
+ - test/test_helper.rb
38
+ - README
39
+ has_rdoc: true
40
+ homepage: http://github.com/somezack/errogant
41
+ licenses: []
42
+
43
+ post_install_message:
44
+ rdoc_options: []
45
+
46
+ require_paths:
47
+ - lib
48
+ required_ruby_version: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ hash: 3
54
+ segments:
55
+ - 0
56
+ version: "0"
57
+ required_rubygems_version: !ruby/object:Gem::Requirement
58
+ none: false
59
+ requirements:
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ hash: 3
63
+ segments:
64
+ - 0
65
+ version: "0"
66
+ requirements: []
67
+
68
+ rubyforge_project:
69
+ rubygems_version: 1.3.7
70
+ signing_key:
71
+ specification_version: 3
72
+ summary: Fancy-pants error messages for Rails
73
+ test_files: []
74
+