activepesel 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (74) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +12 -18
  3. data/.rspec +1 -0
  4. data/.rubocop.yml +176 -0
  5. data/CHANGELOG.md +7 -0
  6. data/Gemfile +8 -2
  7. data/MIT-LICENSE +1 -1
  8. data/README.md +30 -18
  9. data/Rakefile +1 -38
  10. data/activepesel.gemspec +15 -15
  11. data/lib/active_model/validations/pesel_validator.rb +5 -3
  12. data/lib/activepesel/personal_data.rb +23 -18
  13. data/lib/activepesel/pesel.rb +22 -19
  14. data/lib/activepesel/pesel_attr.rb +5 -8
  15. data/lib/activepesel/pesel_generator.rb +47 -28
  16. data/lib/activepesel/version.rb +3 -1
  17. data/lib/activepesel.rb +8 -1
  18. data/media/id.jpg +0 -0
  19. data/spec/activepesel/pesel_attr_spec.rb +28 -0
  20. data/spec/activepesel/pesel_generator_spec.rb +70 -0
  21. data/spec/activepesel/pesel_spec.rb +98 -0
  22. data/spec/spec_helper.rb +23 -0
  23. metadata +27 -135
  24. data/.rvmrc +0 -1
  25. data/Gemfile.lock +0 -94
  26. data/lib/tasks/activepesel_tasks.rake +0 -4
  27. data/test/activepesel_test.rb +0 -7
  28. data/test/dummy/README.rdoc +0 -261
  29. data/test/dummy/Rakefile +0 -7
  30. data/test/dummy/app/assets/javascripts/application.js +0 -13
  31. data/test/dummy/app/assets/stylesheets/application.css +0 -13
  32. data/test/dummy/app/controllers/application_controller.rb +0 -3
  33. data/test/dummy/app/helpers/application_helper.rb +0 -2
  34. data/test/dummy/app/mailers/.gitkeep +0 -0
  35. data/test/dummy/app/models/#user.rb# +0 -9
  36. data/test/dummy/app/models/.gitkeep +0 -0
  37. data/test/dummy/app/models/user.rb +0 -9
  38. data/test/dummy/app/views/layouts/application.html.erb +0 -14
  39. data/test/dummy/config/application.rb +0 -65
  40. data/test/dummy/config/boot.rb +0 -10
  41. data/test/dummy/config/database.yml +0 -25
  42. data/test/dummy/config/environment.rb +0 -5
  43. data/test/dummy/config/environments/development.rb +0 -37
  44. data/test/dummy/config/environments/production.rb +0 -67
  45. data/test/dummy/config/environments/test.rb +0 -37
  46. data/test/dummy/config/initializers/backtrace_silencers.rb +0 -7
  47. data/test/dummy/config/initializers/inflections.rb +0 -15
  48. data/test/dummy/config/initializers/mime_types.rb +0 -5
  49. data/test/dummy/config/initializers/secret_token.rb +0 -7
  50. data/test/dummy/config/initializers/session_store.rb +0 -8
  51. data/test/dummy/config/initializers/wrap_parameters.rb +0 -14
  52. data/test/dummy/config/locales/en.yml +0 -5
  53. data/test/dummy/config/routes.rb +0 -58
  54. data/test/dummy/config.ru +0 -4
  55. data/test/dummy/db/development.sqlite3 +0 -0
  56. data/test/dummy/db/migrate/20121114223156_create_users.rb +0 -10
  57. data/test/dummy/db/schema.rb +0 -23
  58. data/test/dummy/db/test.sqlite3 +0 -0
  59. data/test/dummy/lib/assets/.gitkeep +0 -0
  60. data/test/dummy/log/.gitkeep +0 -0
  61. data/test/dummy/log/development.log +0 -96
  62. data/test/dummy/log/test.log +0 -12541
  63. data/test/dummy/public/404.html +0 -26
  64. data/test/dummy/public/422.html +0 -26
  65. data/test/dummy/public/500.html +0 -25
  66. data/test/dummy/public/favicon.ico +0 -0
  67. data/test/dummy/script/rails +0 -6
  68. data/test/dummy/test/fixtures/users.yml +0 -37
  69. data/test/dummy/test/unit/user_test.rb +0 -7
  70. data/test/pesel_attr_test.rb +0 -62
  71. data/test/pesel_generator_test.rb +0 -46
  72. data/test/pesel_test.rb +0 -66
  73. data/test/pesel_validator_test.rb +0 -29
  74. data/test/test_helper.rb +0 -15
@@ -1,14 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
- #
3
- # This file contains settings for ActionController::ParamsWrapper which
4
- # is enabled by default.
5
-
6
- # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7
- ActiveSupport.on_load(:action_controller) do
8
- wrap_parameters format: [:json]
9
- end
10
-
11
- # Disable root element in JSON by default.
12
- ActiveSupport.on_load(:active_record) do
13
- self.include_root_in_json = false
14
- end
@@ -1,5 +0,0 @@
1
- # Sample localization file for English. Add more files in this directory for other locales.
2
- # See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
3
-
4
- en:
5
- hello: "Hello world"
@@ -1,58 +0,0 @@
1
- Dummy::Application.routes.draw do
2
- # The priority is based upon order of creation:
3
- # first created -> highest priority.
4
-
5
- # Sample of regular route:
6
- # match 'products/:id' => 'catalog#view'
7
- # Keep in mind you can assign values other than :controller and :action
8
-
9
- # Sample of named route:
10
- # match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase
11
- # This route can be invoked with purchase_url(:id => product.id)
12
-
13
- # Sample resource route (maps HTTP verbs to controller actions automatically):
14
- # resources :products
15
-
16
- # Sample resource route with options:
17
- # resources :products do
18
- # member do
19
- # get 'short'
20
- # post 'toggle'
21
- # end
22
- #
23
- # collection do
24
- # get 'sold'
25
- # end
26
- # end
27
-
28
- # Sample resource route with sub-resources:
29
- # resources :products do
30
- # resources :comments, :sales
31
- # resource :seller
32
- # end
33
-
34
- # Sample resource route with more complex sub-resources
35
- # resources :products do
36
- # resources :comments
37
- # resources :sales do
38
- # get 'recent', :on => :collection
39
- # end
40
- # end
41
-
42
- # Sample resource route within a namespace:
43
- # namespace :admin do
44
- # # Directs /admin/products/* to Admin::ProductsController
45
- # # (app/controllers/admin/products_controller.rb)
46
- # resources :products
47
- # end
48
-
49
- # You can have the root of your site routed with "root"
50
- # just remember to delete public/index.html.
51
- # root :to => 'welcome#index'
52
-
53
- # See how all your routes lay out with "rake routes"
54
-
55
- # This is a legacy wild controller route that's not recommended for RESTful applications.
56
- # Note: This route will make all actions in every controller accessible via GET requests.
57
- # match ':controller(/:action(/:id))(.:format)'
58
- end
data/test/dummy/config.ru DELETED
@@ -1,4 +0,0 @@
1
- # This file is used by Rack-based servers to start the application.
2
-
3
- require ::File.expand_path('../config/environment', __FILE__)
4
- run Dummy::Application
Binary file
@@ -1,10 +0,0 @@
1
- class CreateUsers < ActiveRecord::Migration
2
- def change
3
- create_table :users do |t|
4
- t.string :mums_pesel
5
- t.string :dads_pesel
6
-
7
- t.timestamps
8
- end
9
- end
10
- end
@@ -1,23 +0,0 @@
1
- # encoding: UTF-8
2
- # This file is auto-generated from the current state of the database. Instead
3
- # of editing this file, please use the migrations feature of Active Record to
4
- # incrementally modify your database, and then regenerate this schema definition.
5
- #
6
- # Note that this schema.rb definition is the authoritative source for your
7
- # database schema. If you need to create the application database on another
8
- # system, you should be using db:schema:load, not running all the migrations
9
- # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10
- # you'll amass, the slower it'll run and the greater likelihood for issues).
11
- #
12
- # It's strongly recommended to check this file into your version control system.
13
-
14
- ActiveRecord::Schema.define(:version => 20121114223156) do
15
-
16
- create_table "users", :force => true do |t|
17
- t.string "mums_pesel"
18
- t.string "dads_pesel"
19
- t.datetime "created_at", :null => false
20
- t.datetime "updated_at", :null => false
21
- end
22
-
23
- end
Binary file
File without changes
File without changes
@@ -1,96 +0,0 @@
1
- Connecting to database specified by database.yml
2
- Connecting to database specified by database.yml
3
-  (0.1ms) select sqlite_version(*)
4
-  (1.6ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
5
-  (2.0ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
6
-  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations"
7
- Migrating to CreateUsers (20121114223156)
8
-  (0.0ms) begin transaction
9
-  (0.4ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "mums_pesel" varchar(255), "dads_pesel" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
10
-  (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ('20121114223156')
11
-  (1.2ms) commit transaction
12
-  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
13
- Connecting to database specified by database.yml
14
-  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
15
-  (0.2ms) select sqlite_version(*)
16
-  (1.5ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "mums_pesel" varchar(255), "dads_pesel" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
17
-  (1.9ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
18
-  (1.3ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
19
-  (0.1ms) SELECT version FROM "schema_migrations"
20
-  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20121114223156')
21
- Connecting to database specified by database.yml
22
- Connecting to database specified by database.yml
23
- Connecting to database specified by database.yml
24
- Connecting to database specified by database.yml
25
- Connecting to database specified by database.yml
26
-  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
27
-  (0.2ms) select sqlite_version(*)
28
-  (1.7ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "mums_pesel" varchar(255), "dads_pesel" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
29
-  (1.3ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
30
-  (0.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
31
-  (0.1ms) SELECT version FROM "schema_migrations"
32
-  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES ('20121114223156')
33
- Connecting to database specified by database.yml
34
- Connecting to database specified by database.yml
35
- Connecting to database specified by database.yml
36
-  (26.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
37
-  (0.2ms) select sqlite_version(*)
38
-  (12.5ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "mums_pesel" varchar(255), "dads_pesel" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
39
-  (1.2ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
40
-  (16.6ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
41
-  (0.1ms) SELECT version FROM "schema_migrations"
42
-  (2.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20121114223156')
43
- Connecting to database specified by database.yml
44
-  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
45
-  (0.2ms) select sqlite_version(*)
46
-  (1.1ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "mums_pesel" varchar(255), "dads_pesel" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
47
-  (0.9ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
48
-  (0.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
49
-  (0.1ms) SELECT version FROM "schema_migrations"
50
-  (2.0ms) INSERT INTO "schema_migrations" (version) VALUES ('20121114223156')
51
- Connecting to database specified by database.yml
52
- Connecting to database specified by database.yml
53
- Connecting to database specified by database.yml
54
- Connecting to database specified by database.yml
55
-  (0.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
56
-  (0.3ms) select sqlite_version(*)
57
-  (2.6ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "mums_pesel" varchar(255), "dads_pesel" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
58
-  (1.4ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
59
-  (1.2ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
60
-  (0.1ms) SELECT version FROM "schema_migrations"
61
-  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES ('20121114223156')
62
- Connecting to database specified by database.yml
63
- Connecting to database specified by database.yml
64
-  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
65
-  (0.3ms) select sqlite_version(*)
66
-  (1.9ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "mums_pesel" varchar(255), "dads_pesel" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
67
-  (2.0ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
68
-  (2.2ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
69
-  (0.2ms) SELECT version FROM "schema_migrations"
70
-  (1.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20121114223156')
71
- Connecting to database specified by database.yml
72
- Connecting to database specified by database.yml
73
- Connecting to database specified by database.yml
74
- Connecting to database specified by database.yml
75
- Connecting to database specified by database.yml
76
- Connecting to database specified by database.yml
77
- Connecting to database specified by database.yml
78
- Connecting to database specified by database.yml
79
- Connecting to database specified by database.yml
80
- Connecting to database specified by database.yml
81
- Connecting to database specified by database.yml
82
- Connecting to database specified by database.yml
83
- Connecting to database specified by database.yml
84
- Connecting to database specified by database.yml
85
- Connecting to database specified by database.yml
86
- Connecting to database specified by database.yml
87
- Connecting to database specified by database.yml
88
- Connecting to database specified by database.yml
89
- Connecting to database specified by database.yml
90
- Connecting to database specified by database.yml
91
- Connecting to database specified by database.yml
92
- Connecting to database specified by database.yml
93
- Connecting to database specified by database.yml
94
- Connecting to database specified by database.yml
95
- Connecting to database specified by database.yml
96
- Connecting to database specified by database.yml