merb-auth-core 1.0.15 → 1.1.0.pre

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -1,60 +1,53 @@
1
- require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "rake_helpers"))
2
-
3
- RUBY_FORGE_PROJECT = "merb-auth"
4
- GEM_NAME = "merb-auth-core"
5
- PKG_BUILD = ENV['PKG_BUILD'] ? '.' + ENV['PKG_BUILD'] : ''
6
- GEM_VERSION = Merb::VERSION + PKG_BUILD
7
-
8
- AUTHOR = "Adam French, Daniel Neighman"
9
- EMAIL = "has.sox@gmail.com"
10
- HOMEPAGE = "http://merbivore.com/"
11
- SUMMARY = "An Authentication framework for Merb"
12
-
13
- spec = Gem::Specification.new do |s|
14
- s.rubyforge_project = 'merb'
15
- s.name = GEM_NAME
16
- s.version = GEM_VERSION
17
- s.platform = Gem::Platform::RUBY
18
- s.has_rdoc = true
19
- s.extra_rdoc_files = ["README.textile", "LICENSE", "TODO"]
20
- s.summary = SUMMARY
21
- s.description = s.summary
22
- s.author = AUTHOR
23
- s.email = EMAIL
24
- s.homepage = HOMEPAGE
25
- s.add_dependency('merb-core', "~> #{Merb::VERSION}")
26
- s.add_dependency('extlib')
27
- s.require_path = 'lib'
28
- s.files = %w(LICENSE README.textile Rakefile TODO) + Dir.glob("{lib,spec}/**/*")
29
-
30
- end
1
+ require 'rubygems'
2
+ require 'rake'
31
3
 
32
- Rake::GemPackageTask.new(spec) do |pkg|
33
- pkg.gem_spec = spec
34
- end
4
+ # Assume a typical dev checkout to fetch the current merb-core version
5
+ require File.expand_path('../../../merb/merb-core/lib/merb-core/version', __FILE__)
35
6
 
36
- desc "install the plugin as a gem"
37
- task :install do
38
- Merb::RakeHelper.install(GEM_NAME, :version => GEM_VERSION)
39
- end
7
+ # Load this library's version information
8
+ require File.expand_path('../lib/merb-auth-core/version', __FILE__)
40
9
 
41
- desc "Uninstall the gem"
42
- task :uninstall do
43
- Merb::RakeHelper.uninstall(GEM_NAME, :version => GEM_VERSION)
44
- end
10
+ begin
11
+
12
+ require 'jeweler'
13
+
14
+ Jeweler::Tasks.new do |gemspec|
15
+
16
+ gemspec.version = Merb::Auth::Core::VERSION
17
+
18
+ gemspec.name = "merb-auth-core"
19
+ gemspec.description = "An Authentication framework for Merb"
20
+ gemspec.summary = "Merb plugin that provides basic authentication support"
21
+
22
+ gemspec.authors = [ "Adam French", "Daniel Neighman" ]
23
+ gemspec.email = "has.sox@gmail.com"
24
+ gemspec.homepage = "http://merbivore.com/"
25
+
26
+ gemspec.files = %w(LICENSE Rakefile README.textile TODO) + Dir['{lib,spec}/**/*']
27
+
28
+ # Runtime dependencies
29
+ gemspec.add_dependency 'merb-core', "~> #{Merb::VERSION}"
30
+
31
+ # Development dependencies
32
+ gemspec.add_development_dependency 'rspec', ">= 1.2.9"
45
33
 
46
- desc "Create a gemspec file"
47
- task :gemspec do
48
- File.open("#{GEM_NAME}.gemspec", "w") do |file|
49
- file.puts spec.to_ruby
50
34
  end
35
+
36
+ Jeweler::GemcutterTasks.new
37
+
38
+ rescue LoadError
39
+ puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
40
+ end
41
+
42
+ require 'spec/rake/spectask'
43
+ Spec::Rake::SpecTask.new(:spec) do |spec|
44
+ spec.spec_opts << '--options' << 'spec/spec.opts' if File.exists?('spec/spec.opts')
45
+ spec.libs << 'lib' << 'spec'
46
+ spec.spec_files = FileList['spec/**/*_spec.rb']
51
47
  end
52
48
 
53
- desc "Run all specs"
54
- Spec::Rake::SpecTask.new("spec") do |t|
55
- t.spec_opts = ["--format", "specdoc", "--colour"]
56
- t.spec_files = Dir["spec/**/*_spec.rb"].sort
57
- t.rcov = false
58
- t.rcov_opts << '--sort' << 'coverage' << '--sort-reverse'
59
- t.rcov_opts << '--only-uncovered'
49
+ Spec::Rake::SpecTask.new(:rcov) do |spec|
50
+ spec.libs << 'lib' << 'spec'
51
+ spec.pattern = 'spec/**/*_spec.rb'
52
+ spec.rcov = true
60
53
  end
@@ -33,6 +33,17 @@ module Merb
33
33
  end
34
34
  end
35
35
 
36
+ # Return validation errors for a particular field name or an empty array
37
+ #
38
+ # This method is a necessary requirement for active_model compatibility.
39
+ #
40
+ # @param [Symbol] field_name the name of the field you want an error for
41
+ # @return [Array<Array<String>>]
42
+ # array of validation errors or empty array, if there are no errors on given field
43
+ def [](field_name)
44
+ errors[field_name] ||= []
45
+ end
46
+
36
47
  # Return authentication errors for a particular field_name.
37
48
  #
38
49
  # @param <Symbol> field_name the name of the field you want an error for
@@ -0,0 +1,7 @@
1
+ module Merb
2
+ module Auth
3
+ module Core
4
+ VERSION = '1.1.0.pre'.freeze
5
+ end
6
+ end
7
+ end
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), "..", 'spec_helper.rb')
1
+ require 'spec_helper'
2
2
 
3
3
  describe "Merb::AuthenticationHelper" do
4
4
 
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), "..", 'spec_helper.rb')
1
+ require 'spec_helper'
2
2
 
3
3
  describe "Merb::Authentication Session" do
4
4
 
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), "..", 'spec_helper.rb')
1
+ require 'spec_helper'
2
2
 
3
3
  describe "Authentication callbacks" do
4
4
 
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), "..", 'spec_helper.rb')
1
+ require 'spec_helper'
2
2
 
3
3
  describe "Merb::Authentication.customizations" do
4
4
 
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), "..", 'spec_helper.rb')
1
+ require 'spec_helper'
2
2
 
3
3
  describe Merb::Authentication::Errors do
4
4
 
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), "..", 'spec_helper.rb')
1
+ require 'spec_helper'
2
2
 
3
3
  describe "Failed Login" do
4
4
 
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__) + '/../spec_helper'
1
+ require 'spec_helper'
2
2
 
3
3
  describe "merb-auth-core" do
4
4
  it "should ensure_authentication" do
@@ -1,5 +1,4 @@
1
- require File.join(File.dirname(__FILE__), "..", 'spec_helper.rb')
2
- require 'ruby-debug'
1
+ require 'spec_helper'
3
2
 
4
3
  describe "router protection" do
5
4
 
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), "..", 'spec_helper.rb')
1
+ require 'spec_helper'
2
2
 
3
3
  describe "Merb::Authentication::Strategy" do
4
4
 
@@ -0,0 +1,2 @@
1
+ --format specdoc
2
+ --colour
@@ -1,12 +1,18 @@
1
- $TESTING=true
2
- $:.push File.join(File.dirname(__FILE__), '..', 'lib')
1
+ require "rubygems"
3
2
 
4
- require 'rubygems'
3
+ # Use current merb-core sources if running from a typical dev checkout.
4
+ lib = File.expand_path('../../../../merb/merb-core/lib', __FILE__)
5
+ $LOAD_PATH.unshift(lib) if File.directory?(lib)
5
6
  require 'merb-core'
6
7
  require 'merb-core/test'
7
8
  require 'merb-core/dispatch/session'
8
- require 'spec' # Satisfies Autotest and anyone else not using the Rake tasks
9
- require 'merb-auth-core'
9
+
10
+ # The lib under test
11
+ require "merb-auth-core"
12
+
13
+ # Satisfies Autotest and anyone else not using the Rake tasks
14
+ require 'spec'
15
+
10
16
 
11
17
  Merb.start :environment => "test",
12
18
  :adapter => "runner",
metadata CHANGED
@@ -1,15 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: merb-auth-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.15
4
+ version: 1.1.0.pre
5
5
  platform: ruby
6
6
  authors:
7
- - Adam French, Daniel Neighman
7
+ - Adam French
8
+ - Daniel Neighman
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
12
 
12
- date: 2009-11-04 00:00:00 +00:00
13
+ date: 2009-11-17 00:00:00 +00:00
13
14
  default_executable:
14
15
  dependencies:
15
16
  - !ruby/object:Gem::Dependency
@@ -20,17 +21,17 @@ dependencies:
20
21
  requirements:
21
22
  - - ~>
22
23
  - !ruby/object:Gem::Version
23
- version: 1.0.15
24
+ version: 1.1.0.pre
24
25
  version:
25
26
  - !ruby/object:Gem::Dependency
26
- name: extlib
27
- type: :runtime
27
+ name: rspec
28
+ type: :development
28
29
  version_requirement:
29
30
  version_requirements: !ruby/object:Gem::Requirement
30
31
  requirements:
31
32
  - - ">="
32
33
  - !ruby/object:Gem::Version
33
- version: "0"
34
+ version: 1.2.9
34
35
  version:
35
36
  description: An Authentication framework for Merb
36
37
  email: has.sox@gmail.com
@@ -39,14 +40,14 @@ executables: []
39
40
  extensions: []
40
41
 
41
42
  extra_rdoc_files:
42
- - README.textile
43
43
  - LICENSE
44
- - TODO
44
+ - README.textile
45
45
  files:
46
46
  - LICENSE
47
47
  - README.textile
48
48
  - Rakefile
49
49
  - TODO
50
+ - lib/merb-auth-core.rb
50
51
  - lib/merb-auth-core/authenticated_helper.rb
51
52
  - lib/merb-auth-core/authentication.rb
52
53
  - lib/merb-auth-core/bootloader.rb
@@ -58,7 +59,7 @@ files:
58
59
  - lib/merb-auth-core/router_helper.rb
59
60
  - lib/merb-auth-core/session_mixin.rb
60
61
  - lib/merb-auth-core/strategy.rb
61
- - lib/merb-auth-core.rb
62
+ - lib/merb-auth-core/version.rb
62
63
  - spec/helpers/authentication_helper_spec.rb
63
64
  - spec/merb-auth-core/activation_fixture.rb
64
65
  - spec/merb-auth-core/authentication_spec.rb
@@ -69,14 +70,15 @@ files:
69
70
  - spec/merb-auth-core/merb-auth-core_spec.rb
70
71
  - spec/merb-auth-core/router_helper_spec.rb
71
72
  - spec/merb-auth-core/strategy_spec.rb
73
+ - spec/spec.opts
72
74
  - spec/spec_helper.rb
73
75
  has_rdoc: true
74
76
  homepage: http://merbivore.com/
75
77
  licenses: []
76
78
 
77
79
  post_install_message:
78
- rdoc_options: []
79
-
80
+ rdoc_options:
81
+ - --charset=UTF-8
80
82
  require_paths:
81
83
  - lib
82
84
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -87,16 +89,16 @@ required_ruby_version: !ruby/object:Gem::Requirement
87
89
  version:
88
90
  required_rubygems_version: !ruby/object:Gem::Requirement
89
91
  requirements:
90
- - - ">="
92
+ - - ">"
91
93
  - !ruby/object:Gem::Version
92
- version: "0"
94
+ version: 1.3.1
93
95
  version:
94
96
  requirements: []
95
97
 
96
- rubyforge_project: merb
98
+ rubyforge_project:
97
99
  rubygems_version: 1.3.5
98
100
  signing_key:
99
101
  specification_version: 3
100
- summary: An Authentication framework for Merb
102
+ summary: Merb plugin that provides basic authentication support
101
103
  test_files: []
102
104