avro-builder 0.13.0 → 0.14.0

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
  SHA1:
3
- metadata.gz: 8672dba84b4ee61d299c99f3fe0ced401b3817b4
4
- data.tar.gz: dcdcf44d8c0f11c3b2d9b828738047a037df0caa
3
+ metadata.gz: 9a85aed16798a9c11fc4ed2ffea4e5095039041d
4
+ data.tar.gz: 4d19e50dd5d602ad1bedb573ccb58d4d7a91b7e4
5
5
  SHA512:
6
- metadata.gz: e3f8f47f84aa98101454de16745b084e07f3342f0c97f69597cf378ef0906b1deeafe730a96562e478daac34b0f78f1ad47565eded84c2bc3dafaa72c6223408
7
- data.tar.gz: 3116b64339e0afb980ced2790f2e71e626983fc976a1b519edf5656e4dabb09b2175dc9545bdba7942df2223920d78813cb10cb5688bc7f7880f6c5a51498adc
6
+ metadata.gz: 7a6de0c7d56281c3945fbbdf758752e56748c0f3867b344649a20ff10dc39c7b50064fa1c429fbebea92fb17ada9e66d6039c3985ca048257781ef7c0dc4d858
7
+ data.tar.gz: bf22de4529db5bde7cb80074a2542a1497bddf5bd9ca0c23792c60f4515a9eec402dbcacdf9e7123c284693e032eeef56a648d26ed92d50bd71bd74107fa59f1
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # avro-builder changelog
2
2
 
3
+ ## v0.14.0
4
+ - Allow `filetype` to be specified in rake task to generate Avro JSON schema
5
+ files.
6
+
3
7
  ## v0.13.0
4
8
  - Add support for type macros.
5
9
 
data/README.md CHANGED
@@ -398,10 +398,10 @@ Custom rake tasks can also be defined:
398
398
  require 'avro/builder/rake/avro_generate_task'
399
399
  Avro::Builder::Rake::AvroGenerateTask.new(name: :custom_gen,
400
400
  dependencies: [:load_app]) do |task|
401
+ task.filetype = 'avsc' # default option
401
402
  task.root = '/path/to/dsl/files'
402
403
  task.load_paths << '/additional/dsl/files'
403
404
  end
404
- )
405
405
  ```
406
406
 
407
407
  ## Development
data/avro-builder.gemspec CHANGED
@@ -27,6 +27,6 @@ Gem::Specification.new do |spec|
27
27
  spec.add_development_dependency 'rspec', '~> 3.0'
28
28
  spec.add_development_dependency 'json_spec'
29
29
  spec.add_development_dependency 'simplecov'
30
- spec.add_development_dependency 'salsify_rubocop', '~> 0.40.0'
30
+ spec.add_development_dependency 'salsify_rubocop', '~> 0.45.0'
31
31
  spec.add_development_dependency 'overcommit'
32
32
  end
@@ -7,7 +7,7 @@ module Avro
7
7
  class AvroGenerateTask < ::Rake::TaskLib
8
8
 
9
9
  attr_accessor :name, :task_namespace, :task_desc, :root,
10
- :load_paths, :dependencies
10
+ :load_paths, :dependencies, :filetype
11
11
 
12
12
  def initialize(name: :generate, dependencies: [])
13
13
  @name = name
@@ -16,6 +16,7 @@ module Avro
16
16
  @load_paths = []
17
17
  @root = "#{Rails.root}/avro/dsl" if defined?(Rails)
18
18
  @dependencies = dependencies
19
+ @filetype = 'avsc'
19
20
 
20
21
  yield self if block_given?
21
22
 
@@ -33,7 +34,7 @@ module Avro
33
34
  Avro::Builder.add_load_path(*[root, load_paths].flatten)
34
35
  Dir["#{root}/**/*.rb"].each do |dsl_file|
35
36
  puts "Generating Avro schema from #{dsl_file}"
36
- output_file = dsl_file.sub('/dsl/', '/schema/').sub(/\.rb$/, '.avsc')
37
+ output_file = dsl_file.sub('/dsl/', '/schema/').sub(/\.rb$/, ".#{filetype}")
37
38
  schema = Avro::Builder.build(filename: dsl_file)
38
39
  FileUtils.mkdir_p(File.dirname(output_file))
39
40
  File.write(output_file, schema.end_with?("\n") ? schema : schema << "\n")
@@ -1,5 +1,5 @@
1
1
  module Avro
2
2
  module Builder
3
- VERSION = '0.13.0'.freeze
3
+ VERSION = '0.14.0'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: avro-builder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.0
4
+ version: 0.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Salsify Engineering
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-09-16 00:00:00.000000000 Z
11
+ date: 2017-01-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: avro
@@ -114,14 +114,14 @@ dependencies:
114
114
  requirements:
115
115
  - - "~>"
116
116
  - !ruby/object:Gem::Version
117
- version: 0.40.0
117
+ version: 0.45.0
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - "~>"
123
123
  - !ruby/object:Gem::Version
124
- version: 0.40.0
124
+ version: 0.45.0
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: overcommit
127
127
  requirement: !ruby/object:Gem::Requirement