poodle-rb 0.2.3 → 0.2.4

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: 812504354a6d12d22d352c329bcfdc8ec487bc6f
4
- data.tar.gz: ff931ed95f7ee892764b344361431b69264e7e0d
3
+ metadata.gz: 8a01889c4caeef51ea74be834a7be5c591b67593
4
+ data.tar.gz: 4a18aadf18b2baad3bea256d0c56babaa363bb3c
5
5
  SHA512:
6
- metadata.gz: 90aeb6b5f22ab32449061e10e65dae10ae3723317c007b4bc3ddb21ddea4681cbdb0ad9bec016baf4dd4e0d2ce9d186e79cdfbd26ea9dcdbf5ca60600a593789
7
- data.tar.gz: a26c056575d86264a2ed3cfd507a89cb51010730cfd669d9a0c0c6d862253004a9c66191694142348e195e5e05d9f4fe2a1eaa445adc3d4bf7d3d62ef15bd0fc
6
+ metadata.gz: ab0479de269a63656b3df7deb693e0230a40161e85755e9295b25846bed42b606350f7ff2d09e5c19871bc6f2ad3816cb6e62fb17331f6dfc17cd5dd76003274
7
+ data.tar.gz: d57a5c4a9937c6ceefff7624267f85ecadf4e168604ed78e99fede4ce27c519cbba36b657cec859f08c4eeb227bd30758582a36f2e60d3e687cf3025d6f08e09
@@ -123,7 +123,7 @@ module Poodle
123
123
 
124
124
  begin
125
125
  image_path = user.send(:eval, method_name)
126
- if image_path && image_path.starts_with?("http")
126
+ if image_path.starts_with?(:http)
127
127
  url = image_path
128
128
  else
129
129
  url = options[:url_domain] + image_path
@@ -1,6 +1,7 @@
1
1
  module PoodleValidators
2
2
 
3
3
  def generate_validation_options(attribute, options)
4
+ {a: 1}
4
5
  reg_exp = /\A[a-zA-Z1-9\-\ \(\)\.+]*\z/i
5
6
  options.reverse_merge!(
6
7
  presence: true,
@@ -37,7 +38,7 @@ module PoodleValidators
37
38
 
38
39
  def validate_username(attribute, **options)
39
40
  reg_exp = /\A[a-zA-Z0-9\_]*\z/
40
- options.merge!(mandatory: true, max_length: 3, max_length: 128, format: reg_exp, :uniqueness => {:case_sensitive => false})
41
+ options.merge!(mandatory: true, min_length: 3, max_length: 128, format: reg_exp, :uniqueness => {:case_sensitive => false})
41
42
  voptions = generate_validation_options(attribute, options)
42
43
  validates attribute, **voptions
43
44
  end
@@ -49,6 +50,21 @@ module PoodleValidators
49
50
  validates attribute, **voptions
50
51
  end
51
52
 
53
+ # format can be either :us or :indian
54
+ def validate_phone(attribute, **options)
55
+ options.reverse_merge!(phone_format: :indian)
56
+ if options[:phone_format] == :us
57
+ reg_exp = /\A[0-9]{3}[-][0-9]{3}[-][0-9]{4}\z/
58
+ length = 12
59
+ else
60
+ reg_exp = /\A[0-9]{10}\z/
61
+ length = 10
62
+ end
63
+ options.merge!(format: reg_exp, min_length: length, max_length: length)
64
+ options.reverse_merge!(numericality: true, mandatory: true, uniqueness: true)
65
+ validates attribute, **options
66
+ end
67
+
52
68
  def validate_password(attribute, **options)
53
69
  reg_exp = /\A(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9!@$#&*_\.,;:])/
54
70
  options.merge!(mandatory: true, format: reg_exp, min_length: 7, max_length: 256)
@@ -1,3 +1,3 @@
1
1
  module Poodle
2
- VERSION = "0.2.3"
2
+ VERSION = "0.2.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: poodle-rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Krishnaprasad Varma
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-20 00:00:00.000000000 Z
11
+ date: 2015-06-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: kaminari
@@ -410,8 +410,6 @@ files:
410
410
  - spec/dummy/db/migrate/20140402113213_create_users.rb
411
411
  - spec/dummy/db/schema.rb
412
412
  - spec/dummy/db/test.sqlite3
413
- - spec/dummy/log/development.log
414
- - spec/dummy/log/test.log
415
413
  - spec/dummy/public/404.html
416
414
  - spec/dummy/public/422.html
417
415
  - spec/dummy/public/500.html
@@ -422,14 +420,6 @@ files:
422
420
  - spec/dummy/spec/support/factories/profile_pictures.rb
423
421
  - spec/dummy/spec/support/factories/test.jpg
424
422
  - spec/dummy/spec/support/factories/users.rb
425
- - spec/dummy/uploads/image/profile_picture/1/large_test.jpg
426
- - spec/dummy/uploads/image/profile_picture/1/medium_test.jpg
427
- - spec/dummy/uploads/image/profile_picture/1/test.jpg
428
- - spec/dummy/uploads/image/profile_picture/1/thumb_test.jpg
429
- - spec/dummy/uploads/image/profile_picture/2/large_test.jpg
430
- - spec/dummy/uploads/image/profile_picture/2/medium_test.jpg
431
- - spec/dummy/uploads/image/profile_picture/2/test.jpg
432
- - spec/dummy/uploads/image/profile_picture/2/thumb_test.jpg
433
423
  - spec/spec_helper.rb
434
424
  homepage: http://kpvarma.com
435
425
  licenses:
@@ -451,7 +441,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
451
441
  version: '0'
452
442
  requirements: []
453
443
  rubyforge_project:
454
- rubygems_version: 2.2.0
444
+ rubygems_version: 2.4.5
455
445
  signing_key:
456
446
  specification_version: 4
457
447
  summary: Poodle is Rails Starter Kit
@@ -501,8 +491,6 @@ test_files:
501
491
  - spec/dummy/db/migrate/20140402113213_create_users.rb
502
492
  - spec/dummy/db/schema.rb
503
493
  - spec/dummy/db/test.sqlite3
504
- - spec/dummy/log/development.log
505
- - spec/dummy/log/test.log
506
494
  - spec/dummy/public/404.html
507
495
  - spec/dummy/public/422.html
508
496
  - spec/dummy/public/500.html
@@ -515,13 +503,5 @@ test_files:
515
503
  - spec/dummy/spec/support/factories/profile_pictures.rb
516
504
  - spec/dummy/spec/support/factories/test.jpg
517
505
  - spec/dummy/spec/support/factories/users.rb
518
- - spec/dummy/uploads/image/profile_picture/1/large_test.jpg
519
- - spec/dummy/uploads/image/profile_picture/1/medium_test.jpg
520
- - spec/dummy/uploads/image/profile_picture/1/test.jpg
521
- - spec/dummy/uploads/image/profile_picture/1/thumb_test.jpg
522
- - spec/dummy/uploads/image/profile_picture/2/large_test.jpg
523
- - spec/dummy/uploads/image/profile_picture/2/medium_test.jpg
524
- - spec/dummy/uploads/image/profile_picture/2/test.jpg
525
- - spec/dummy/uploads/image/profile_picture/2/thumb_test.jpg
526
506
  - spec/spec_helper.rb
527
507
  has_rdoc:
File without changes