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 +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +1 -1
- data/avro-builder.gemspec +1 -1
- data/lib/avro/builder/rake/avro_generate_task.rb +3 -2
- data/lib/avro/builder/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9a85aed16798a9c11fc4ed2ffea4e5095039041d
|
4
|
+
data.tar.gz: 4d19e50dd5d602ad1bedb573ccb58d4d7a91b7e4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7a6de0c7d56281c3945fbbdf758752e56748c0f3867b344649a20ff10dc39c7b50064fa1c429fbebea92fb17ada9e66d6039c3985ca048257781ef7c0dc4d858
|
7
|
+
data.tar.gz: bf22de4529db5bde7cb80074a2542a1497bddf5bd9ca0c23792c60f4515a9eec402dbcacdf9e7123c284693e032eeef56a648d26ed92d50bd71bd74107fa59f1
|
data/CHANGELOG.md
CHANGED
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.
|
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$/,
|
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")
|
data/lib/avro/builder/version.rb
CHANGED
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.
|
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:
|
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.
|
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.
|
124
|
+
version: 0.45.0
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: overcommit
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|