devise-links 0.1.5 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,5 @@
1
+ Nov 26, 2010
2
+ ---
3
+ Major update to make the gem independent of Cream
4
+ * Removed dependency on #auth_labels method in Cream, now uses internal #labels method
5
+ * Added devise:links generator that can generate a 'cream' locale file for the labels used
@@ -12,29 +12,50 @@ Alternatively insert into Rails 3 Gemfile:
12
12
  gem 'devise-links'
13
13
  </pre>
14
14
 
15
- and from the terminal run: *bundle install*
15
+ Run <code>$ bundle install</code> in terminal from root of Rails app
16
+
17
+ ## Updates
18
+
19
+ See 'Changelog.txt'
20
+
21
+ _Nov 26, 2010_
22
+
23
+ Major update to make the gem independent of Cream
24
+
25
+ * Removed dependency on #auth_labels method in Cream, now uses internal #labels method
26
+ * Added devise:links generator that can generate a 'cream' locale file for the labels used
16
27
 
17
28
  ## Usage
18
29
 
30
+ The gem adds a set of convenient view helpers that are available inside any Rails view:
31
+
19
32
  <pre>
20
- <%= new_registration_link(:role => :admin) %>
21
-
33
+ <%= new_registration_link(:role => :admin) %>
22
34
  <%= sign_out_link(:role => :admin, :label => 'Log me out!') %>
23
35
  </pre>
24
36
 
37
+ ## Generators
38
+
39
+ Running the devise:links generator should generate a locale file called 'cream.en.yml' in your Rails app /locales dir.
40
+
41
+ <code>rails g devise:links</code>
42
+
43
+ To enable i18n (translations), please set <code>Devise::Links.translate = true</code> fx in a Rails initializer file.
44
+
45
+ ## Contributions and more info
46
+
47
+ See specs for demonstrations of how to use the API etc. To contribute, please enhance by writing specs and then adjusting/enhancing the functionality
48
+
25
49
  ## TODO
26
50
 
27
51
  Make API more generic...
28
52
 
29
53
  <pre>
30
- <%= new_registration_link(:admin) %>
31
-
32
- <%= sign_out_link(:admin, 'Log out') %>
33
-
54
+ <%= new_registration_link(:admin) %>
55
+ <%= sign_out_link(:admin, 'Log out') %>
34
56
  <%= new_registration_link('Register!') %>
35
57
  </pre>
36
58
 
37
-
38
59
  ## Note on Patches/Pull Requests
39
60
 
40
61
  * Fork the project.
data/Rakefile CHANGED
@@ -7,13 +7,18 @@ begin
7
7
  gem.email = "kmandrup@gmail.com"
8
8
  gem.homepage = "http://github.com/kristianmandrup/devise-links"
9
9
  gem.authors = ["Kristian Mandrup"]
10
- gem.add_development_dependency "rspec", ">= 2.0.0.rc"
11
- gem.add_development_dependency "rspec-action_view", "~> 0.3.1"
10
+ gem.add_development_dependency "rspec", ">= 2.0.0"
11
+ gem.add_development_dependency "rspec-action_view", "~> 0.3.4"
12
+ gem.add_development_dependency 'generator-spec', ">= 0.7.0"
12
13
 
13
- gem.add_dependency "devise", ">= 1.1.2"
14
+ gem.add_dependency "devise", ">= 1.2"
15
+ gem.add_dependency 'activesupport', ">= 3.0.0"
14
16
  gem.add_dependency 'require_all', "~> 1.2.0"
15
- gem.add_dependency 'sugar-high', "~> 0.2.10"
16
- gem.add_dependency 'r3_plugin_toolbox', "~> 0.3.6"
17
+ gem.add_dependency 'sugar-high', "~> 0.3.0"
18
+ gem.add_dependency 'r3_plugin_toolbox', ">= 0.4.0"
19
+ gem.add_dependency 'rails3_artifactor', ">= 0.3.1"
20
+ gem.add_dependency 'logging_assist', "~> 0.1.6"
21
+
17
22
  end
18
23
  Jeweler::GemcutterTasks.new
19
24
  rescue LoadError
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.5
1
+ 0.2.0
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{devise-links}
8
- s.version = "0.1.5"
8
+ s.version = "0.2.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Kristian Mandrup"]
12
- s.date = %q{2010-10-07}
12
+ s.date = %q{2010-11-26}
13
13
  s.description = %q{Link helpers for Devise actions, including user session and registration links.}
14
14
  s.email = %q{kmandrup@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -20,19 +20,25 @@ Gem::Specification.new do |s|
20
20
  ".document",
21
21
  ".gitignore",
22
22
  ".rspec",
23
+ "Changelog.txt",
23
24
  "LICENSE",
24
25
  "README.markdown",
25
26
  "Rakefile",
26
27
  "VERSION",
27
28
  "devise-links.gemspec",
28
29
  "lib/devise-links.rb",
29
- "lib/devise-links/link/registration.rb",
30
- "lib/devise-links/link/session.rb",
30
+ "lib/devise-links/labels.rb",
31
31
  "lib/devise-links/namespaces.rb",
32
32
  "lib/devise-links/rails/configure.rb",
33
- "spec/devise-links/helpers/registration-links_spec.rb",
34
- "spec/devise-links/helpers/session_links_spec.rb",
33
+ "lib/devise-links/registration.rb",
34
+ "lib/devise-links/session.rb",
35
+ "lib/generators/devise/links/links_generator.rb",
36
+ "lib/generators/devise/links/templates/devise_links.en.yml",
37
+ "log/development.log",
38
+ "spec/devise-links/generators/links_generator_spec.rb",
35
39
  "spec/devise-links/rails/configure_spec.rb",
40
+ "spec/devise-links/registration-links_spec.rb",
41
+ "spec/devise-links/session_links_spec.rb",
36
42
  "spec/spec_helper.rb"
37
43
  ]
38
44
  s.homepage = %q{http://github.com/kristianmandrup/devise-links}
@@ -41,9 +47,10 @@ Gem::Specification.new do |s|
41
47
  s.rubygems_version = %q{1.3.7}
42
48
  s.summary = %q{Link helpers for Devise actions}
43
49
  s.test_files = [
44
- "spec/devise-links/helpers/registration-links_spec.rb",
45
- "spec/devise-links/helpers/session_links_spec.rb",
50
+ "spec/devise-links/generators/links_generator_spec.rb",
46
51
  "spec/devise-links/rails/configure_spec.rb",
52
+ "spec/devise-links/registration-links_spec.rb",
53
+ "spec/devise-links/session_links_spec.rb",
47
54
  "spec/spec_helper.rb"
48
55
  ]
49
56
 
@@ -52,27 +59,39 @@ Gem::Specification.new do |s|
52
59
  s.specification_version = 3
53
60
 
54
61
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
55
- s.add_development_dependency(%q<rspec>, [">= 2.0.0.rc"])
56
- s.add_development_dependency(%q<rspec-action_view>, ["~> 0.3.1"])
57
- s.add_runtime_dependency(%q<devise>, [">= 1.1.2"])
62
+ s.add_development_dependency(%q<rspec>, [">= 2.0.0"])
63
+ s.add_development_dependency(%q<rspec-action_view>, ["~> 0.3.4"])
64
+ s.add_development_dependency(%q<generator-spec>, [">= 0.7.0"])
65
+ s.add_runtime_dependency(%q<devise>, [">= 1.2"])
66
+ s.add_runtime_dependency(%q<activesupport>, [">= 3.0.0"])
58
67
  s.add_runtime_dependency(%q<require_all>, ["~> 1.2.0"])
59
- s.add_runtime_dependency(%q<sugar-high>, ["~> 0.2.10"])
60
- s.add_runtime_dependency(%q<r3_plugin_toolbox>, ["~> 0.3.6"])
68
+ s.add_runtime_dependency(%q<sugar-high>, ["~> 0.3.0"])
69
+ s.add_runtime_dependency(%q<r3_plugin_toolbox>, [">= 0.4.0"])
70
+ s.add_runtime_dependency(%q<rails3_artifactor>, [">= 0.3.1"])
71
+ s.add_runtime_dependency(%q<logging_assist>, ["~> 0.1.6"])
61
72
  else
62
- s.add_dependency(%q<rspec>, [">= 2.0.0.rc"])
63
- s.add_dependency(%q<rspec-action_view>, ["~> 0.3.1"])
64
- s.add_dependency(%q<devise>, [">= 1.1.2"])
73
+ s.add_dependency(%q<rspec>, [">= 2.0.0"])
74
+ s.add_dependency(%q<rspec-action_view>, ["~> 0.3.4"])
75
+ s.add_dependency(%q<generator-spec>, [">= 0.7.0"])
76
+ s.add_dependency(%q<devise>, [">= 1.2"])
77
+ s.add_dependency(%q<activesupport>, [">= 3.0.0"])
65
78
  s.add_dependency(%q<require_all>, ["~> 1.2.0"])
66
- s.add_dependency(%q<sugar-high>, ["~> 0.2.10"])
67
- s.add_dependency(%q<r3_plugin_toolbox>, ["~> 0.3.6"])
79
+ s.add_dependency(%q<sugar-high>, ["~> 0.3.0"])
80
+ s.add_dependency(%q<r3_plugin_toolbox>, [">= 0.4.0"])
81
+ s.add_dependency(%q<rails3_artifactor>, [">= 0.3.1"])
82
+ s.add_dependency(%q<logging_assist>, ["~> 0.1.6"])
68
83
  end
69
84
  else
70
- s.add_dependency(%q<rspec>, [">= 2.0.0.rc"])
71
- s.add_dependency(%q<rspec-action_view>, ["~> 0.3.1"])
72
- s.add_dependency(%q<devise>, [">= 1.1.2"])
85
+ s.add_dependency(%q<rspec>, [">= 2.0.0"])
86
+ s.add_dependency(%q<rspec-action_view>, ["~> 0.3.4"])
87
+ s.add_dependency(%q<generator-spec>, [">= 0.7.0"])
88
+ s.add_dependency(%q<devise>, [">= 1.2"])
89
+ s.add_dependency(%q<activesupport>, [">= 3.0.0"])
73
90
  s.add_dependency(%q<require_all>, ["~> 1.2.0"])
74
- s.add_dependency(%q<sugar-high>, ["~> 0.2.10"])
75
- s.add_dependency(%q<r3_plugin_toolbox>, ["~> 0.3.6"])
91
+ s.add_dependency(%q<sugar-high>, ["~> 0.3.0"])
92
+ s.add_dependency(%q<r3_plugin_toolbox>, [">= 0.4.0"])
93
+ s.add_dependency(%q<rails3_artifactor>, [">= 0.3.1"])
94
+ s.add_dependency(%q<logging_assist>, ["~> 0.1.6"])
76
95
  end
77
96
  end
78
97
 
@@ -2,6 +2,10 @@ require 'require_all'
2
2
  require 'sugar-high/module'
3
3
  require 'sugar-high/alias'
4
4
  require 'devise-links/namespaces'
5
- require_all File.dirname(__FILE__) + '/devise-links/link'
6
- require_all File.dirname(__FILE__) + '/devise-links/rails'
5
+ require 'devise-links/registration'
6
+ require 'devise-links/session'
7
+
8
+ if defined? Rails
9
+ require 'devise-links/rails/configure'
10
+ end
7
11
 
@@ -0,0 +1,52 @@
1
+ module Devise::Links
2
+ class << self
3
+ def labels
4
+ @lbs ||= translate_labels? ? translate_labels : default_labels
5
+ end
6
+
7
+ attr_accessor :translate
8
+
9
+ def translate_labels?
10
+ translate
11
+ end
12
+
13
+ def auth_labels
14
+ %w{sign_in sign_out sign_up edit_registration}
15
+ end
16
+
17
+ protected
18
+
19
+ def default_labels
20
+ auth_labels.inject({}) {|result, action|
21
+ result[action.to_sym] = action.to_s.humanize
22
+ result
23
+ }
24
+ end
25
+
26
+ def translate_labels
27
+ ns_actions = 'cream.actions.auth'
28
+ auth_labels.inject({}) {|result, action|
29
+ result[action.to_sym] = t("#{ns_actions}.#{action}").humanize
30
+ result
31
+ }
32
+ end
33
+ end
34
+
35
+ module Labels
36
+ # create method :new_label, :index_label and so on ...
37
+ Devise::Links.auth_labels.each do |name|
38
+ class_eval %{
39
+ def #{name}_label
40
+ get_label :#{name}
41
+ end
42
+ }
43
+ end
44
+
45
+ alias_method :new_registration_label, :sign_up_label
46
+
47
+ # how to retrieve label in single location!
48
+ def get_label key
49
+ Devise::Links.labels[key]
50
+ end
51
+ end
52
+ end
@@ -3,7 +3,7 @@ require 'r3_plugin_toolbox'
3
3
 
4
4
  Rails3::Plugin::Extender.new do
5
5
  extend_rails :view do
6
- extend_from_module Devise::Link, :registration, :session
6
+ extend_from_module Devise::Links, :registration, :session, :labels
7
7
  end
8
8
  end
9
9
 
@@ -1,6 +1,7 @@
1
- module Devise::Link
2
- module Registration
3
-
1
+ require 'devise-links/labels'
2
+
3
+ module Devise::Links
4
+ module Registration
4
5
  REGISTRATION_LINKS = {
5
6
  :new_registration => :sign_up,
6
7
  :edit_registration => :edit_profile
@@ -12,8 +13,8 @@ module Devise::Link
12
13
  REGISTRATION_LINKS.keys.each do |name|
13
14
  class_eval %{
14
15
  def #{name}_link(options = {})
15
- label = options[:label] || auth_labels[:#{name}]
16
- path = #{name}_path options[:role]
16
+ label = options[:label] || #{name}_label
17
+ path = #{name}_path options[:role]
17
18
  link_to(label, path)
18
19
  end
19
20
  }
@@ -1,4 +1,6 @@
1
- module Devise::Link
1
+ require 'devise-links/labels'
2
+
3
+ module Devise::Links
2
4
  module Session
3
5
  SESSION_LINKS = {
4
6
  :sign_out => :log_out,
@@ -11,7 +13,7 @@ module Devise::Link
11
13
  SESSION_LINKS.keys.each_with_index do |name, index|
12
14
  class_eval %{
13
15
  def #{name}_link(options = {})
14
- label = options[:label] || auth_labels[:#{name}]
16
+ label = options[:label] || #{name}_label
15
17
  path = #{ACTIONS[index]}_session_path options[:role]
16
18
  link_to(label, path)
17
19
  end
@@ -0,0 +1,28 @@
1
+ require 'rails/generators/base'
2
+ require 'sugar-high/array'
3
+ require 'active_support/inflector'
4
+ require 'rails3_artifactor'
5
+ require 'logging_assist'
6
+
7
+ module Devise
8
+ module Generators
9
+ class LinksGenerator < Rails::Generators::Base
10
+ desc "Configures Rails app for use with Devise Links"
11
+
12
+ source_root File.dirname(__FILE__) + '/templates'
13
+
14
+ def main_flow
15
+ copy_locale
16
+ end
17
+
18
+ protected
19
+
20
+ include Rails3::Assist::BasicLogger
21
+ # extend Rails3::Assist::UseMacro
22
+
23
+ def copy_locale
24
+ template "devise_links.en.yml", "config/locales/cream.en.yml"
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,9 @@
1
+ en:
2
+ cream:
3
+ confirm: 'Are you sure?'
4
+ actions:
5
+ auth:
6
+ sign_in: "Sign in"
7
+ sign_out: "Sign out"
8
+ sign_up: "Sign up"
9
+ edit_registration: "Edit registration"
File without changes
@@ -0,0 +1,34 @@
1
+ require 'spec_helper'
2
+ require 'generator-spec'
3
+
4
+ require_generator :devise => :links
5
+
6
+ RSpec::Generator.configure do |config|
7
+ config.debug = true
8
+ config.remove_temp_dir = true
9
+ config.default_rails_root(__FILE__)
10
+ config.lib = File.dirname(__FILE__) + '/../lib'
11
+ config.logger = :stdout # :file
12
+ end
13
+
14
+
15
+ describe 'Restlinks generator' do
16
+ use_helpers :special, :file
17
+
18
+ setup_generator :devise_links do
19
+ tests Devise::Generators::LinksGenerator
20
+ end
21
+
22
+ describe "Run it!" do
23
+ before :each do
24
+ @generator = with_generator do |g|
25
+ g.run_generator
26
+ end
27
+ end
28
+
29
+ it "should have created a locales file for CanCan REST links" do
30
+ # Rails3::Assist::Files.locale_files.file_names.should include('cream.en.yml')
31
+ @generator.should have_locale_file 'cream.en'
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,31 @@
1
+ require 'spec_helper'
2
+ require 'devise-links/links/registration'
3
+ require 'devise-links/links/labels'
4
+
5
+ describe Devise::Links::Registration do
6
+
7
+ extend_view_with Devise::Links::Registration
8
+ extend_view_with Devise::Links::Labels
9
+
10
+ describe '#new_registration_link' do
11
+ it "should create a registration link" do
12
+ view_engine do |e, view|
13
+ label = 'new registration'
14
+ path = 'new/reg/path'
15
+
16
+ # view.stubs(:user_reg_path).with(:new, :admin).returns path
17
+ view.stubs(:new_registration_path).returns path
18
+
19
+ output_label = view.new_registration_label
20
+
21
+ view.stubs(:link_to).returns output_label
22
+
23
+ res = e.run_template do
24
+ %{<%= new_registration_link(:role => :admin) %> }
25
+ end
26
+ res.should match /#{output_label}/
27
+ end
28
+ end
29
+ end
30
+ end
31
+
@@ -1,23 +1,25 @@
1
1
  require 'spec_helper'
2
- require 'devise-links/link/session'
2
+ require 'devise-links/links/session'
3
+ require 'devise-links/links/labels'
3
4
 
4
- describe Devise::Link::Session do
5
+ describe Devise::Links::Session do
5
6
 
6
- extend_view_with Devise::Link::Session
7
+ extend_view_with Devise::Links::Session
8
+ extend_view_with Devise::Links::Labels
7
9
 
8
10
  describe '#sign_out_link' do
9
11
  it "should create a sign out link" do
10
- with_engine do |e, view|
12
+ view_engine do |e, view|
11
13
  label = 'log out'
12
14
  path = 'admin/log/out'
13
- view.stubs(:auth_labels).returns(:sign_out => label)
14
15
  view.stubs(:destroy_session_path).with(:admin).returns path
15
- view.stubs(:link_to).with(label, path).returns 'it works'
16
+ output_label = view.sign_out_label
17
+ view.stubs(:link_to).returns output_label
16
18
 
17
19
  res = e.run_template do
18
20
  %{<%= sign_out_link(:role => :admin) %> }
19
21
  end
20
- res.should match /it works/
22
+ res.should match /#{output_label}/
21
23
  end
22
24
  end
23
25
  end
metadata CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 0
7
- - 1
8
- - 5
9
- version: 0.1.5
7
+ - 2
8
+ - 0
9
+ version: 0.2.0
10
10
  platform: ruby
11
11
  authors:
12
12
  - Kristian Mandrup
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-10-07 00:00:00 +02:00
17
+ date: 2010-11-26 00:00:00 +01:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -29,8 +29,7 @@ dependencies:
29
29
  - 2
30
30
  - 0
31
31
  - 0
32
- - rc
33
- version: 2.0.0.rc
32
+ version: 2.0.0
34
33
  type: :development
35
34
  version_requirements: *id001
36
35
  - !ruby/object:Gem::Dependency
@@ -44,12 +43,12 @@ dependencies:
44
43
  segments:
45
44
  - 0
46
45
  - 3
47
- - 1
48
- version: 0.3.1
46
+ - 4
47
+ version: 0.3.4
49
48
  type: :development
50
49
  version_requirements: *id002
51
50
  - !ruby/object:Gem::Dependency
52
- name: devise
51
+ name: generator-spec
53
52
  prerelease: false
54
53
  requirement: &id003 !ruby/object:Gem::Requirement
55
54
  none: false
@@ -57,16 +56,45 @@ dependencies:
57
56
  - - ">="
58
57
  - !ruby/object:Gem::Version
59
58
  segments:
60
- - 1
59
+ - 0
60
+ - 7
61
+ - 0
62
+ version: 0.7.0
63
+ type: :development
64
+ version_requirements: *id003
65
+ - !ruby/object:Gem::Dependency
66
+ name: devise
67
+ prerelease: false
68
+ requirement: &id004 !ruby/object:Gem::Requirement
69
+ none: false
70
+ requirements:
71
+ - - ">="
72
+ - !ruby/object:Gem::Version
73
+ segments:
61
74
  - 1
62
75
  - 2
63
- version: 1.1.2
76
+ version: "1.2"
64
77
  type: :runtime
65
- version_requirements: *id003
78
+ version_requirements: *id004
79
+ - !ruby/object:Gem::Dependency
80
+ name: activesupport
81
+ prerelease: false
82
+ requirement: &id005 !ruby/object:Gem::Requirement
83
+ none: false
84
+ requirements:
85
+ - - ">="
86
+ - !ruby/object:Gem::Version
87
+ segments:
88
+ - 3
89
+ - 0
90
+ - 0
91
+ version: 3.0.0
92
+ type: :runtime
93
+ version_requirements: *id005
66
94
  - !ruby/object:Gem::Dependency
67
95
  name: require_all
68
96
  prerelease: false
69
- requirement: &id004 !ruby/object:Gem::Requirement
97
+ requirement: &id006 !ruby/object:Gem::Requirement
70
98
  none: false
71
99
  requirements:
72
100
  - - ~>
@@ -77,37 +105,67 @@ dependencies:
77
105
  - 0
78
106
  version: 1.2.0
79
107
  type: :runtime
80
- version_requirements: *id004
108
+ version_requirements: *id006
81
109
  - !ruby/object:Gem::Dependency
82
110
  name: sugar-high
83
111
  prerelease: false
84
- requirement: &id005 !ruby/object:Gem::Requirement
112
+ requirement: &id007 !ruby/object:Gem::Requirement
85
113
  none: false
86
114
  requirements:
87
115
  - - ~>
88
116
  - !ruby/object:Gem::Version
89
117
  segments:
90
118
  - 0
91
- - 2
92
- - 10
93
- version: 0.2.10
119
+ - 3
120
+ - 0
121
+ version: 0.3.0
94
122
  type: :runtime
95
- version_requirements: *id005
123
+ version_requirements: *id007
96
124
  - !ruby/object:Gem::Dependency
97
125
  name: r3_plugin_toolbox
98
126
  prerelease: false
99
- requirement: &id006 !ruby/object:Gem::Requirement
127
+ requirement: &id008 !ruby/object:Gem::Requirement
100
128
  none: false
101
129
  requirements:
102
- - - ~>
130
+ - - ">="
131
+ - !ruby/object:Gem::Version
132
+ segments:
133
+ - 0
134
+ - 4
135
+ - 0
136
+ version: 0.4.0
137
+ type: :runtime
138
+ version_requirements: *id008
139
+ - !ruby/object:Gem::Dependency
140
+ name: rails3_artifactor
141
+ prerelease: false
142
+ requirement: &id009 !ruby/object:Gem::Requirement
143
+ none: false
144
+ requirements:
145
+ - - ">="
103
146
  - !ruby/object:Gem::Version
104
147
  segments:
105
148
  - 0
106
149
  - 3
150
+ - 1
151
+ version: 0.3.1
152
+ type: :runtime
153
+ version_requirements: *id009
154
+ - !ruby/object:Gem::Dependency
155
+ name: logging_assist
156
+ prerelease: false
157
+ requirement: &id010 !ruby/object:Gem::Requirement
158
+ none: false
159
+ requirements:
160
+ - - ~>
161
+ - !ruby/object:Gem::Version
162
+ segments:
163
+ - 0
164
+ - 1
107
165
  - 6
108
- version: 0.3.6
166
+ version: 0.1.6
109
167
  type: :runtime
110
- version_requirements: *id006
168
+ version_requirements: *id010
111
169
  description: Link helpers for Devise actions, including user session and registration links.
112
170
  email: kmandrup@gmail.com
113
171
  executables: []
@@ -121,19 +179,25 @@ files:
121
179
  - .document
122
180
  - .gitignore
123
181
  - .rspec
182
+ - Changelog.txt
124
183
  - LICENSE
125
184
  - README.markdown
126
185
  - Rakefile
127
186
  - VERSION
128
187
  - devise-links.gemspec
129
188
  - lib/devise-links.rb
130
- - lib/devise-links/link/registration.rb
131
- - lib/devise-links/link/session.rb
189
+ - lib/devise-links/labels.rb
132
190
  - lib/devise-links/namespaces.rb
133
191
  - lib/devise-links/rails/configure.rb
134
- - spec/devise-links/helpers/registration-links_spec.rb
135
- - spec/devise-links/helpers/session_links_spec.rb
192
+ - lib/devise-links/registration.rb
193
+ - lib/devise-links/session.rb
194
+ - lib/generators/devise/links/links_generator.rb
195
+ - lib/generators/devise/links/templates/devise_links.en.yml
196
+ - log/development.log
197
+ - spec/devise-links/generators/links_generator_spec.rb
136
198
  - spec/devise-links/rails/configure_spec.rb
199
+ - spec/devise-links/registration-links_spec.rb
200
+ - spec/devise-links/session_links_spec.rb
137
201
  - spec/spec_helper.rb
138
202
  has_rdoc: true
139
203
  homepage: http://github.com/kristianmandrup/devise-links
@@ -168,7 +232,8 @@ signing_key:
168
232
  specification_version: 3
169
233
  summary: Link helpers for Devise actions
170
234
  test_files:
171
- - spec/devise-links/helpers/registration-links_spec.rb
172
- - spec/devise-links/helpers/session_links_spec.rb
235
+ - spec/devise-links/generators/links_generator_spec.rb
173
236
  - spec/devise-links/rails/configure_spec.rb
237
+ - spec/devise-links/registration-links_spec.rb
238
+ - spec/devise-links/session_links_spec.rb
174
239
  - spec/spec_helper.rb
@@ -1,25 +0,0 @@
1
- require 'spec_helper'
2
- require 'devise-links/link/registration'
3
-
4
- describe Devise::Link::Registration do
5
-
6
- extend_view_with Devise::Link::Registration
7
-
8
- describe '#new_registration_link' do
9
- it "should create a registration link" do
10
- with_engine do |e, view|
11
- label = 'new registration'
12
- path = 'new/reg/path'
13
- view.stubs(:auth_labels).returns(:new_registration => label)
14
- view.stubs(:user_reg_path).with(:new, :admin).returns path
15
- view.stubs(:link_to).with(label, path).returns 'it works'
16
-
17
- res = e.run_template do
18
- %{<%= new_registration_link(:role => :admin) %> }
19
- end
20
- res.should match /it works/
21
- end
22
- end
23
- end
24
- end
25
-