Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Version bump to 0.0.0

  • Loading branch information...
commit a53a79670e9abeee60f381f2e81349b4294d05ff 1 parent da243b8
Kristian Mandrup authored March 29, 2012
10  .gitignore
@@ -28,11 +28,11 @@ pkg
28 28
 #
29 29
 # For MacOS:
30 30
 #
31  
-#.DS_Store
  31
+.DS_Store
32 32
 
33 33
 # For TextMate
34  
-#*.tmproj
35  
-#tmtags
  34
+*.tmproj
  35
+tmtags
36 36
 
37 37
 # For emacs:
38 38
 #*~
@@ -40,10 +40,10 @@ pkg
40 40
 #.\#*
41 41
 
42 42
 # For vim:
43  
-#*.swp
  43
+*.swp
44 44
 
45 45
 # For redcar:
46  
-#.redcar
  46
+.redcar
47 47
 
48 48
 # For rubinius:
49 49
 #*.rbc
15  Gemfile
... ...
@@ -1,14 +1,11 @@
1  
-source "http://rubygems.org"
2  
-# Add dependencies required to use your gem here.
3  
-# Example:
4  
-#   gem "activesupport", ">= 2.3.5"
  1
+source :rubygems
5 2
 
6 3
 # Add dependencies to develop your gem here.
7 4
 # Include everything needed to run rake, tests, features, etc.
8 5
 group :development do
9  
-  gem "rspec", "~> 2.8.0"
10  
-  gem "rdoc", "~> 3.12"
11  
-  gem "bundler", "~> 1.0.0"
12  
-  gem "jeweler", "~> 1.8.3"
13  
-  gem "rcov", ">= 0"
  6
+  gem "rspec", 			"~> 2.8.0"
  7
+  gem "rdoc", 			"~> 3.12"
  8
+  gem "bundler", 		">= 1.0.0"
  9
+  gem "jeweler", 		">= 1.8.3"
  10
+  gem "simplecov", 	">= 0"
14 11
 end
37  Gemfile.lock
... ...
@@ -0,0 +1,37 @@
  1
+GEM
  2
+  remote: http://rubygems.org/
  3
+  specs:
  4
+    diff-lcs (1.1.3)
  5
+    git (1.2.5)
  6
+    jeweler (1.8.3)
  7
+      bundler (~> 1.0)
  8
+      git (>= 1.2.5)
  9
+      rake
  10
+      rdoc
  11
+    json (1.6.6)
  12
+    multi_json (1.2.0)
  13
+    rake (0.9.2.2)
  14
+    rdoc (3.12)
  15
+      json (~> 1.4)
  16
+    rspec (2.8.0)
  17
+      rspec-core (~> 2.8.0)
  18
+      rspec-expectations (~> 2.8.0)
  19
+      rspec-mocks (~> 2.8.0)
  20
+    rspec-core (2.8.0)
  21
+    rspec-expectations (2.8.0)
  22
+      diff-lcs (~> 1.1.2)
  23
+    rspec-mocks (2.8.0)
  24
+    simplecov (0.6.1)
  25
+      multi_json (~> 1.0)
  26
+      simplecov-html (~> 0.5.3)
  27
+    simplecov-html (0.5.3)
  28
+
  29
+PLATFORMS
  30
+  ruby
  31
+
  32
+DEPENDENCIES
  33
+  bundler (>= 1.0.0)
  34
+  jeweler (>= 1.8.3)
  35
+  rdoc (~> 3.12)
  36
+  rspec (~> 2.8.0)
  37
+  simplecov
22  README.rdoc
Source Rendered
... ...
@@ -1,6 +1,24 @@
1  
-= flasher
  1
+= Flasher
2 2
 
3  
-Description goes here.
  3
+Includes a small flasher helper in your base controller in order to do translations for flash messages using the Rails locale standard:
  4
+
  5
+		config/locales/flash/[controller]/[country_code].yml
  6
+
  7
+Content of YAML flash translation file:
  8
+
  9
+		en:
  10
+		  flash:
  11
+		    redemptions:
  12
+		      success: "The voucher has been redeemed"
  13
+		      code_invalid: "Invalid voucher code"
  14
+		      code_already_used: "The voucher has already been redeemed"
  15
+		      unknown_voucher: "No voucher could be found for the reference no."
  16
+
  17
+Then use it in your controller, here in the RedemptionsController
  18
+
  19
+		<%= flash_t('.success') %>
  20
+
  21
+Enjoy!
4 22
 
5 23
 == Contributing to flasher
6 24
  
1  VERSION
... ...
@@ -0,0 +1 @@
  1
+0.0.0
9  lib/flasher.rb
... ...
@@ -0,0 +1,9 @@
  1
+module Flasher
  2
+	module Translate
  3
+	  def flash_t(key)
  4
+	    t("flash.#{params[:controller].gsub('/', '.')}#{key}")
  5
+	  end
  6
+	end
  7
+end
  8
+
  9
+require 'flasher/rails_engine' if defined?(::Rails::Engine)
9  lib/flasher/rails_engine.rb
... ...
@@ -0,0 +1,9 @@
  1
+module Flasher
  2
+  class Engine < ::Rails::Engine
  3
+      
  4
+  	initializer "setup for rails" do
  5
+  		ActionController::Base.send(:include, Flasher::Translate)
  6
+    end
  7
+
  8
+  end
  9
+end

0 notes on commit a53a796

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