thoughtbot-clearance 0.2.4 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +27 -78
- data/generators/clearance/clearance_generator.rb +1 -1
- data/generators/clearance/templates/app/controllers/application.rb +5 -0
- data/generators/clearance/templates/app/views/sessions/new.html.erb +4 -1
- data/generators/clearance/templates/test/factories.rb +1 -1
- data/generators/clearance/templates/test/unit/user_test.rb +5 -0
- data/lib/clearance/version.rb +2 -2
- data/test/rails_root/app/views/sessions/new.html.erb +4 -1
- data/test/rails_root/config/routes.rb +1 -2
- metadata +3 -2
data/Rakefile
CHANGED
@@ -2,6 +2,10 @@ require 'rake'
|
|
2
2
|
require 'rake/testtask'
|
3
3
|
require 'date'
|
4
4
|
require 'lib/clearance/version'
|
5
|
+
begin
|
6
|
+
require 'jeweler'
|
7
|
+
rescue LoadError
|
8
|
+
end
|
5
9
|
|
6
10
|
test_files_pattern = 'test/rails_root/test/{unit,functional,other}/**/*_test.rb'
|
7
11
|
Rake::TestTask.new do |t|
|
@@ -13,11 +17,8 @@ end
|
|
13
17
|
desc "Run the test suite"
|
14
18
|
task :default => :test
|
15
19
|
|
16
|
-
|
20
|
+
Jeweler.gemspec = Gem::Specification.new do |s|
|
17
21
|
s.name = "clearance"
|
18
|
-
s.version = "#{Clearance::Version::MAJOR}.#{Clearance::Version::MINOR}.#{Clearance::Version::PATCH}"
|
19
|
-
date = DateTime.now
|
20
|
-
s.date = "#{date.year}-#{date.month}-#{date.day}"
|
21
22
|
s.summary = "Simple, complete Rails authentication."
|
22
23
|
s.email = "dcroak@thoughtbot.com"
|
23
24
|
s.homepage = "http://github.com/thoughtbot/clearance"
|
@@ -25,82 +26,30 @@ spec = Gem::Specification.new do |s|
|
|
25
26
|
s.authors = ["thoughtbot, inc.", "Dan Croak", "Josh Nichols", "Mike Breen", "Mike Burns", "Jason Morrison"]
|
26
27
|
s.files = FileList["[A-Z]*", "{generators,lib,test}/**/*"]
|
27
28
|
end
|
28
|
-
|
29
|
-
namespace :
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
29
|
+
|
30
|
+
namespace :generator do
|
31
|
+
task :templates do
|
32
|
+
app_files = FileList["test/rails_root/app/{controllers,models,views}/**/*"]
|
33
|
+
app_files.reject! { |file| file.include?("test/rails_root/app/views/layouts") }
|
34
|
+
test_files = FileList["test/rails_root/test/{functional,unit}/**/*"]
|
35
|
+
test_files += ["test/rails_root/test/factories.rb"]
|
36
|
+
files = test_files + app_files
|
37
|
+
templates_path = "generators/clearance/templates"
|
38
|
+
system `rm -rf #{templates_path}`
|
39
|
+
system `mkdir #{templates_path}`
|
40
|
+
["app", "app/controllers", "app/models", "app/views",
|
41
|
+
"test", "test/functional", "test/unit"].each do |directory|
|
42
|
+
system `mkdir #{templates_path}/#{directory}`
|
34
43
|
end
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
File.open("lib/clearance/version.rb", 'w') do |file|
|
44
|
-
file.write <<-END
|
45
|
-
module Clearance
|
46
|
-
module Version
|
47
|
-
MAJOR = #{major}
|
48
|
-
MINOR = 0
|
49
|
-
PATCH = 0
|
50
|
-
end
|
51
|
-
end
|
52
|
-
END
|
53
|
-
end
|
54
|
-
|
55
|
-
spec.version = "#{major}.0.0"
|
56
|
-
puts "Version bumped to #{spec.version}"
|
57
|
-
|
58
|
-
Rake::Task["gemspec:write"].invoke
|
59
|
-
puts "Gemspec updated"
|
60
|
-
end
|
61
|
-
|
62
|
-
desc "Bump the gemspec a minor version."
|
63
|
-
task :minor do
|
64
|
-
minor = Clearance::Version::MINOR + 1
|
65
|
-
File.open("lib/clearance/version.rb", 'w') do |file|
|
66
|
-
file.write <<-END
|
67
|
-
module Clearance
|
68
|
-
module Version
|
69
|
-
MAJOR = #{Clearance::Version::MAJOR}
|
70
|
-
MINOR = #{minor}
|
71
|
-
PATCH = 0
|
72
|
-
end
|
73
|
-
end
|
74
|
-
END
|
75
|
-
end
|
76
|
-
|
77
|
-
spec.version = "#{Clearance::Version::MAJOR}.#{minor}.0"
|
78
|
-
puts "Version bumped to #{spec.version}"
|
79
|
-
|
80
|
-
Rake::Task["gemspec:write"].invoke
|
81
|
-
puts "Gemspec updated"
|
82
|
-
end
|
83
|
-
|
84
|
-
desc "Bump the gemspec a patch version."
|
85
|
-
task :patch do
|
86
|
-
patch = Clearance::Version::PATCH + 1
|
87
|
-
File.open("lib/clearance/version.rb", 'w') do |file|
|
88
|
-
file.write <<-END
|
89
|
-
module Clearance
|
90
|
-
module Version
|
91
|
-
MAJOR = #{Clearance::Version::MAJOR}
|
92
|
-
MINOR = #{Clearance::Version::MINOR}
|
93
|
-
PATCH = #{patch}
|
94
|
-
end
|
95
|
-
end
|
96
|
-
END
|
44
|
+
files.each do |file|
|
45
|
+
template = "generators/clearance/templates/#{file.gsub("test/rails_root/", "")}"
|
46
|
+
if File.directory?(file)
|
47
|
+
system `rm -rf #{template}`
|
48
|
+
system `mkdir #{template}`
|
49
|
+
else
|
50
|
+
system `rm #{template}` if File.exists?(template)
|
51
|
+
system `cp #{file} #{template}`
|
97
52
|
end
|
98
|
-
|
99
|
-
spec.version = "#{Clearance::Version::MAJOR}.#{Clearance::Version::MINOR}.#{patch}"
|
100
|
-
puts "Version bumped to #{spec.version}"
|
101
|
-
|
102
|
-
Rake::Task["gemspec:write"].invoke
|
103
|
-
puts "Gemspec updated"
|
104
53
|
end
|
105
54
|
end
|
106
55
|
end
|
@@ -17,7 +17,7 @@ class ClearanceGenerator < Rails::Generator::Base
|
|
17
17
|
end
|
18
18
|
|
19
19
|
m.directory File.join("app", "views")
|
20
|
-
|
20
|
+
m.directory File.join("app", "views", "confirmations")
|
21
21
|
["app/views/confirmations/new.html.erb"].each do |file|
|
22
22
|
m.file file, file
|
23
23
|
end
|
data/lib/clearance/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: thoughtbot-clearance
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- thoughtbot, inc.
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2008-10-
|
17
|
+
date: 2008-10-12 00:00:00 -07:00
|
18
18
|
default_executable:
|
19
19
|
dependencies: []
|
20
20
|
|
@@ -35,6 +35,7 @@ files:
|
|
35
35
|
- generators/clearance/templates
|
36
36
|
- generators/clearance/templates/app
|
37
37
|
- generators/clearance/templates/app/controllers
|
38
|
+
- generators/clearance/templates/app/controllers/application.rb
|
38
39
|
- generators/clearance/templates/app/controllers/confirmations_controller.rb
|
39
40
|
- generators/clearance/templates/app/controllers/passwords_controller.rb
|
40
41
|
- generators/clearance/templates/app/controllers/sessions_controller.rb
|