activewarehouse-etl 0.8.0 → 0.8.1

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.
data/CHANGELOG CHANGED
@@ -118,4 +118,11 @@
118
118
  ActiveRecord::Base.configurations.
119
119
  * Fixed several bugs in how record change detection was implemented.
120
120
  * Fixed how the read_locally functionality was implemented so that it will find that last
121
- completed local source copy using the source's trigger file (untested).
121
+ completed local source copy using the source's trigger file (untested).
122
+
123
+ 0.8.1 - Apr 12, 2007
124
+ * Added EnumerableSource
125
+ * Added :type configuration option to the source directive, allowing the source type to be
126
+ explicitly specified. The source type can be a string or symbol (in which case the class will
127
+ be constructed by appending Source to the type name), a class (which will be instantiated
128
+ and passed the control, configuration and mapping) and finally an actual Source instance.
@@ -41,10 +41,27 @@ module ETL #:nodoc:
41
41
 
42
42
  # Define a source.
43
43
  def source(name, configuration={}, definition={})
44
- source_types.each do |source_type|
45
- if configuration[source_type]
46
- source_class = ETL::Control::Source.class_for_name(source_type)
44
+ if configuration[:type]
45
+ case configuration[:type]
46
+ when Class
47
+ source_class = configuration[:type]
47
48
  sources << source_class.new(self, configuration, definition)
49
+ when String, Symbol
50
+ source_class = ETL::Control::Source.class_for_name(configuration[:type])
51
+ sources << source_class.new(self, configuration, definition)
52
+ else
53
+ if configuration[:type].is_a?(ETL::Control::Source)
54
+ sources << configuration[:type]
55
+ else
56
+ raise "Configuration must extend ETL::Control::Source"
57
+ end
58
+ end
59
+ else
60
+ source_types.each do |source_type|
61
+ if configuration[source_type]
62
+ source_class = ETL::Control::Source.class_for_name(source_type)
63
+ sources << source_class.new(self, configuration, definition)
64
+ end
48
65
  end
49
66
  end
50
67
  end
@@ -0,0 +1,12 @@
1
+ module ETL
2
+ module Control
3
+ class EnumerableSource < ETL::Control::Source
4
+ def initialize(control, configuration, definition)
5
+ super
6
+ end
7
+ def each(&block)
8
+ configuration[:enumerable].each(&block)
9
+ end
10
+ end
11
+ end
12
+ end
data/lib/etl/version.rb CHANGED
@@ -2,7 +2,7 @@ module ETL#:nodoc:
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 8
5
- TINY = 0
5
+ TINY = 1
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
metadata CHANGED
@@ -3,7 +3,7 @@ rubygems_version: 0.9.0.10
3
3
  specification_version: 1
4
4
  name: activewarehouse-etl
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.8.0
6
+ version: 0.8.1
7
7
  date: 2007-04-12 00:00:00 -04:00
8
8
  summary: Pure Ruby ETL package.
9
9
  require_paths:
@@ -64,6 +64,7 @@ files:
64
64
  - lib/etl/control/destination/database_destination.rb
65
65
  - lib/etl/control/destination/file_destination.rb
66
66
  - lib/etl/control/source/database_source.rb
67
+ - lib/etl/control/source/enumerable_source.rb
67
68
  - lib/etl/control/source/file_source.rb
68
69
  - lib/etl/execution/base.rb
69
70
  - lib/etl/execution/job.rb