effigy_wire 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +4 -0
- data/BIN_README.txt +18 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +3 -0
- data/Gemfile.lock +40 -0
- data/LICENSE.txt +21 -0
- data/README.md +7 -0
- data/Rakefile +2 -0
- data/bin/clarity-protobuf/clean +36 -0
- data/bin/clarity-protobuf/copy +75 -0
- data/bin/effigy/compile-proto +81 -0
- data/bin/effigy/mk-require-turds +43 -0
- data/bin/effigy/package +56 -0
- data/bin/effigy/tweak-proto +30 -0
- data/bin/effigy/tweak-rb +20 -0
- data/effigy_wire.gemspec +24 -0
- data/lib/effigy/wire/demo.pb.rb +205 -0
- data/lib/effigy/wire/dota_commonmessages.pb.rb +209 -0
- data/lib/effigy/wire/dota_modifiers.pb.rb +78 -0
- data/lib/effigy/wire/dota_usermessages.pb.rb +1315 -0
- data/lib/effigy/wire/netmessages.pb.rb +177 -0
- data/lib/effigy/wire/networkbasetypes.pb.rb +268 -0
- data/lib/effigy/wire/s1/s1_dota_usermessages.pb.rb +102 -0
- data/lib/effigy/wire/s1/s1_netmessages.pb.rb +121 -0
- data/lib/effigy/wire/s1/s1_usermessages.pb.rb +271 -0
- data/lib/effigy/wire/s1.rb +3 -0
- data/lib/effigy/wire/s2/s2_base_gcmessages.pb.rb +57 -0
- data/lib/effigy/wire/s2/s2_dota_gcmessages_common.pb.rb +214 -0
- data/lib/effigy/wire/s2/s2_dota_match_metadata.pb.rb +106 -0
- data/lib/effigy/wire/s2/s2_dota_usermessages.pb.rb +117 -0
- data/lib/effigy/wire/s2/s2_gameevents.pb.rb +172 -0
- data/lib/effigy/wire/s2/s2_netmessages.pb.rb +158 -0
- data/lib/effigy/wire/s2/s2_te.pb.rb +330 -0
- data/lib/effigy/wire/s2/s2_usermessages.pb.rb +514 -0
- data/lib/effigy/wire/s2.rb +3 -0
- data/lib/effigy/wire.rb +9 -0
- data/lib/effigy.rb +3 -0
- data/proto/demo.proto +157 -0
- data/proto/dota_commonmessages.proto +183 -0
- data/proto/dota_modifiers.proto +54 -0
- data/proto/dota_usermessages.proto +1152 -0
- data/proto/netmessages.proto +133 -0
- data/proto/networkbasetypes.proto +219 -0
- data/proto/s1/google/protobuf/descriptor.proto +622 -0
- data/proto/s1/s1_dota_usermessages.proto +89 -0
- data/proto/s1/s1_netmessages.proto +86 -0
- data/proto/s1/s1_usermessages.proto +217 -0
- data/proto/s2/google/protobuf/descriptor.proto +622 -0
- data/proto/s2/s2_base_gcmessages.proto +37 -0
- data/proto/s2/s2_dota_gcmessages_common.proto +177 -0
- data/proto/s2/s2_dota_match_metadata.proto +67 -0
- data/proto/s2/s2_dota_usermessages.proto +104 -0
- data/proto/s2/s2_gameevents.proto +125 -0
- data/proto/s2/s2_netmessages.proto +120 -0
- data/proto/s2/s2_te.proto +276 -0
- data/proto/s2/s2_usermessages.proto +434 -0
- metadata +148 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: af2d81261224d5ec6dedf674b2358086bfa60a03
|
4
|
+
data.tar.gz: 300aad4dc0f1246fe8c4d7d1334c7eb2b0b9620c
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: fef6e3a8703b242b39f1cd5105beb37d3e2d804369263bd1fbfcc8d993eb5e5f35634996f89d31a716e9607d231feec8b059348ff086288a4b6ad48d8709a8c9
|
7
|
+
data.tar.gz: 94c42144911f82724a18b431a113677f2bfd033466ef91d3d2ee5920995297477b2c27770c29740defe493a4f070f718780d1797c6527dfbf23a1ab2aaae6979
|
data/.gitignore
ADDED
data/BIN_README.txt
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
$ cd Code
|
2
|
+
$ git clone https://github.com/skadistats/clarity-protobuf
|
3
|
+
$ git clone https://github.com/onethirtyfive/effigy-wire
|
4
|
+
$ cd effigy-wire
|
5
|
+
$ bin/clarity-protobuf/copy
|
6
|
+
$ bin/clarity-protobuf/clean
|
7
|
+
$ bin/effigy/package
|
8
|
+
$ bin/effigy/tweak-proto
|
9
|
+
$ bin/effigy/compile-proto
|
10
|
+
$ bin/effigy/mk-require-turds
|
11
|
+
$ bin/effigy/tweak-rb
|
12
|
+
|
13
|
+
... manual editing on the require_relatives, durr...
|
14
|
+
|
15
|
+
to test:
|
16
|
+
|
17
|
+
bundle exec irb -Ilib
|
18
|
+
> require 'effigy'
|
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
10
|
+
orientation.
|
11
|
+
|
12
|
+
## Our Standards
|
13
|
+
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
16
|
+
|
17
|
+
* Using welcoming and inclusive language
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
19
|
+
* Gracefully accepting constructive criticism
|
20
|
+
* Focusing on what is best for the community
|
21
|
+
* Showing empathy towards other community members
|
22
|
+
|
23
|
+
Examples of unacceptable behavior by participants include:
|
24
|
+
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
+
* Public or private harassment
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
33
|
+
|
34
|
+
## Our Responsibilities
|
35
|
+
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
39
|
+
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
+
threatening, offensive, or harmful.
|
45
|
+
|
46
|
+
## Scope
|
47
|
+
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
+
when an individual is representing the project or its community. Examples of
|
50
|
+
representing a project or community include using an official project e-mail
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
53
|
+
further defined and clarified by project maintainers.
|
54
|
+
|
55
|
+
## Enforcement
|
56
|
+
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
+
reported by contacting the project team at joshua.a.morris@gmail.com. All
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
63
|
+
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
66
|
+
members of the project's leadership.
|
67
|
+
|
68
|
+
## Attribution
|
69
|
+
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
+
available at [http://contributor-covenant.org/version/1/4][version]
|
72
|
+
|
73
|
+
[homepage]: http://contributor-covenant.org
|
74
|
+
[version]: http://contributor-covenant.org/version/1/4/
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
effigy_wire (0.0.2)
|
5
|
+
protobuf (~> 3.6.9, >= 3.6.9)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
activesupport (4.2.6)
|
11
|
+
i18n (~> 0.7)
|
12
|
+
json (~> 1.7, >= 1.7.7)
|
13
|
+
minitest (~> 5.1)
|
14
|
+
thread_safe (~> 0.3, >= 0.3.4)
|
15
|
+
tzinfo (~> 1.1)
|
16
|
+
i18n (0.7.0)
|
17
|
+
json (1.8.3)
|
18
|
+
middleware (0.1.0)
|
19
|
+
minitest (5.9.0)
|
20
|
+
protobuf (3.6.9)
|
21
|
+
activesupport (>= 3.2)
|
22
|
+
middleware
|
23
|
+
thor
|
24
|
+
thread_safe
|
25
|
+
rake (10.4.2)
|
26
|
+
thor (0.19.1)
|
27
|
+
thread_safe (0.3.5)
|
28
|
+
tzinfo (1.2.2)
|
29
|
+
thread_safe (~> 0.1)
|
30
|
+
|
31
|
+
PLATFORMS
|
32
|
+
ruby
|
33
|
+
|
34
|
+
DEPENDENCIES
|
35
|
+
bundler (~> 1.7)
|
36
|
+
effigy_wire!
|
37
|
+
rake (~> 10.0)
|
38
|
+
|
39
|
+
BUNDLED WITH
|
40
|
+
1.12.5
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2016 Joshua Morris
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
data/Rakefile
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'fileutils'
|
4
|
+
|
5
|
+
PROTO_ROOT =
|
6
|
+
begin
|
7
|
+
ENV.fetch('PROTO_ROOT')
|
8
|
+
rescue KeyError
|
9
|
+
File.join(Dir.pwd, 'proto')
|
10
|
+
end
|
11
|
+
|
12
|
+
print "Remove non-proto files in #{PROTO_ROOT}? [yN] > "
|
13
|
+
answer = gets.strip
|
14
|
+
|
15
|
+
unless answer == 'y'
|
16
|
+
puts 'OK, aborting.'
|
17
|
+
exit(0)
|
18
|
+
end
|
19
|
+
|
20
|
+
|
21
|
+
begin
|
22
|
+
bindir_path = File.join(PROTO_ROOT, 'bin')
|
23
|
+
puts "> Removing #{bindir_path}"
|
24
|
+
FileUtils.rm_rf(bindir_path)
|
25
|
+
rescue Errno::ENOENT
|
26
|
+
end
|
27
|
+
|
28
|
+
proto_paths = Dir.glob("#{PROTO_ROOT}/**/*")
|
29
|
+
|
30
|
+
proto_paths.each do |proto_path|
|
31
|
+
next if File.directory?(proto_path)
|
32
|
+
next if File.extname(proto_path) == '.proto' # keep these
|
33
|
+
|
34
|
+
puts "> Removing #{proto_path}"
|
35
|
+
File.delete(proto_path)
|
36
|
+
end
|
@@ -0,0 +1,75 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'fileutils'
|
4
|
+
require 'logger'
|
5
|
+
|
6
|
+
err_log = Logger.new(STDERR)
|
7
|
+
|
8
|
+
CLARITY_PROTO_ROOT =
|
9
|
+
begin
|
10
|
+
ENV.fetch('CLARITY_PROTO_ROOT')
|
11
|
+
rescue KeyError
|
12
|
+
File.join(
|
13
|
+
Dir.pwd,
|
14
|
+
'..',
|
15
|
+
'clarity-protobuf',
|
16
|
+
'src', 'main', 'proto'
|
17
|
+
)
|
18
|
+
end
|
19
|
+
|
20
|
+
CLARITY_PROTO_BIN_ROOT =
|
21
|
+
begin
|
22
|
+
ENV.fetch('CLARITY_PROTO_BIN_ROOT')
|
23
|
+
rescue KeyError
|
24
|
+
File.join(CLARITY_PROTO_ROOT, 'bin')
|
25
|
+
end
|
26
|
+
|
27
|
+
CLARITY_PROTO_COMMON_ROOT =
|
28
|
+
begin
|
29
|
+
ENV.fetch('CLARITY_PROTO_COMMON_ROOT')
|
30
|
+
rescue KeyError
|
31
|
+
File.join(CLARITY_PROTO_ROOT, 'common')
|
32
|
+
end
|
33
|
+
|
34
|
+
PROTO_ROOT =
|
35
|
+
begin
|
36
|
+
ENV.fetch('PROTO_ROOT')
|
37
|
+
rescue KeyError
|
38
|
+
File.join(Dir.pwd, 'proto')
|
39
|
+
end
|
40
|
+
|
41
|
+
src_package_paths = Dir.glob("#{CLARITY_PROTO_ROOT}/*").select do |package_path|
|
42
|
+
next(false) if package_path.include?(CLARITY_PROTO_BIN_ROOT)
|
43
|
+
next(false) if package_path.include?(CLARITY_PROTO_COMMON_ROOT)
|
44
|
+
true
|
45
|
+
end
|
46
|
+
|
47
|
+
if src_package_paths.empty?
|
48
|
+
raise <<-EOV
|
49
|
+
|
50
|
+
|
51
|
+
Provided clarity-protobuf proto root is apparently empty. Exiting
|
52
|
+
|
53
|
+
EOV
|
54
|
+
end
|
55
|
+
|
56
|
+
src_package_paths.each do |src_package_path|
|
57
|
+
begin
|
58
|
+
puts "> Copying '#{File.basename(src_package_path)}'"
|
59
|
+
FileUtils.cp_r(src_package_path, PROTO_ROOT)
|
60
|
+
rescue Exception => e
|
61
|
+
err_log.fatal(e.to_s)
|
62
|
+
exit(-1)
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
begin
|
67
|
+
puts "> Copying '#{File.basename(CLARITY_PROTO_COMMON_ROOT)}' files to destination root"
|
68
|
+
FileUtils.cp(
|
69
|
+
Dir.glob(File.join(CLARITY_PROTO_COMMON_ROOT, '*.proto')),
|
70
|
+
PROTO_ROOT
|
71
|
+
)
|
72
|
+
rescue Exception => e
|
73
|
+
err_log.fatal(e.to_s)
|
74
|
+
exit(-1)
|
75
|
+
end
|
@@ -0,0 +1,81 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'fileutils'
|
4
|
+
require 'logger'
|
5
|
+
|
6
|
+
err_log = Logger.new(STDERR)
|
7
|
+
|
8
|
+
PROTO_ROOT =
|
9
|
+
begin
|
10
|
+
ENV.fetch('PROTO_ROOT')
|
11
|
+
rescue KeyError
|
12
|
+
File.join(Dir.pwd, 'proto')
|
13
|
+
end
|
14
|
+
|
15
|
+
RUBY_OUT_ROOT =
|
16
|
+
begin
|
17
|
+
ENV.fetch('RUBY_OUT_ROOT')
|
18
|
+
rescue KeyError
|
19
|
+
File.join(Dir.pwd, 'lib', 'effigy', 'wire')
|
20
|
+
end
|
21
|
+
|
22
|
+
EFFIGY_FORCE_COMPILE =
|
23
|
+
begin
|
24
|
+
!!ENV.fetch('EFFIGY_FORCE_COMPILE')
|
25
|
+
rescue KeyError
|
26
|
+
false
|
27
|
+
end
|
28
|
+
|
29
|
+
unless EFFIGY_FORCE_COMPILE
|
30
|
+
print "Have you cleaned, packaged, and tweak-proto'ed? [yN] > "
|
31
|
+
answer = gets.strip
|
32
|
+
|
33
|
+
unless answer == 'y'
|
34
|
+
print 'OK, go take care of that.'
|
35
|
+
exit(0)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
puts "> Ensuring output directory exists."
|
40
|
+
FileUtils.mkdir_p(RUBY_OUT_ROOT)
|
41
|
+
|
42
|
+
package_paths = []
|
43
|
+
proto_paths = []
|
44
|
+
|
45
|
+
Dir.glob("#{PROTO_ROOT}/*").select do |path|
|
46
|
+
if File.directory?(path)
|
47
|
+
package_paths << path
|
48
|
+
else
|
49
|
+
proto_paths << path
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
proto_paths.each do |proto_path|
|
54
|
+
puts "> Compiling '#{File.basename(proto_path)}'"
|
55
|
+
cmd = <<-EOV
|
56
|
+
protoc \
|
57
|
+
--proto_path=#{File.join(PROTO_ROOT)} \
|
58
|
+
--ruby_out=#{RUBY_OUT_ROOT} \
|
59
|
+
#{proto_path}
|
60
|
+
EOV
|
61
|
+
puts cmd
|
62
|
+
system(cmd)
|
63
|
+
end
|
64
|
+
|
65
|
+
package_paths.each do |package_path|
|
66
|
+
puts "> Package '#{File.basename(package_path)}'"
|
67
|
+
|
68
|
+
Dir.glob(File.join(package_path, '*.proto')).each do |proto_path|
|
69
|
+
puts " > #{File.basename(proto_path)}"
|
70
|
+
cmd = <<-EOV
|
71
|
+
protoc \
|
72
|
+
--proto_path=#{File.join(PROTO_ROOT)} \
|
73
|
+
--proto_path=#{package_path} \
|
74
|
+
--ruby_out=#{RUBY_OUT_ROOT} \
|
75
|
+
#{proto_path}
|
76
|
+
EOV
|
77
|
+
puts cmd
|
78
|
+
system(cmd)
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
@@ -0,0 +1,43 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'logger'
|
4
|
+
|
5
|
+
err_log = Logger.new(STDERR)
|
6
|
+
|
7
|
+
LIB_ROOT =
|
8
|
+
begin
|
9
|
+
ENV.fetch('LIB_ROOT')
|
10
|
+
rescue KeyError
|
11
|
+
File.join(__dir__, '..', 'lib')
|
12
|
+
end
|
13
|
+
|
14
|
+
REQUIRE_TURD_GENERATOR =
|
15
|
+
-> (mod) do
|
16
|
+
<<-EOV
|
17
|
+
Dir[File.join(File.dirname(__FILE__), '#{mod}', '*.rb')].each do |file|
|
18
|
+
require file
|
19
|
+
end
|
20
|
+
EOV
|
21
|
+
end
|
22
|
+
|
23
|
+
# lib/effigy
|
24
|
+
path = File.join(LIB_ROOT, 'effigy.rb')
|
25
|
+
File.open(path, 'w') do |file|
|
26
|
+
file.write(REQUIRE_TURD_GENERATOR.call('effigy'))
|
27
|
+
end
|
28
|
+
|
29
|
+
# lib/effigy/wire
|
30
|
+
path = File.join(LIB_ROOT, 'effigy', 'wire.rb')
|
31
|
+
File.open(path, 'w') do |file|
|
32
|
+
file.write(REQUIRE_TURD_GENERATOR.call('wire'))
|
33
|
+
end
|
34
|
+
|
35
|
+
# lib/effigy/wire/#{package}.rb
|
36
|
+
packages_root = File.join(LIB_ROOT, 'effigy', 'wire')
|
37
|
+
Dir.glob(File.join(packages_root, '*')).each do |path|
|
38
|
+
next unless File.directory?(path)
|
39
|
+
package = File.basename(path)
|
40
|
+
File.open(File.join(packages_root, "#{package}.rb"), 'w') do |file|
|
41
|
+
file.write(REQUIRE_TURD_GENERATOR.call(package))
|
42
|
+
end
|
43
|
+
end
|
data/bin/effigy/package
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'logger'
|
4
|
+
|
5
|
+
err_log = Logger.new(STDERR)
|
6
|
+
|
7
|
+
PROTO_ROOT =
|
8
|
+
begin
|
9
|
+
ENV.fetch('PROTO_ROOT')
|
10
|
+
rescue KeyError
|
11
|
+
File.join(Dir.pwd, 'proto')
|
12
|
+
end
|
13
|
+
|
14
|
+
proto_paths = Dir.glob("#{PROTO_ROOT}/**/*").select do |proto_path|
|
15
|
+
next(false) if File.directory?(proto_path)
|
16
|
+
true
|
17
|
+
end
|
18
|
+
|
19
|
+
if proto_paths.empty?
|
20
|
+
raise <<-EOV
|
21
|
+
|
22
|
+
|
23
|
+
No definitions found in #{PROTO_ROOT}!
|
24
|
+
|
25
|
+
Either:
|
26
|
+
1. Run ./bin/bootstrap in the project root directory, or
|
27
|
+
2. Set PROTO_ROOT to the location of your proto definitions
|
28
|
+
|
29
|
+
EOV
|
30
|
+
end
|
31
|
+
|
32
|
+
proto_paths.each do |proto_path|
|
33
|
+
if File.extname(proto_path) != '.proto'
|
34
|
+
err_log.warn("Stray file '#{File.basename(proto_path)}' " \
|
35
|
+
"found! Run bin/clean?")
|
36
|
+
next
|
37
|
+
end
|
38
|
+
|
39
|
+
exclusion_index =
|
40
|
+
proto_path.split('/').length - 1 == PROTO_ROOT.split('/').length ? -3
|
41
|
+
: -2
|
42
|
+
rel_path = proto_path[PROTO_ROOT.length+1..-1]
|
43
|
+
package_components =
|
44
|
+
[
|
45
|
+
'effigy',
|
46
|
+
'wire',
|
47
|
+
rel_path.split('/')[0..exclusion_index] # ditch filename.proto
|
48
|
+
].flatten
|
49
|
+
|
50
|
+
package = package_components.join('.')
|
51
|
+
|
52
|
+
puts "> Packaging #{File.basename(proto_path)} in '#{package}'."
|
53
|
+
|
54
|
+
cmd = "sed -i '1s/^/package #{package};\\n\\n/' #{proto_path}"
|
55
|
+
system(cmd)
|
56
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
PROTO_ROOT =
|
4
|
+
begin
|
5
|
+
ENV.fetch('PROTO_ROOT')
|
6
|
+
rescue KeyError
|
7
|
+
File.join(Dir.pwd, 'proto')
|
8
|
+
end
|
9
|
+
|
10
|
+
Dir.glob(File.join(PROTO_ROOT, '**/*')).each do |proto_path|
|
11
|
+
next if File.directory?(proto_path)
|
12
|
+
|
13
|
+
puts "> Tweaking #{File.basename(proto_path)}"
|
14
|
+
cmd = <<-EOV
|
15
|
+
sed -i \
|
16
|
+
-e '/optional/ s/optional \\./optional /' \
|
17
|
+
-e '/repeated/ s/repeated \\./repeated /' \
|
18
|
+
-e '/k_EHero/ s/k_EHero/K_EHero/' \
|
19
|
+
-e '/kPVLS/ s/kPVLS/KPVLS/' \
|
20
|
+
-e '/k_EDOTA/ s/k_EDOTA/K_EDOTA/' \
|
21
|
+
-e '/k_eResult/ s/k_eResult/K_eResult/' \
|
22
|
+
-e '/ePE_/ s/ePE_/EPE_/' \
|
23
|
+
-e '/net_/ s/net_/NET_/' \
|
24
|
+
-e '/svc_/ s/svc_/SVC_/' \
|
25
|
+
-e '/require\s+''.*..pb''/ s/require/require_relative/' \
|
26
|
+
#{proto_path}
|
27
|
+
EOV
|
28
|
+
system(cmd)
|
29
|
+
end
|
30
|
+
|
data/bin/effigy/tweak-rb
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
LIB_ROOT =
|
4
|
+
begin
|
5
|
+
ENV.fetch('LIB_ROOT')
|
6
|
+
rescue KeyError
|
7
|
+
File.join(Dir.pwd, 'lib')
|
8
|
+
end
|
9
|
+
|
10
|
+
Dir.glob(File.join(LIB_ROOT, '**/*')).each do |rb_path|
|
11
|
+
next if File.directory?(rb_path)
|
12
|
+
|
13
|
+
puts "> Tweaking #{File.basename(rb_path)}"
|
14
|
+
cmd = <<-EOV
|
15
|
+
sed -i \
|
16
|
+
-e '/require ''.*..pb''/ s/require/require_relative/' \
|
17
|
+
#{rb_path}
|
18
|
+
EOV
|
19
|
+
system(cmd)
|
20
|
+
end
|
data/effigy_wire.gemspec
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'effigy/wire'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = 'effigy_wire'
|
8
|
+
spec.version = Effigy::Wire::VERSION
|
9
|
+
spec.authors = ['Joshua Morris']
|
10
|
+
spec.email = ['joshua.a.morris@gmail.com']
|
11
|
+
spec.summary = %q{Protocol buffer definitions for Effigy.}
|
12
|
+
spec.description = %q{Support for parsing Dota 2 replays with Effigy.}
|
13
|
+
spec.homepage = 'https://github.com/onethirtyfive/effigy-wire'
|
14
|
+
spec.license = 'MIT'
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0")
|
17
|
+
spec.executables = []
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ['lib']
|
20
|
+
|
21
|
+
spec.add_dependency 'protobuf', '~> 3.6.9', '>= 3.6.9'
|
22
|
+
spec.add_development_dependency 'bundler', '~> 1.7'
|
23
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
24
|
+
end
|