tanga_namespaced_helpers 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/README CHANGED
@@ -1,4 +1,3 @@
1
-
2
1
  No longer suffer the tyranny of 10 billion helper methods scattered throughout
3
2
  files without hierarchy.
4
3
 
@@ -7,13 +6,7 @@ module YourApp::Helpers::Links
7
6
  extend TangaNamespacedHelpers
8
7
 
9
8
  def self.tanga_points user
10
- link_to(pluralize(user.total_points, "Tanga Point"),
11
- leaderboards_path(:user_id => user.id))
12
-
13
- # You can also access the view directory with:
14
- view.link_to(view.pluralize(user.total_points, "Tanga Point"),
15
- view.leaderboards_path(:user_id => user.id))
16
- # I'm not sure which is better here. The first is less magic, more explicit.
9
+ link_to(pluralize(user.total_points, "Tanga Point"), leaderboards_path(:user_id => user.id))
17
10
  end
18
11
  end
19
12
 
@@ -22,6 +15,9 @@ Your View:
22
15
  <%= YourApp::Helpers::Links.tanga_points(user) %>
23
16
 
24
17
  For shorter code, in an initializer or something, do:
18
+
25
19
  H = YourApp::Helpers
20
+
26
21
  Then your views can do:
27
- <%= H::Links.tanga_points(user)
22
+
23
+ <%= H::Links.tanga_points(user) %>
@@ -1,3 +1,3 @@
1
1
  module TangaNamespacedHelpers
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -41,3 +41,8 @@ end
41
41
 
42
42
 
43
43
  ActionController::Base.send :include, TangaNamespacedHelpers::ControllerMethods
44
+
45
+ class ActionMailer::Base
46
+ # This is necessary to use namespaced helpers from the actionmailer views
47
+ default 'init-view' => Proc.new { TangaNamespacedHelpers.reset!(self) }
48
+ end
metadata CHANGED
@@ -1,34 +1,23 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: tanga_namespaced_helpers
3
- version: !ruby/object:Gem::Version
4
- hash: 27
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.3
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 0
9
- - 2
10
- version: 0.0.2
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Joe Van Dyk
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2011-08-25 00:00:00 -07:00
19
- default_executable:
12
+ date: 2012-03-07 00:00:00.000000000 Z
20
13
  dependencies: []
21
-
22
14
  description: Namespace your Rails helper methods
23
- email:
15
+ email:
24
16
  - joe@tanga.com
25
17
  executables: []
26
-
27
18
  extensions: []
28
-
29
19
  extra_rdoc_files: []
30
-
31
- files:
20
+ files:
32
21
  - .gitignore
33
22
  - Gemfile
34
23
  - README
@@ -36,39 +25,29 @@ files:
36
25
  - lib/tanga_namespaced_helpers.rb
37
26
  - lib/tanga_namespaced_helpers/version.rb
38
27
  - tanga_namespaced_helpers.gemspec
39
- has_rdoc: true
40
- homepage: ""
28
+ homepage: ''
41
29
  licenses: []
42
-
43
30
  post_install_message:
44
31
  rdoc_options: []
45
-
46
- require_paths:
32
+ require_paths:
47
33
  - lib
48
- required_ruby_version: !ruby/object:Gem::Requirement
34
+ required_ruby_version: !ruby/object:Gem::Requirement
49
35
  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
36
+ requirements:
37
+ - - ! '>='
38
+ - !ruby/object:Gem::Version
39
+ version: '0'
40
+ required_rubygems_version: !ruby/object:Gem::Requirement
58
41
  none: false
59
- requirements:
60
- - - ">="
61
- - !ruby/object:Gem::Version
62
- hash: 3
63
- segments:
64
- - 0
65
- version: "0"
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
66
46
  requirements: []
67
-
68
47
  rubyforge_project: tanga_namespaced_helpers
69
- rubygems_version: 1.5.2
48
+ rubygems_version: 1.8.10
70
49
  signing_key:
71
50
  specification_version: 3
72
51
  summary: Namespace your Rails helper methods
73
52
  test_files: []
74
-
53
+ has_rdoc: