acts_as_textcaptcha 2.1.1 → 2.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -10,7 +10,7 @@ Text CAPTCHA's logic questions are aimed at a child's age of 7, so can be solved
10
10
 
11
11
  == Rails 3
12
12
 
13
- This plugin/gem is now fully Rails 3 compatible.
13
+ This gem is now fully Rails 3 compatible.
14
14
 
15
15
  == Demo
16
16
 
@@ -30,20 +30,15 @@ What do you need?
30
30
 
31
31
  Install the gem
32
32
 
33
- sudo gem install acts_as_textcaptcha
34
-
35
- Or you can install acts_as_textcaptcha as a Rails plugin
36
-
37
- script/plugin install git://github.com/matthutchinson/acts_as_textcaptcha
38
- (if you do this be sure to include {bcrypt-ruby}[http://bcrypt-ruby.rubyforge.org/] in your Gemfile or with config.gem in your environment)
33
+ gem install acts_as_textcaptcha
39
34
 
40
35
  == Using
41
36
 
42
- First the gem to your Gemfile
37
+ First add the gem to your Gemfile
43
38
 
44
39
  gem "acts_as_textcaptcha"
45
40
 
46
- OR add the gem in your environment.rb config;
41
+ OR add to your environment.rb config;
47
42
 
48
43
  config.gem 'acts_as_textcaptcha'
49
44
 
@@ -13,8 +13,8 @@ rescue LoadError => e
13
13
  puts "ActsAsTextcaptcha - please gem install bcrypt-ruby and add `gem \"bcrypt-ruby\"` to your Gemfile (or environment config)"
14
14
  raise e
15
15
  end
16
-
17
- module ActsAsTextcaptcha
16
+
17
+ module ActsAsTextcaptcha
18
18
  module Textcaptcha #:nodoc:
19
19
 
20
20
  def acts_as_textcaptcha(options = nil)
@@ -26,7 +26,7 @@ module ActsAsTextcaptcha
26
26
  self.textcaptcha_config = options
27
27
  else
28
28
  begin
29
- self.textcaptcha_config = YAML.load(File.read("#{Rails.root.to_s}/config/textcaptcha.yml"))[Rails.env]
29
+ self.textcaptcha_config = YAML.load(File.read("#{Rails.root ? Rails.root.to_s : '.'}/config/textcaptcha.yml"))[Rails.env]
30
30
  rescue Errno::ENOENT
31
31
  raise('./config/textcaptcha.yml not found')
32
32
  end
@@ -115,5 +115,5 @@ module ActsAsTextcaptcha
115
115
  logger.info "Textcaptcha >> #{message}"
116
116
  end
117
117
  end
118
- end
119
- end
118
+ end
119
+ end
@@ -1,12 +1,12 @@
1
1
  ENV["RAILS_ENV"] ||= 'test'
2
2
 
3
3
  require 'rubygems'
4
- require 'spec'
5
4
  require 'active_record'
6
- require 'spec/autorun'
5
+ require 'rails'
6
+ require 'spec'
7
+ require 'spec/autorun'
7
8
 
8
9
  require File.dirname(__FILE__) + '/../lib/acts_as_textcaptcha'
9
- require File.dirname(__FILE__) + '/../init.rb'
10
10
 
11
11
  ActiveRecord::Base.establish_connection(YAML::load(IO.read(File.dirname(__FILE__) + '/database.yml'))[ENV['DB'] || 'sqlite3'])
12
12
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acts_as_textcaptcha
3
3
  version: !ruby/object:Gem::Version
4
- hash: 9
4
+ hash: 15
5
5
  prerelease: false
6
6
  segments:
7
7
  - 2
8
8
  - 1
9
- - 1
10
- version: 2.1.1
9
+ - 2
10
+ version: 2.1.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Matthew Hutchinson
@@ -24,7 +24,7 @@ dependencies:
24
24
  requirement: &id001 !ruby/object:Gem::Requirement
25
25
  none: false
26
26
  requirements:
27
- - - ">="
27
+ - - ~>
28
28
  - !ruby/object:Gem::Version
29
29
  hash: 15
30
30
  segments: