encodable_validator 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/.rspec +1 -0
- data/.travis.yml +5 -0
- data/Gemfile +11 -0
- data/Gemfile.lock +46 -0
- data/LICENSE.txt +20 -0
- data/README.rdoc +39 -0
- data/Rakefile +49 -0
- data/VERSION +1 -0
- data/encodable_validator.gemspec +70 -0
- data/lib/active_model/validators/encodable_validator.rb +54 -0
- data/lib/encodable_validator.rb +13 -0
- data/locales/en.yml +6 -0
- data/locales/ja.yml +6 -0
- data/spec/encodable_validator_spec.rb +109 -0
- data/spec/spec_helper.rb +27 -0
- metadata +164 -0
data/.document
ADDED
data/.rspec
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--color
|
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,46 @@
|
|
1
|
+
GEM
|
2
|
+
remote: http://rubygems.org/
|
3
|
+
specs:
|
4
|
+
activemodel (3.2.12)
|
5
|
+
activesupport (= 3.2.12)
|
6
|
+
builder (~> 3.0.0)
|
7
|
+
activesupport (3.2.12)
|
8
|
+
i18n (~> 0.6)
|
9
|
+
multi_json (~> 1.0)
|
10
|
+
builder (3.0.4)
|
11
|
+
diff-lcs (1.2.1)
|
12
|
+
git (1.2.5)
|
13
|
+
i18n (0.6.4)
|
14
|
+
jeweler (1.8.4)
|
15
|
+
bundler (~> 1.0)
|
16
|
+
git (>= 1.2.5)
|
17
|
+
rake
|
18
|
+
rdoc
|
19
|
+
json (1.7.7)
|
20
|
+
multi_json (1.6.1)
|
21
|
+
rake (10.0.3)
|
22
|
+
rdoc (4.0.0)
|
23
|
+
json (~> 1.4)
|
24
|
+
rspec (2.13.0)
|
25
|
+
rspec-core (~> 2.13.0)
|
26
|
+
rspec-expectations (~> 2.13.0)
|
27
|
+
rspec-mocks (~> 2.13.0)
|
28
|
+
rspec-core (2.13.0)
|
29
|
+
rspec-expectations (2.13.0)
|
30
|
+
diff-lcs (>= 1.1.3, < 2.0)
|
31
|
+
rspec-mocks (2.13.0)
|
32
|
+
simplecov (0.7.1)
|
33
|
+
multi_json (~> 1.0)
|
34
|
+
simplecov-html (~> 0.7.1)
|
35
|
+
simplecov-html (0.7.1)
|
36
|
+
|
37
|
+
PLATFORMS
|
38
|
+
ruby
|
39
|
+
|
40
|
+
DEPENDENCIES
|
41
|
+
activemodel (= 3.2.12)
|
42
|
+
bundler (~> 1.3)
|
43
|
+
jeweler (~> 1.8)
|
44
|
+
rdoc (~> 4.0)
|
45
|
+
rspec (~> 2.8)
|
46
|
+
simplecov (~> 0.7)
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2013 Koji Ejiri
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.rdoc
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
= encodable_validator
|
2
|
+
{<img src="https://travis-ci.org/eji/encodable_validator.png?branch=master" alt="Build Status" />}[https://travis-ci.org/eji/encodable_validator]
|
3
|
+
{<img src="https://codeclimate.com/github/eji/encodable_validator.png" />}[https://codeclimate.com/github/eji/encodable_validator]
|
4
|
+
{<img src="https://gemnasium.com/eji/encodable_validator.png" alt="Dependency Status" />}[https://gemnasium.com/eji/encodable_validator]
|
5
|
+
|
6
|
+
A string validator for ActiveModel to verify it can be converted to the specified encodings.
|
7
|
+
|
8
|
+
== Install
|
9
|
+
|
10
|
+
In your Gemfile:
|
11
|
+
gem 'encodable_validator', :git => "git://github.com/eji/encodable_validator.git"
|
12
|
+
|
13
|
+
== Usage
|
14
|
+
|
15
|
+
In your model:
|
16
|
+
validates :name, :encodable => {:encodings => [Encoding::EUC_JP, Encoding::ISO_2022_JP]}
|
17
|
+
or
|
18
|
+
validates_encodable_of :name, :encodings => [Encoding::EUC_JP, Encoding::ISO_2022_JP]
|
19
|
+
|
20
|
+
== Version
|
21
|
+
|
22
|
+
see VERSION
|
23
|
+
(using http://semver.org (... possible))
|
24
|
+
|
25
|
+
== Contributing to encodable_validator
|
26
|
+
|
27
|
+
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
|
28
|
+
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
|
29
|
+
* Fork the project.
|
30
|
+
* Start a feature/bugfix branch.
|
31
|
+
* Commit and push until you are happy with your contribution.
|
32
|
+
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
33
|
+
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own
|
34
|
+
|
35
|
+
== Copyright
|
36
|
+
|
37
|
+
Copyright (c) 2013 Koji Ejiri. See LICENSE.txt for
|
38
|
+
further details.
|
39
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'bundler'
|
5
|
+
begin
|
6
|
+
Bundler.setup(:default, :development)
|
7
|
+
rescue Bundler::BundlerError => e
|
8
|
+
$stderr.puts e.message
|
9
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
10
|
+
exit e.status_code
|
11
|
+
end
|
12
|
+
require 'rake'
|
13
|
+
|
14
|
+
require 'jeweler'
|
15
|
+
Jeweler::Tasks.new do |gem|
|
16
|
+
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
17
|
+
gem.name = "encodable_validator"
|
18
|
+
gem.homepage = "http://github.com/eji/encodable_validator"
|
19
|
+
gem.license = "MIT"
|
20
|
+
gem.summary = "A string validator for ActiveModel to verify it can be converted to the specified encodings."
|
21
|
+
gem.description = "A string validator for ActiveModel to verify it can be converted to the specified encodings."
|
22
|
+
gem.email = "k.ejiri@gmail.com"
|
23
|
+
gem.authors = ["Koji Ejiri"]
|
24
|
+
# dependencies defined in Gemfile
|
25
|
+
end
|
26
|
+
Jeweler::RubygemsDotOrgTasks.new
|
27
|
+
|
28
|
+
require 'rspec/core'
|
29
|
+
require 'rspec/core/rake_task'
|
30
|
+
RSpec::Core::RakeTask.new(:spec) do |spec|
|
31
|
+
spec.pattern = FileList['spec/**/*_spec.rb']
|
32
|
+
end
|
33
|
+
|
34
|
+
RSpec::Core::RakeTask.new(:rcov) do |spec|
|
35
|
+
spec.pattern = 'spec/**/*_spec.rb'
|
36
|
+
spec.rcov = true
|
37
|
+
end
|
38
|
+
|
39
|
+
task :default => :spec
|
40
|
+
|
41
|
+
require 'rdoc/task'
|
42
|
+
Rake::RDocTask.new do |rdoc|
|
43
|
+
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
44
|
+
|
45
|
+
rdoc.rdoc_dir = 'rdoc'
|
46
|
+
rdoc.title = "encodable_validator #{version}"
|
47
|
+
rdoc.rdoc_files.include('README*')
|
48
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
49
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.1.0
|
@@ -0,0 +1,70 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = "encodable_validator"
|
8
|
+
s.version = "0.1.0"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Koji Ejiri"]
|
12
|
+
s.date = "2013-03-01"
|
13
|
+
s.description = "A string validator for ActiveModel to verify it can be converted to the specified encodings."
|
14
|
+
s.email = "k.ejiri@gmail.com"
|
15
|
+
s.extra_rdoc_files = [
|
16
|
+
"LICENSE.txt",
|
17
|
+
"README.rdoc"
|
18
|
+
]
|
19
|
+
s.files = [
|
20
|
+
".document",
|
21
|
+
".rspec",
|
22
|
+
".travis.yml",
|
23
|
+
"Gemfile",
|
24
|
+
"Gemfile.lock",
|
25
|
+
"LICENSE.txt",
|
26
|
+
"README.rdoc",
|
27
|
+
"Rakefile",
|
28
|
+
"VERSION",
|
29
|
+
"encodable_validator.gemspec",
|
30
|
+
"lib/active_model/validators/encodable_validator.rb",
|
31
|
+
"lib/encodable_validator.rb",
|
32
|
+
"locales/en.yml",
|
33
|
+
"locales/ja.yml",
|
34
|
+
"spec/encodable_validator_spec.rb",
|
35
|
+
"spec/spec_helper.rb"
|
36
|
+
]
|
37
|
+
s.homepage = "http://github.com/eji/encodable_validator"
|
38
|
+
s.licenses = ["MIT"]
|
39
|
+
s.require_paths = ["lib"]
|
40
|
+
s.rubygems_version = "1.8.23"
|
41
|
+
s.summary = "A string validator for ActiveModel to verify it can be converted to the specified encodings."
|
42
|
+
|
43
|
+
if s.respond_to? :specification_version then
|
44
|
+
s.specification_version = 3
|
45
|
+
|
46
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
47
|
+
s.add_runtime_dependency(%q<activemodel>, ["= 3.2.12"])
|
48
|
+
s.add_development_dependency(%q<rspec>, ["~> 2.8"])
|
49
|
+
s.add_development_dependency(%q<rdoc>, ["~> 4.0"])
|
50
|
+
s.add_development_dependency(%q<bundler>, ["~> 1.3"])
|
51
|
+
s.add_development_dependency(%q<jeweler>, ["~> 1.8"])
|
52
|
+
s.add_development_dependency(%q<simplecov>, ["~> 0.7"])
|
53
|
+
else
|
54
|
+
s.add_dependency(%q<activemodel>, ["= 3.2.12"])
|
55
|
+
s.add_dependency(%q<rspec>, ["~> 2.8"])
|
56
|
+
s.add_dependency(%q<rdoc>, ["~> 4.0"])
|
57
|
+
s.add_dependency(%q<bundler>, ["~> 1.3"])
|
58
|
+
s.add_dependency(%q<jeweler>, ["~> 1.8"])
|
59
|
+
s.add_dependency(%q<simplecov>, ["~> 0.7"])
|
60
|
+
end
|
61
|
+
else
|
62
|
+
s.add_dependency(%q<activemodel>, ["= 3.2.12"])
|
63
|
+
s.add_dependency(%q<rspec>, ["~> 2.8"])
|
64
|
+
s.add_dependency(%q<rdoc>, ["~> 4.0"])
|
65
|
+
s.add_dependency(%q<bundler>, ["~> 1.3"])
|
66
|
+
s.add_dependency(%q<jeweler>, ["~> 1.8"])
|
67
|
+
s.add_dependency(%q<simplecov>, ["~> 0.7"])
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
@@ -0,0 +1,54 @@
|
|
1
|
+
require 'active_model/validations'
|
2
|
+
|
3
|
+
module ActiveModel
|
4
|
+
module Validations
|
5
|
+
class EncodableValidator < ActiveModel::EachValidator
|
6
|
+
def check_validity!
|
7
|
+
values = options[:encodings]
|
8
|
+
unless values.respond_to?(:all?) and values.all? {|v| v.class <= Encoding}
|
9
|
+
raise ArgumentError, ":encodings must be a array of Encodings"
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
def validate_each(record, attr_name, value)
|
14
|
+
return if options[:allow_nil] && value.nil?
|
15
|
+
|
16
|
+
unless value.respond_to?(:encode)
|
17
|
+
record.errors.add(attr_name, :not_a_encodable_object , options)
|
18
|
+
return
|
19
|
+
end
|
20
|
+
|
21
|
+
src_enc = value.encoding
|
22
|
+
last_enc = nil
|
23
|
+
begin
|
24
|
+
options[:encodings].each do |enc|
|
25
|
+
last_enc = enc
|
26
|
+
value.encode(enc, src_enc)
|
27
|
+
end
|
28
|
+
rescue Encoding::UndefinedConversionError
|
29
|
+
record.errors.add(attr_name, :can_not_be_encoded, options.merge(
|
30
|
+
:value => value,
|
31
|
+
:encoding => last_enc
|
32
|
+
))
|
33
|
+
return
|
34
|
+
rescue Encoding::InvalidByteSequenceError
|
35
|
+
record.errors.add(attr_name, :included_invalid_byte_sequences, options)
|
36
|
+
return
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
module HelperMethods
|
42
|
+
# Usage:
|
43
|
+
# class Person < ActiveRecord::Base
|
44
|
+
# validates_encodable_of :name, :encodings => [Encoding::ISO_2022_JP, Encoding::EUC_JP]
|
45
|
+
# end
|
46
|
+
#
|
47
|
+
# Configuration options:
|
48
|
+
# * <tt>:encodings</tt> - check that a text can be encoded to specified encodings.
|
49
|
+
def validates_encodable_of(*attr_names)
|
50
|
+
validates_with EncodableValidator, _merge_attributes(attr_names)
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'active_model/validators/encodable_validator'
|
2
|
+
require 'active_support/i18n'
|
3
|
+
|
4
|
+
# EncodableValidator
|
5
|
+
#
|
6
|
+
# @example
|
7
|
+
# validates :username, :encodable => { :encodings => [Encoding::ISO_2022_JP, Encoding::Shift_JIS] }
|
8
|
+
# or
|
9
|
+
# validates_encodable_of :username, :encodings => [Encoding::ISO_2022_JP, Encoding::Shift_JIS]
|
10
|
+
module EncodableValidator
|
11
|
+
end
|
12
|
+
|
13
|
+
I18n.load_path += Dir[File.expand_path(File.join(File.dirname(__FILE__), '../locales', '*.yml')).to_s]
|
data/locales/en.yml
ADDED
data/locales/ja.yml
ADDED
@@ -0,0 +1,109 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
2
|
+
require 'rspec'
|
3
|
+
|
4
|
+
module ActiveModel
|
5
|
+
|
6
|
+
module Validations
|
7
|
+
|
8
|
+
describe "EncodableValidator" do
|
9
|
+
before do
|
10
|
+
I18n.backend.reload!
|
11
|
+
TestRecord.reset_callbacks(:validate)
|
12
|
+
end
|
13
|
+
|
14
|
+
describe ".validates" do
|
15
|
+
|
16
|
+
it "checks validity of the arguments" do
|
17
|
+
[Encoding::ASCII, nil, ["utf-8", "euc-jp"]].each do |wrong_argument|
|
18
|
+
expect {
|
19
|
+
TestRecord.validates :target_text, :encodable => { :encodings => wrong_argument }
|
20
|
+
}.to raise_error(ArgumentError, ":encodings must be a array of Encodings")
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
context "passed UTF_8 encoded text that is not encodable ISO_2022_JP" do
|
25
|
+
before do
|
26
|
+
TestRecord.validates :target_text, encodable: { encodings: [Encoding::ISO_2022_JP] }
|
27
|
+
end
|
28
|
+
|
29
|
+
["\u2601", "\u2602", "\u2603", "\u2604"].each do |char|
|
30
|
+
it "invalid" do
|
31
|
+
sut = TestRecord.new(char)
|
32
|
+
sut.should be_invalid
|
33
|
+
sut.errors[:target_text].should == ["included charactors are not encoded to #{Encoding::ISO_2022_JP}"]
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
context "passed nil" do
|
39
|
+
context 'allow_nil' do
|
40
|
+
before do
|
41
|
+
TestRecord.validates :target_text, :encodable => { :encodings => [Encoding::ASCII] }, :allow_nil => true
|
42
|
+
end
|
43
|
+
|
44
|
+
it "valid" do
|
45
|
+
sut = TestRecord.new(nil)
|
46
|
+
sut.should be_valid
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
context 'not allow_nil' do
|
51
|
+
before do
|
52
|
+
TestRecord.validates :target_text, :encodable => { :encodings => [Encoding::ASCII] }, :allow_nil => false
|
53
|
+
end
|
54
|
+
|
55
|
+
it "invalid" do
|
56
|
+
sut = TestRecord.new(nil)
|
57
|
+
sut.should be_invalid
|
58
|
+
sut.errors[:target_text].should == ["is not a encodable object"]
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
context "passed string included invalid byte sequences" do
|
64
|
+
before do
|
65
|
+
TestRecord.validates :target_text, :encodable => { :encodings => [Encoding::UTF_16] }
|
66
|
+
@invalid_char = "\x82\xa0"
|
67
|
+
@invalid_char.should_receive(:encoding).and_return(Encoding::UTF_8)
|
68
|
+
end
|
69
|
+
|
70
|
+
it "invalid" do
|
71
|
+
sut = TestRecord.new(@invalid_char)
|
72
|
+
sut.should be_invalid
|
73
|
+
sut.errors[:target_text].should == ["included invalid byte sequences"]
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
end
|
79
|
+
|
80
|
+
describe "work with helper method" do
|
81
|
+
before do
|
82
|
+
I18n.backend.reload!
|
83
|
+
TestRecord.reset_callbacks(:validate)
|
84
|
+
TestRecord.validates_encodable_of :target_text, :encodings => [Encoding::ISO_2022_JP]
|
85
|
+
end
|
86
|
+
|
87
|
+
context "passed UTF_8 encoded text that is not encodable ISO_2022_JP" do
|
88
|
+
["\u2601", "\u2602", "\u2603", "\u2604"].each do |char|
|
89
|
+
it "invalid" do
|
90
|
+
sut = TestRecord.new(char)
|
91
|
+
sut.should be_invalid
|
92
|
+
sut.errors[:target_text].should == ["included charactors are not encoded to #{Encoding::ISO_2022_JP}"]
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
97
|
+
context "passed UTF_8 encoded text that is encodable ISO_2022_JP" do
|
98
|
+
["\u3041", "\u3042", "\u3043", "\u3044"].each do |char|
|
99
|
+
it "valid" do
|
100
|
+
sut = TestRecord.new(char)
|
101
|
+
sut.should be_valid
|
102
|
+
end
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
107
|
+
end
|
108
|
+
|
109
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
2
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
3
|
+
require 'rspec'
|
4
|
+
require 'encodable_validator'
|
5
|
+
require 'active_model'
|
6
|
+
require 'simplecov'
|
7
|
+
|
8
|
+
SimpleCov.start do
|
9
|
+
add_group 'Lib', 'lib'
|
10
|
+
end
|
11
|
+
|
12
|
+
# Requires supporting files with custom matchers and macros, etc,
|
13
|
+
# in ./support/ and its subdirectories.
|
14
|
+
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
|
15
|
+
|
16
|
+
RSpec.configure do |config|
|
17
|
+
|
18
|
+
end
|
19
|
+
|
20
|
+
class TestRecord
|
21
|
+
include ActiveModel::Validations
|
22
|
+
attr_accessor :target_text
|
23
|
+
|
24
|
+
def initialize(target_text)
|
25
|
+
@target_text = target_text
|
26
|
+
end
|
27
|
+
end
|
metadata
ADDED
@@ -0,0 +1,164 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: encodable_validator
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Koji Ejiri
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2013-03-01 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: activemodel
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - '='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 3.2.12
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - '='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 3.2.12
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: rspec
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ~>
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '2.8'
|
38
|
+
type: :development
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ~>
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '2.8'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: rdoc
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ~>
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '4.0'
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ~>
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '4.0'
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: bundler
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ~>
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '1.3'
|
70
|
+
type: :development
|
71
|
+
prerelease: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ~>
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '1.3'
|
78
|
+
- !ruby/object:Gem::Dependency
|
79
|
+
name: jeweler
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
82
|
+
requirements:
|
83
|
+
- - ~>
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: '1.8'
|
86
|
+
type: :development
|
87
|
+
prerelease: false
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ~>
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '1.8'
|
94
|
+
- !ruby/object:Gem::Dependency
|
95
|
+
name: simplecov
|
96
|
+
requirement: !ruby/object:Gem::Requirement
|
97
|
+
none: false
|
98
|
+
requirements:
|
99
|
+
- - ~>
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: '0.7'
|
102
|
+
type: :development
|
103
|
+
prerelease: false
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
106
|
+
requirements:
|
107
|
+
- - ~>
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '0.7'
|
110
|
+
description: A string validator for ActiveModel to verify it can be converted to the
|
111
|
+
specified encodings.
|
112
|
+
email: k.ejiri@gmail.com
|
113
|
+
executables: []
|
114
|
+
extensions: []
|
115
|
+
extra_rdoc_files:
|
116
|
+
- LICENSE.txt
|
117
|
+
- README.rdoc
|
118
|
+
files:
|
119
|
+
- .document
|
120
|
+
- .rspec
|
121
|
+
- .travis.yml
|
122
|
+
- Gemfile
|
123
|
+
- Gemfile.lock
|
124
|
+
- LICENSE.txt
|
125
|
+
- README.rdoc
|
126
|
+
- Rakefile
|
127
|
+
- VERSION
|
128
|
+
- encodable_validator.gemspec
|
129
|
+
- lib/active_model/validators/encodable_validator.rb
|
130
|
+
- lib/encodable_validator.rb
|
131
|
+
- locales/en.yml
|
132
|
+
- locales/ja.yml
|
133
|
+
- spec/encodable_validator_spec.rb
|
134
|
+
- spec/spec_helper.rb
|
135
|
+
homepage: http://github.com/eji/encodable_validator
|
136
|
+
licenses:
|
137
|
+
- MIT
|
138
|
+
post_install_message:
|
139
|
+
rdoc_options: []
|
140
|
+
require_paths:
|
141
|
+
- lib
|
142
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
143
|
+
none: false
|
144
|
+
requirements:
|
145
|
+
- - ! '>='
|
146
|
+
- !ruby/object:Gem::Version
|
147
|
+
version: '0'
|
148
|
+
segments:
|
149
|
+
- 0
|
150
|
+
hash: -4585558783132829965
|
151
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
152
|
+
none: false
|
153
|
+
requirements:
|
154
|
+
- - ! '>='
|
155
|
+
- !ruby/object:Gem::Version
|
156
|
+
version: '0'
|
157
|
+
requirements: []
|
158
|
+
rubyforge_project:
|
159
|
+
rubygems_version: 1.8.23
|
160
|
+
signing_key:
|
161
|
+
specification_version: 3
|
162
|
+
summary: A string validator for ActiveModel to verify it can be converted to the specified
|
163
|
+
encodings.
|
164
|
+
test_files: []
|