baja 0.6.6 → 0.6.7

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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/baja/version.rb +1 -1
  3. data/lib/baja.rb +32 -32
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7865790b5076e7a83469d1c8650e8cfb3ce8f0b1
4
- data.tar.gz: dc2190fa49db5c7c444cc4302a16df45bf0d0f6e
3
+ metadata.gz: c45e7bc26e75b78ce72209fab907c4e30ea91bdd
4
+ data.tar.gz: b8d4446f7d602adf4d44b34f594825dad2daec7c
5
5
  SHA512:
6
- metadata.gz: 7a62091474c6a202a757762efca1b133815b71c4f68d0f3e6804b967661618cbf0b608fb8464793f63c6f787bb2b10efed13fca405c277091ccfc743c4a7b1a3
7
- data.tar.gz: f18c5ba8e48f656966da2dfe59de251842e6cadc26ce6b5091f683a9ae0b31a95591518fad7e29778ef99c4811c48447ae74f1fc3183a7b5641a9276cf556a51
6
+ metadata.gz: eadd74f1339ff8ca9c642039678ee1314322e50d5a6777216a1e00a979cbd16a4c7d9e909fbd28010610f8322f70266d60eb8f5098574bab73e095ef432850bb
7
+ data.tar.gz: 147c3f33fce5865975eb7c8c8c36fefd6091e8c9535242a124b65686958231235565a5553f031d2753a098c7a523339be6d3788fa43d2e21db628d853225ed98
data/lib/baja/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Baja
2
- VERSION = "0.6.6"
2
+ VERSION = "0.6.7"
3
3
  end
data/lib/baja.rb CHANGED
@@ -25,7 +25,37 @@ module Baja
25
25
  load "tasks/baja.rake"
26
26
  end
27
27
  end
28
+ module FactoryLoad
29
+ @@path
30
+ def self.load_path(path)
31
+ @@path = path
32
+ puts path
33
+ load(path)
34
+ end
35
+ def self.path
36
+ @@path
37
+ end
38
+ FactoryGirl::Syntax::Default::DSL
39
+ class FactoryGirl::Syntax::Default::DSL
40
+
41
+ def factory(name, options = {}, &block)
42
+ puts "path: #{FactoryLoad.path}"
43
+ options[:class] = name.to_s.gsub(/_list/,'') unless options.has_key?(:class)
44
+ name = :"#{@namespace}___#{name.to_s}" unless @namespace.nil?
45
+ puts name
46
+ factory = FactoryGirl::Factory.new(name, options)
47
+ proxy = FactoryGirl::DefinitionProxy.new(factory.definition)
48
+ proxy.instance_eval(&block) if block_given?
49
+
50
+ FactoryGirl.register_factory(factory)
28
51
 
52
+ proxy.child_factories.each do |(child_name, child_options, child_block)|
53
+ parent_factory = child_options.delete(:parent) || name
54
+ factory(child_name, child_options.merge(parent: parent_factory), &child_block)
55
+ end
56
+ end
57
+ end
58
+ end
29
59
  end
30
60
 
31
61
  FactoryGirl::Syntax::Default::DSL
@@ -58,45 +88,15 @@ module FactoryGirl
58
88
  puts "defpath: #{definition_file_paths}"
59
89
  absolute_definition_file_paths.uniq.each do |path|
60
90
  puts "abspath: #{path}"
61
- FactoryLoad.load_path("#{path}.rb") if File.exist?("#{path}.rb")
91
+ Baja::FactoryLoad.load_path("#{path}.rb") if File.exist?("#{path}.rb")
62
92
 
63
93
  if File.directory? path
64
94
  Dir[File.join(path, '**', '*.rb')].sort.each do |file|
65
- FactoryLoad.load_path(file)
95
+ Baja::FactoryLoad.load_path(file)
66
96
  end
67
97
  end
68
98
  end
69
99
  end
70
100
  end
71
101
 
72
- module FactoryLoad
73
- @@path
74
- def self.load_path(path)
75
- @@path = path
76
- puts path
77
- load(path)
78
- end
79
- def self.path
80
- @@path
81
- end
82
- FactoryGirl::Syntax::Default::DSL
83
- class FactoryGirl::Syntax::Default::DSL
84
-
85
- def factory(name, options = {}, &block)
86
- puts "path: #{FactoryLoad.path}"
87
- options[:class] = name.to_s.gsub(/_list/,'') unless options.has_key?(:class)
88
- name = :"#{@namespace}___#{name.to_s}" unless @namespace.nil?
89
- puts name
90
- factory = FactoryGirl::Factory.new(name, options)
91
- proxy = FactoryGirl::DefinitionProxy.new(factory.definition)
92
- proxy.instance_eval(&block) if block_given?
93
-
94
- FactoryGirl.register_factory(factory)
95
102
 
96
- proxy.child_factories.each do |(child_name, child_options, child_block)|
97
- parent_factory = child_options.delete(:parent) || name
98
- factory(child_name, child_options.merge(parent: parent_factory), &child_block)
99
- end
100
- end
101
- end
102
- end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: baja
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.6
4
+ version: 0.6.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Zuercher