active_mocker 1.2.pre.1 → 1.2.pre.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/active_mocker/generate.rb +5 -0
- data/lib/active_mocker/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 086e96a5612addb22e4eea632520099b138de8d1
|
4
|
+
data.tar.gz: e0658178ae38b981e17fc9f45b62725c84aeadd6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4389ce464e807d5798f9806cf1e2a2e1118edaddd2c01806f9960268d89383cf5c32f78dbf2f53f78a4ed32cefdb856139241c469812a31ebc8dd2834ac9035a
|
7
|
+
data.tar.gz: d5d086d46b5728b13764e4bb3341dbc7e012476cd2866eedb0be888da34211ea4da57549b7826ff98a27c380050d55a5fab87655e2fe1c3f1a869218487fb488
|
@@ -54,6 +54,7 @@ class Generate
|
|
54
54
|
|
55
55
|
def create_template
|
56
56
|
tables.each do |table|
|
57
|
+
begin
|
57
58
|
mock_template = MockTemplate.new
|
58
59
|
# Schema Attributes
|
59
60
|
mock_template.class_name = mock_class_name(table.name)
|
@@ -74,6 +75,10 @@ class Generate
|
|
74
75
|
klass_str = mock_template.render( File.open(File.join(File.expand_path('../', __FILE__), 'mock_template.erb')).read)
|
75
76
|
FileUtils::mkdir_p mock_dir unless File.directory? mock_dir
|
76
77
|
File.open(File.join(mock_dir,"#{table.name.singularize}_mock.rb"), 'w').write(klass_str)
|
78
|
+
rescue
|
79
|
+
puts "failed to load #{table_to_model_file(table)} model"
|
80
|
+
next
|
81
|
+
end
|
77
82
|
end
|
78
83
|
|
79
84
|
end
|