color-schema-validator 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 275b6a5dd6f14e09ad3bb71399818f1994b77b69
4
- data.tar.gz: 7ce31a47f75d17b73f04b48ade448476361b67a9
3
+ metadata.gz: 037da6d6e7b62198a739c4b9bc9d4d4174bed1b7
4
+ data.tar.gz: b9fcbc7ad17077cf646724349ff31aab9b94e62a
5
5
  SHA512:
6
- metadata.gz: cb059a525dfda9a564797f918310e16c23b229403e09606302afc9a9037a29240832372c548b81cfa7026fc77a56539d848412aa89f86a51bc5af2946ac8b9f0
7
- data.tar.gz: fa84ec72ac87847fcf3ae09e862876d2c8455ea4f2c52459dff1f5ac93ac7388202844ba23ddbc9f8215009cbf7bbbfde8d4db390c6fe0d5997448172f87c495
6
+ metadata.gz: 7e028f267cdf7dc2462d5c3b05b7e38608ea2433e590261c8daa20afa0c29fba5edce3dc53f34d050326ea91db2470fb0a615d166e43d5329f2e0d8540511be9
7
+ data.tar.gz: 0e6dade994288a7d13a75d264c5c72d8b646c09af14970880d71055ce9b48b15522f77b66e2218be1c8ddfe4e3312e7bbb76f2dacf4557087470463921745789
@@ -0,0 +1,6 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.0.0
4
+ - 2.1.0
5
+ - 2.2.2
6
+ before_install: gem install bundler -v 1.10.6
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2015 ka
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # ColorSchemaValidator
2
2
 
3
+ [![Gem Version](https://badge.fury.io/rb/color-schema-validator.svg)](http://badge.fury.io/rb/color-schema-validator)
4
+ [![Dependency Status](https://gemnasium.com/kaosf/color-schema-validator.svg)](https://gemnasium.com/kaosf/color-schema-validator)
5
+ [![Build Status](https://travis-ci.org/kaosf/color-schema-validator.svg)](https://travis-ci.org/kaosf/color-schema-validator)
6
+ [![Code Climate](https://codeclimate.com/github/kaosf/color-schema-validator/badges/gpa.svg)](https://codeclimate.com/github/kaosf/color-schema-validator)
7
+
3
8
  Color schema validator for Rails.
4
9
 
5
10
  Like `#FF0000`, `#00ff00` and `#00f` strings are allowed.
@@ -18,10 +23,6 @@ And then execute:
18
23
 
19
24
  $ bundle
20
25
 
21
- Or install it yourself as:
22
-
23
- $ gem install color-schema-validator
24
-
25
26
  ## Usage
26
27
 
27
28
  ```ruby
@@ -40,3 +41,13 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
40
41
 
41
42
  Bug reports and pull requests are welcome on GitHub at https://github.com/kaosf/color-schema-validator.
42
43
 
44
+ ## References
45
+
46
+ * [shirasagi/email_validator.rb at 3e6b88b741048af6ca15e90236964b84da8c7fe6 · shirasagi/shirasagi](https://github.com/shirasagi/shirasagi/blob/3e6b88b741048af6ca15e90236964b84da8c7fe6/app/validators/email_validator.rb)
47
+ * [balexand/email_validator](https://github.com/balexand/email_validator)
48
+
49
+ ## License
50
+
51
+ [MIT](http://opensource.org/licenses/MIT)
52
+
53
+ Copyright (C) 2015 ka
data/Rakefile CHANGED
@@ -1 +1,10 @@
1
1
  require "bundler/gem_tasks"
2
+ require "rake/testtask"
3
+
4
+ Rake::TestTask.new do |t|
5
+ t.libs << "test"
6
+ t.test_files = Dir["test/**/test_*.rb"]
7
+ t.verbose = true
8
+ end
9
+
10
+ task default: :test
@@ -4,21 +4,23 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "color-schema-validator"
7
- spec.version = "0.1.0"
7
+ spec.version = "0.1.1"
8
8
  spec.authors = ["ka"]
9
9
  spec.email = ["ka.kaosf@gmail.com"]
10
10
 
11
11
  spec.summary = %q{Color schema validator for Rails.}
12
12
  spec.description = %q{Color schema validator for Rails.}
13
13
  spec.homepage = "https://github.com/kaosf/color-schema-validator"
14
+ spec.license = "MIT"
14
15
 
15
16
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
16
17
  spec.bindir = "exe"
17
18
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
18
19
  spec.require_paths = ["lib"]
19
20
 
20
- spec.add_dependency("activemodel", ">= 0")
21
+ spec.add_dependency("activemodel", "~> 4.0")
21
22
 
22
23
  spec.add_development_dependency "bundler", "~> 1.10"
23
24
  spec.add_development_dependency "rake", "~> 10.0"
25
+ spec.add_development_dependency "test-unit", "~> 3.1.3"
24
26
  end
@@ -1,6 +1,6 @@
1
1
  class ColorSchemaValidator < ActiveModel::EachValidator
2
2
  def validate_each(record, attribute, value)
3
- unless value =~ /^#(\h{6}|\h{3})$/
3
+ unless value =~ /\A#(\h{6}|\h{3})\z/
4
4
  record.errors.add(attribute, options[:message] || :invalid)
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: color-schema-validator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - ka
@@ -14,16 +14,16 @@ dependencies:
14
14
  name: activemodel
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: '4.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0'
26
+ version: '4.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '10.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: test-unit
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: 3.1.3
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: 3.1.3
55
69
  description: Color schema validator for Rails.
56
70
  email:
57
71
  - ka.kaosf@gmail.com
@@ -60,7 +74,9 @@ extensions: []
60
74
  extra_rdoc_files: []
61
75
  files:
62
76
  - ".gitignore"
77
+ - ".travis.yml"
63
78
  - Gemfile
79
+ - LICENSE.txt
64
80
  - README.md
65
81
  - Rakefile
66
82
  - bin/console
@@ -68,7 +84,8 @@ files:
68
84
  - color-schema-validator.gemspec
69
85
  - lib/color-schema-validator.rb
70
86
  homepage: https://github.com/kaosf/color-schema-validator
71
- licenses: []
87
+ licenses:
88
+ - MIT
72
89
  metadata: {}
73
90
  post_install_message:
74
91
  rdoc_options: []
@@ -91,3 +108,4 @@ signing_key:
91
108
  specification_version: 4
92
109
  summary: Color schema validator for Rails.
93
110
  test_files: []
111
+ has_rdoc: