baja 0.7.2 → 0.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/baja/version.rb +1 -1
- data/lib/baja.rb +19 -5
- 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: d218f6339e7b4537a7eb1f60af026cbaff8830cc
|
4
|
+
data.tar.gz: 455c35f8f865d7bfcb7a5b0d68ca360cd5c0e899
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d22013b4aa458ebbfa1c7b7c6e4a90f5bbc27af7763e32deeacc84c9047551ce33cbb0374de7907618d5138bd0318f47e29ec40b213a251ab37a6e4c66d40044
|
7
|
+
data.tar.gz: 23dff2cb1859ab973768728f66f4f566cf5fc7d8e7dabc2302c8e2b069168e69efa8e2ad5ef924296cf8602a06991e23ac9e5b04ec786a75f069ae5381bf30b7
|
data/lib/baja/version.rb
CHANGED
data/lib/baja.rb
CHANGED
@@ -11,10 +11,11 @@ module Baja
|
|
11
11
|
|
12
12
|
class Blast
|
13
13
|
@@definition_file_paths = %w(factories test/factories spec/factories)
|
14
|
+
@@baja
|
14
15
|
def self.now!
|
15
|
-
baja = YAML.load_file('baja.yml')
|
16
|
-
baja = JSON.parse(baja.to_json,:symbolize_names => true)
|
17
|
-
baja[:factories].each do |dew|
|
16
|
+
@@baja = YAML.load_file('baja.yml')
|
17
|
+
@@baja = JSON.parse(baja.to_json,:symbolize_names => true)
|
18
|
+
@@baja[:factories].each do |dew|
|
18
19
|
puts "drinking"
|
19
20
|
drink = IO.popen("bundle show #{dew}").readline.strip
|
20
21
|
@@definition_file_paths << Pathname.new("#{drink}/spec/factories")
|
@@ -24,6 +25,9 @@ module Baja
|
|
24
25
|
puts "throwing it down!"
|
25
26
|
|
26
27
|
|
28
|
+
end
|
29
|
+
def self.baja
|
30
|
+
@@baja
|
27
31
|
end
|
28
32
|
def self.definition_file_paths
|
29
33
|
@@definition_file_paths
|
@@ -71,9 +75,19 @@ module FactoryLoad
|
|
71
75
|
class FactoryGirl::Syntax::Default::DSL
|
72
76
|
|
73
77
|
def factory(name, options = {}, &block)
|
74
|
-
puts "path: #{FactoryLoad.path}"
|
78
|
+
puts "path: #{FactoryLoad.path}"
|
75
79
|
options[:class] = name.to_s.gsub(/_list/,'') unless options.has_key?(:class)
|
76
|
-
|
80
|
+
|
81
|
+
unless @namespace.nil?
|
82
|
+
name = :"#{@namespace}__#{name.to_s}"
|
83
|
+
else
|
84
|
+
@@baja.each do |dew|
|
85
|
+
if FactoryLoad.path.include?(dew)
|
86
|
+
name = :"#{dew}__#{name.to_s}"
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
77
91
|
puts name
|
78
92
|
factory = FactoryGirl::Factory.new(name, options)
|
79
93
|
proxy = FactoryGirl::DefinitionProxy.new(factory.definition)
|