brotorift 0.4.4 → 0.4.5

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b35c5012c15f8bb488f1544b7ff131d8d3464fe2b5ce0c859139ffd3065bc92e
4
- data.tar.gz: 9f645f7f92fba074526292136e4bc72fb4b6f66376e5f026201d9411c7a5d8cc
3
+ metadata.gz: 56fe846d536851843daf4ea29ae6008d7a7ec4c56cf5042ae8a490d43b1f3090
4
+ data.tar.gz: fa127162d9209be518ad43fbad966196e9a2b960ccbe0f6c607743d738766291
5
5
  SHA512:
6
- metadata.gz: 53aa0520a38cde0a6a62367eccf92cf956c1ed0bc20a94a5a3e152be2fdacbf00fa5b112aa4efa7471f25d1ad9a90373051b6b77b2d6c4551bbf8ada7d2ef3d9
7
- data.tar.gz: f7c8fd3dbd53e738389730af88e6f5e0af45d1761e3e903be34d6720c75c08052ae3bbe64d855e83feed8348c5222ea2ae26851638dc2ede078e39fcdd8dbae3
6
+ metadata.gz: 2494c9384ced85c380a65235fe753b820c54158a024795b5f0d4604448ffdeea1a30e02ba7e736408e9580c12595003fe390151da4b6ae932b6e6ac8cf78a506
7
+ data.tar.gz: 7dfec5bc7385195c1809785cd43585a788d6eb1a93767274e4760a98bdce1b06244348369b1216627585f1e585bd1f3c24233537248cf7aeea4f428d53fde78c
data/lib/compiler.rb CHANGED
@@ -61,12 +61,14 @@ class Compiler
61
61
  end
62
62
 
63
63
  def compile_include include_ast
64
+ dir = File.dirname @runtime.filename
64
65
  filename = include_ast.filename + '.brotorift'
65
- if not File.exists? filename
66
+ full_path = File.join dir, filename
67
+ if not File.exists? full_path
66
68
  add_error IncludeFileNotFoundError.new filename, include_ast.position
67
69
  return
68
70
  end
69
- self.compile filename
71
+ self.compile full_path
70
72
  end
71
73
 
72
74
  def compile_enum enum_ast
@@ -126,10 +128,11 @@ class Compiler
126
128
  @message_base_id += 1000
127
129
  @message_id = 0
128
130
 
129
- old_direction = @runtime.get_direction client, direction_ast.direction, server
130
- self.check_unique 'direction', old_direction, direction_ast
131
+ direction_def = @runtime.get_direction client, direction_ast.direction, server
132
+ if direction_def == nil
133
+ direction_def = DirectionDef.new direction_ast, client, server
134
+ end
131
135
 
132
- direction_def = DirectionDef.new direction_ast, client, server
133
136
  direction_ast.messages.each do |message_ast|
134
137
  self.check_case 'message', :upper, message_ast
135
138
  self.check_unique 'message', direction_def.messages[message_ast.name], message_ast
@@ -427,7 +427,10 @@ class ElixirServerGenerator < Generator
427
427
  template = File.read erb_file
428
428
  erb = ERB.new template
429
429
  content = erb.result binding
430
- File.write "#{node.elixir_name}.ex", content
430
+
431
+ output_dir = File.dirname runtime.filename
432
+ output_path = File.join output_dir, "#{node.elixir_name}.ex"
433
+ File.write output_path, content
431
434
  end
432
435
  end
433
436
 
@@ -184,7 +184,10 @@ class UnityClientGenerator < Generator
184
184
  template = File.read erb_file
185
185
  erb = ERB.new template
186
186
  content = erb.result binding
187
- File.write "#{node.name}.cs", content
187
+
188
+ output_dir = File.dirname runtime.filename
189
+ output_path = File.join output_dir, "#{node.name}.cs"
190
+ File.write output_path, content
188
191
  end
189
192
  end
190
193
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: brotorift
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.4
4
+ version: 0.4.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Ren