rs.ge 0.0.13 → 0.0.14

Sign up to get free protection for your applications and to get access to all the features.
data/lib/rs.rb CHANGED
@@ -6,6 +6,7 @@ require 'rs/dict'
6
6
  require 'rs/waybill'
7
7
  require 'rs/print'
8
8
  require 'rs/invoice'
9
+ require 'rs/car'
9
10
 
10
11
  module RS
11
12
  # ელქტრონული ზედნადების ფორმის WSDL მისამართი
@@ -72,5 +73,4 @@ module RS
72
73
  end
73
74
  params['attributes!'] = attributes unless attributes.empty?
74
75
  end
75
-
76
- end
76
+ end
data/lib/rs/car.rb ADDED
@@ -0,0 +1,6 @@
1
+ # -*- encoding : utf-8 -*-
2
+ module RS
3
+ def self.valid_vehicle_number?(num)
4
+ not not (num =~ /^[a-zA-Z]{3}[0-9]{3}$/)
5
+ end
6
+ end
data/lib/rs/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
 
3
3
  module RS
4
- VERSION = '0.0.13'
4
+ VERSION = '0.0.14'
5
5
  end
data/lib/rs/waybill.rb CHANGED
@@ -266,6 +266,9 @@ module RS
266
266
  unless RS.is_valid_personal_tin(self.driver_tin)
267
267
  RS.append_validation_error(@validation_errors, :driver_tin, 'მძღოლის პირადი ნომერი არასწორია')
268
268
  end
269
+ unless RS.valid_vehicle_number?(self.car_number)
270
+ RS.append_validation_error(@validation_errors, :car_number, 'არასწორი მანქანის ნომერი: ჩაწერეთ ABC123 ფორმატში!')
271
+ end
269
272
  else
270
273
  if self.driver_name.nil? or self.driver_name.strip.empty?
271
274
  RS.append_validation_error(@validation_errors, :driver_name, 'ჩაწერეთ მძღოლის სახელი')
data/rs.gemspec CHANGED
@@ -24,5 +24,5 @@ Gem::Specification.new do |s|
24
24
  s.add_runtime_dependency 'savon'
25
25
  s.add_runtime_dependency 'httpi'
26
26
  s.add_runtime_dependency 'prawn', '~>0.12'
27
- s.add_runtime_dependency 'c12-commons'
28
- end
27
+ s.add_runtime_dependency 'c12-commons', '~> 0.0.5'
28
+ end
@@ -0,0 +1,25 @@
1
+ # -*- encoding : utf-8 -*-
2
+
3
+ require 'spec_helper'
4
+
5
+ def valid_vehicle_number(number)
6
+ describe "#{number} სწორი სახელმწიფო ნომერია" do
7
+ it { RS.valid_vehicle_number?(number).should == true }
8
+ end
9
+ end
10
+
11
+ def invalid_vehicle_number(number)
12
+ describe "#{number} არასწორი სახელმწიფო ნომერია" do
13
+ it { RS.valid_vehicle_number?(number).should == false }
14
+ end
15
+ end
16
+
17
+ describe 'მანქანის ნომრების შემოწმება' do
18
+ valid_vehicle_number 'WDW842'
19
+ valid_vehicle_number 'KFK061'
20
+ valid_vehicle_number 'wdw467'
21
+ valid_vehicle_number 'kfk061'
22
+ invalid_vehicle_number 'WDW-842'
23
+ invalid_vehicle_number 'Subaru WDW842'
24
+ invalid_vehicle_number 'Mercedes KFK061'
25
+ end
data/tmp/waybill.pdf CHANGED
@@ -173,7 +173,7 @@ S
173
173
  BT
174
174
  216.128 787.246 Td
175
175
  /F1.0 7 Tf
176
- <313720> Tj
176
+ <323620> Tj
177
177
  /F1.1 7 Tf
178
178
  <2d222e2f2b20> Tj
179
179
  /F1.0 7 Tf
@@ -243,7 +243,11 @@ S
243
243
  BT
244
244
  367.06 787.246 Td
245
245
  /F1.0 7 Tf
246
- <30303a3234> Tj
246
+ <<<<<<< HEAD
247
+ <31343a3538> Tj
248
+ =======
249
+ <32303a3534> Tj
250
+ >>>>>>> 84f0ea474301dd0749ab57c9daca9a0af5902545
247
251
  ET
248
252
 
249
253
  0.000 0.000 0.000 scn
@@ -6027,7 +6031,7 @@ S
6027
6031
  BT
6028
6032
  328.628 112.88399999999965 Td
6029
6033
  /F1.0 7 Tf
6030
- <313720> Tj
6034
+ <323620> Tj
6031
6035
  /F1.1 7 Tf
6032
6036
  <2d222e2f2b20> Tj
6033
6037
  /F1.0 7 Tf
@@ -6064,7 +6068,11 @@ S
6064
6068
  BT
6065
6069
  439.56 112.88399999999965 Td
6066
6070
  /F1.0 7 Tf
6067
- <30303a3234> Tj
6071
+ <<<<<<< HEAD
6072
+ <31343a3538> Tj
6073
+ =======
6074
+ <32303a3534> Tj
6075
+ >>>>>>> 84f0ea474301dd0749ab57c9daca9a0af5902545
6068
6076
  ET
6069
6077
 
6070
6078
  0.000 0.000 0.000 scn
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rs.ge
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.13
4
+ version: 0.0.14
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-03-19 00:00:00.000000000 Z
12
+ date: 2012-03-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
@@ -96,17 +96,17 @@ dependencies:
96
96
  requirement: !ruby/object:Gem::Requirement
97
97
  none: false
98
98
  requirements:
99
- - - ! '>='
99
+ - - ~>
100
100
  - !ruby/object:Gem::Version
101
- version: '0'
101
+ version: 0.0.5
102
102
  type: :runtime
103
103
  prerelease: false
104
104
  version_requirements: !ruby/object:Gem::Requirement
105
105
  none: false
106
106
  requirements:
107
- - - ! '>='
107
+ - - ~>
108
108
  - !ruby/object:Gem::Version
109
- version: '0'
109
+ version: 0.0.5
110
110
  description: ruby client for rs.ge web services
111
111
  email:
112
112
  - dimitri@c12.ge
@@ -121,6 +121,7 @@ files:
121
121
  - README.md
122
122
  - Rakefile
123
123
  - lib/rs.rb
124
+ - lib/rs/car.rb
124
125
  - lib/rs/dict.rb
125
126
  - lib/rs/invoice.rb
126
127
  - lib/rs/print.rb
@@ -128,6 +129,7 @@ files:
128
129
  - lib/rs/version.rb
129
130
  - lib/rs/waybill.rb
130
131
  - rs.gemspec
132
+ - spec/rs/car_spec.rb
131
133
  - spec/rs/dict_spec.rb
132
134
  - spec/rs/open_user.rb
133
135
  - spec/rs/pdf_spec.rb