chronicle-etl 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f364392d44aab353504c3daeb62c9e19b9a3bbc8c0e7d7efc0e3324457bb2921
4
- data.tar.gz: e79ba859fa67c6ddb2e7112fe213a23a4e0d692063aab9a8f9e86fd970e2b44c
3
+ metadata.gz: 2a8f688143a1057176324084919170a3351007cf619489d3ab76914c527bf15a
4
+ data.tar.gz: 2c7cfeeb279274f66b9eaccbe8a5f17fdf67453b82590d55a0df8f1cde8e748b
5
5
  SHA512:
6
- metadata.gz: a0f0cbae079c6f1afef6b0b4f67cbfdd28b041b3247457913f6a07dfb6a21aef185286002d869293f1984b7c9806d57a788c58e9d92c2f7ae05ed61c7322633c
7
- data.tar.gz: c36e3c54539540406e5dcde64ac4b3ceccc070b4f81639ae337dccdcf6b1dc0f193966ce02291a568be22f8ffb0207225a5598f8f2e11d0790e3b130ff92815c
6
+ metadata.gz: 2882b8daef2dc427fdf0ea517504f35fe286f19a9040319f6884461577d978d963c92aa19c613b92dc55e5a8edc0271396450addaf772dceeb0ff4d5ed38a30f
7
+ data.tar.gz: 2f45c5b4d1e896e82a514215032cfb6b0a9802dacd2be0b9e57b3bd27a5f13b40a392e1577081d61aa219aa4c4e5c7e97744d8f371031fb2b871b27f68094dd3
@@ -0,0 +1,12 @@
1
+ # Changelog
2
+
3
+ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
4
+
5
+ ## [0.1.2] - 2020-08-02
6
+ ### Added
7
+ - This changelog
8
+ - Ability to use extractors, transformers, and loaders from other gems
9
+
10
+ ## [0.1.0] - 2020-08-01
11
+ ### Added
12
+ - Basic job runner and ETL classes
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- chronicle-etl (0.1.1)
4
+ chronicle-etl (0.1.2)
5
5
  colorize (~> 0.8.1)
6
6
  ruby-progressbar (~> 1.10)
7
7
  table_print
@@ -21,7 +21,7 @@ Gem::Specification.new do |spec|
21
21
 
22
22
  spec.metadata["homepage_uri"] = spec.homepage
23
23
  spec.metadata["source_code_uri"] = "https://github.com/chronicle-app/chronicle-etl"
24
- spec.metadata["changelog_uri"] = "https://github.com/chronicle-app/chronicle-etl"
24
+ spec.metadata["changelog_uri"] = "https://github.com/chronicle-app/chronicle-etl/blob/master/CHANGELOG.md"
25
25
  else
26
26
  raise "RubyGems 2.0 or newer is required to protect against " \
27
27
  "public gem pushes."
@@ -1,4 +1,10 @@
1
1
  class Chronicle::Etl::Runner
2
+ BUILTIN = {
3
+ extractor: ['stdin', 'json', 'csv'],
4
+ transformer: ['null'],
5
+ loader: ['stdout', 'csv', 'table']
6
+ }.freeze
7
+
2
8
  def initialize(options)
3
9
  @options = options
4
10
 
@@ -25,13 +31,27 @@ class Chronicle::Etl::Runner
25
31
  private
26
32
 
27
33
  def instantiate_etl_classes
28
- @extractor = get_etl_class(:extractor, @options[:extractor][:name]).new(@options[:extractor][:options])
29
- @transformer = get_etl_class(:transformer, @options[:transformer][:name]).new(@options[:transformer][:options])
30
- @loader = get_etl_class(:loader, @options[:loader][:name]).new(@options[:loader][:options])
34
+ @extractor = load_etl_class(:extractor, @options[:extractor][:name]).new(@options[:extractor][:options])
35
+ @transformer = load_etl_class(:transformer, @options[:transformer][:name]).new(@options[:transformer][:options])
36
+ @loader = load_etl_class(:loader, @options[:loader][:name]).new(@options[:loader][:options])
31
37
  end
32
38
 
33
- def get_etl_class(phase, name)
34
- klass_name = "Chronicle::Etl::#{phase.to_s.capitalize}s::#{name.capitalize}"
39
+ def load_etl_class(phase, name)
40
+ if BUILTIN[phase].include? name
41
+ klass_name = "Chronicle::Etl::#{phase.to_s.capitalize}s::#{name.capitalize}"
42
+ else
43
+ # TODO: come up with syntax for specifying a particular extractor in a provider library
44
+ # provider, extractor = name.split(":")
45
+ provider = name
46
+ begin
47
+ require "chronicle/#{provider}"
48
+ rescue LoadError => e
49
+ warn("Error loading #{phase} '#{provider}'")
50
+ warn(" Perhaps you haven't installed it yet: `$ gem install chronicle-#{provider}`")
51
+ exit(false)
52
+ end
53
+ klass_name = "Chronicle::#{name.capitalize}::Extractor"
54
+ end
35
55
  Object.const_get(klass_name)
36
56
  end
37
57
  end
@@ -1,5 +1,5 @@
1
1
  module Chronicle
2
2
  module Etl
3
- VERSION = "0.1.1"
3
+ VERSION = "0.1.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chronicle-etl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Louis
@@ -134,6 +134,7 @@ files:
134
134
  - ".gitignore"
135
135
  - ".rspec"
136
136
  - ".travis.yml"
137
+ - CHANGELOG.md
137
138
  - CODE_OF_CONDUCT.md
138
139
  - Gemfile
139
140
  - Gemfile.lock
@@ -165,7 +166,7 @@ licenses:
165
166
  metadata:
166
167
  homepage_uri: https://github.com/chronicle-app
167
168
  source_code_uri: https://github.com/chronicle-app/chronicle-etl
168
- changelog_uri: https://github.com/chronicle-app/chronicle-etl
169
+ changelog_uri: https://github.com/chronicle-app/chronicle-etl/blob/master/CHANGELOG.md
169
170
  post_install_message:
170
171
  rdoc_options: []
171
172
  require_paths: