medivo 0.1.16 → 0.1.17
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/medivo/version.rb +1 -1
- data/lib/pdf/medivo/pdf_group.rb +6 -1
- data/spec/dummy/log/test.log +32 -0
- data/spec/lib/pdf_group_spec.rb +23 -0
- metadata +19 -19
data/lib/medivo/version.rb
CHANGED
data/lib/pdf/medivo/pdf_group.rb
CHANGED
@@ -12,13 +12,18 @@ module Medivo
|
|
12
12
|
# to get the pdf call #pdf, or read the pdf byes, call #read
|
13
13
|
def self.create(&block)
|
14
14
|
raise "need to pass a block do create" unless block_given?
|
15
|
+
@self_before_instance_eval = eval "self", block.binding
|
15
16
|
pdf_group = PdfGroup.new
|
16
17
|
pdf_group.instance_eval &block
|
17
18
|
pdf_group.combine_pdfs
|
18
19
|
pdf_group
|
19
20
|
end
|
20
21
|
|
21
|
-
|
22
|
+
def method_missing(method, *args, &block)
|
23
|
+
@self_before_instance_eval = self.class.instance_variable_get :@self_before_instance_eval
|
24
|
+
@self_before_instance_eval.send method, *args, &block
|
25
|
+
end
|
26
|
+
|
22
27
|
def variable_fields(file_path, variables)
|
23
28
|
@pdfs << PdfGenerator.variable_fields(file_path, variables)
|
24
29
|
end
|
data/spec/dummy/log/test.log
CHANGED
@@ -247,3 +247,35 @@ Served asset /medivo/markerB.png - 200 OK (2ms)
|
|
247
247
|
|
248
248
|
Started GET "/assets/medivo/arrow.png" for 127.0.0.1 at 2011-11-07 16:38:06 -0500
|
249
249
|
Served asset /medivo/arrow.png - 200 OK (2ms)
|
250
|
+
|
251
|
+
|
252
|
+
Started GET "/medivo/labs/lab_data?zip_code=90210" for 127.0.0.1 at 2011-11-07 17:04:13 -0500
|
253
|
+
Processing by Medivo::LabsController#lab_data as HTML
|
254
|
+
Parameters: {"zip_code"=>"90210"}
|
255
|
+
Completed 200 OK in 347ms (Views: 1.0ms)
|
256
|
+
|
257
|
+
|
258
|
+
Started GET "/labs/lab_search?zip_code=90210" for 127.0.0.1 at 2011-11-07 17:04:16 -0500
|
259
|
+
Processing by LabsController#lab_search as HTML
|
260
|
+
Parameters: {"zip_code"=>"90210"}
|
261
|
+
Completed 200 OK in 289ms (Views: 92.2ms)
|
262
|
+
|
263
|
+
|
264
|
+
Started GET "/assets/application.css" for 127.0.0.1 at 2011-11-07 17:04:16 -0500
|
265
|
+
Served asset /application.css - 200 OK (4ms)
|
266
|
+
|
267
|
+
|
268
|
+
Started GET "/assets/application.js" for 127.0.0.1 at 2011-11-07 17:04:16 -0500
|
269
|
+
Served asset /application.js - 200 OK (20ms)
|
270
|
+
|
271
|
+
|
272
|
+
Started GET "/assets/medivo/markerA.png" for 127.0.0.1 at 2011-11-07 17:04:17 -0500
|
273
|
+
Served asset /medivo/markerA.png - 200 OK (1ms)
|
274
|
+
|
275
|
+
|
276
|
+
Started GET "/assets/medivo/markerB.png" for 127.0.0.1 at 2011-11-07 17:04:17 -0500
|
277
|
+
Served asset /medivo/markerB.png - 200 OK (1ms)
|
278
|
+
|
279
|
+
|
280
|
+
Started GET "/assets/medivo/arrow.png" for 127.0.0.1 at 2011-11-07 17:04:17 -0500
|
281
|
+
Served asset /medivo/arrow.png - 200 OK (2ms)
|
data/spec/lib/pdf_group_spec.rb
CHANGED
@@ -11,6 +11,29 @@ describe Medivo::PdfGroup do
|
|
11
11
|
pdf_group.read.should_not be_nil
|
12
12
|
end
|
13
13
|
|
14
|
+
it "can access the local scope of calling class" do
|
15
|
+
class OrderTest
|
16
|
+
attr_reader :requisition_id
|
17
|
+
|
18
|
+
def initialize(requisition_id)
|
19
|
+
@requisition_id = requisition_id
|
20
|
+
end
|
21
|
+
|
22
|
+
def pdf_requisition
|
23
|
+
pdf_group = Medivo::PdfGroup.create do
|
24
|
+
lab_requisition(requisition_id)
|
25
|
+
end
|
26
|
+
pdf_group
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
requisition_id = 170420
|
31
|
+
stub_order_requisition(requisition_id, medivo_fixture_path("lc_order_with_requisition.xml"))
|
32
|
+
order = OrderTest.new( requisition_id )
|
33
|
+
order.pdf_requisition.read.should_not be nil
|
34
|
+
end
|
35
|
+
|
36
|
+
|
14
37
|
it "#variable_fields" do
|
15
38
|
name = "Duderoni"
|
16
39
|
o = OpenStruct.new(:name=>name)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: medivo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.17
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -14,7 +14,7 @@ default_executable:
|
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rails
|
17
|
-
requirement: &
|
17
|
+
requirement: &2164485380 !ruby/object:Gem::Requirement
|
18
18
|
none: false
|
19
19
|
requirements:
|
20
20
|
- - ~>
|
@@ -22,10 +22,10 @@ dependencies:
|
|
22
22
|
version: 3.1.0
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
|
-
version_requirements: *
|
25
|
+
version_requirements: *2164485380
|
26
26
|
- !ruby/object:Gem::Dependency
|
27
27
|
name: jquery-rails
|
28
|
-
requirement: &
|
28
|
+
requirement: &2164484880 !ruby/object:Gem::Requirement
|
29
29
|
none: false
|
30
30
|
requirements:
|
31
31
|
- - ! '>='
|
@@ -33,10 +33,10 @@ dependencies:
|
|
33
33
|
version: '0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
|
-
version_requirements: *
|
36
|
+
version_requirements: *2164484880
|
37
37
|
- !ruby/object:Gem::Dependency
|
38
38
|
name: coffee-script
|
39
|
-
requirement: &
|
39
|
+
requirement: &2164484420 !ruby/object:Gem::Requirement
|
40
40
|
none: false
|
41
41
|
requirements:
|
42
42
|
- - ! '>='
|
@@ -44,10 +44,10 @@ dependencies:
|
|
44
44
|
version: '0'
|
45
45
|
type: :runtime
|
46
46
|
prerelease: false
|
47
|
-
version_requirements: *
|
47
|
+
version_requirements: *2164484420
|
48
48
|
- !ruby/object:Gem::Dependency
|
49
49
|
name: haml-rails
|
50
|
-
requirement: &
|
50
|
+
requirement: &2164484000 !ruby/object:Gem::Requirement
|
51
51
|
none: false
|
52
52
|
requirements:
|
53
53
|
- - ! '>='
|
@@ -55,10 +55,10 @@ dependencies:
|
|
55
55
|
version: '0'
|
56
56
|
type: :runtime
|
57
57
|
prerelease: false
|
58
|
-
version_requirements: *
|
58
|
+
version_requirements: *2164484000
|
59
59
|
- !ruby/object:Gem::Dependency
|
60
60
|
name: geocoder
|
61
|
-
requirement: &
|
61
|
+
requirement: &2164483580 !ruby/object:Gem::Requirement
|
62
62
|
none: false
|
63
63
|
requirements:
|
64
64
|
- - ! '>='
|
@@ -66,10 +66,10 @@ dependencies:
|
|
66
66
|
version: '0'
|
67
67
|
type: :runtime
|
68
68
|
prerelease: false
|
69
|
-
version_requirements: *
|
69
|
+
version_requirements: *2164483580
|
70
70
|
- !ruby/object:Gem::Dependency
|
71
71
|
name: rest-client
|
72
|
-
requirement: &
|
72
|
+
requirement: &2164483160 !ruby/object:Gem::Requirement
|
73
73
|
none: false
|
74
74
|
requirements:
|
75
75
|
- - ! '>='
|
@@ -77,10 +77,10 @@ dependencies:
|
|
77
77
|
version: '0'
|
78
78
|
type: :runtime
|
79
79
|
prerelease: false
|
80
|
-
version_requirements: *
|
80
|
+
version_requirements: *2164483160
|
81
81
|
- !ruby/object:Gem::Dependency
|
82
82
|
name: pdfkit
|
83
|
-
requirement: &
|
83
|
+
requirement: &2164482740 !ruby/object:Gem::Requirement
|
84
84
|
none: false
|
85
85
|
requirements:
|
86
86
|
- - ! '>='
|
@@ -88,10 +88,10 @@ dependencies:
|
|
88
88
|
version: '0'
|
89
89
|
type: :runtime
|
90
90
|
prerelease: false
|
91
|
-
version_requirements: *
|
91
|
+
version_requirements: *2164482740
|
92
92
|
- !ruby/object:Gem::Dependency
|
93
93
|
name: prawn
|
94
|
-
requirement: &
|
94
|
+
requirement: &2164482320 !ruby/object:Gem::Requirement
|
95
95
|
none: false
|
96
96
|
requirements:
|
97
97
|
- - ! '>='
|
@@ -99,7 +99,7 @@ dependencies:
|
|
99
99
|
version: '0'
|
100
100
|
type: :runtime
|
101
101
|
prerelease: false
|
102
|
-
version_requirements: *
|
102
|
+
version_requirements: *2164482320
|
103
103
|
description: Use the medivo platform to find lab locations, make labcorp appointments,
|
104
104
|
place lab orders
|
105
105
|
email:
|
@@ -293,7 +293,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
293
293
|
version: '0'
|
294
294
|
segments:
|
295
295
|
- 0
|
296
|
-
hash:
|
296
|
+
hash: 3335958519098433315
|
297
297
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
298
298
|
none: false
|
299
299
|
requirements:
|
@@ -302,7 +302,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
302
302
|
version: '0'
|
303
303
|
segments:
|
304
304
|
- 0
|
305
|
-
hash:
|
305
|
+
hash: 3335958519098433315
|
306
306
|
requirements: []
|
307
307
|
rubyforge_project:
|
308
308
|
rubygems_version: 1.6.2
|