brotorift 0.7.2 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/brotorift +9 -2
- data/lib/brotorift.rb +4 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b9f356872e186ceca556c1de43b78220131aac244cbe70635eb9c5c5fabcaf05
|
4
|
+
data.tar.gz: 0c01b105e89a854b7ac7a596564fbe1c972e29e8c78f4484335f7a29a6e51e32
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aa37b5ac73dbea9fc4ba5e9ea5a918cce20460903a6b37e4c4b2348adf01a3ccdf2212b9e487c1a5c07d5aa8e468f9eeb62ffa107a5d10d3460f3206601a2c61
|
7
|
+
data.tar.gz: c49c9580fcc4c6a99b75a8ece3f6633f52b99119768342fc995e51025e674fc55766b021634852da7d3a1c094733c98f715816a9566b12032caaa0c1f5246cec
|
data/bin/brotorift
CHANGED
@@ -1,12 +1,19 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
3
|
if ARGV.length < 1
|
4
|
-
puts 'Usage: brotorift [file_to_compile.brotorift]'
|
4
|
+
puts 'Usage: brotorift [-g] [file_to_compile.brotorift]'
|
5
|
+
puts ' -g: Generate sequence diagram'
|
5
6
|
puts ' Please provide the brotorift file.'
|
6
7
|
puts
|
7
8
|
exit 1
|
8
9
|
end
|
9
10
|
|
10
11
|
require 'brotorift'
|
12
|
+
|
11
13
|
brotorift = Brotorift.new
|
12
|
-
|
14
|
+
if ARGV.length == 1
|
15
|
+
brotorift.run ARGV[0], false
|
16
|
+
else
|
17
|
+
generate_sequence_diagrams = ARGV[0] == '-g'
|
18
|
+
brotorift.run ARGV[1], generate_sequence_diagrams
|
19
|
+
end
|
data/lib/brotorift.rb
CHANGED
@@ -45,13 +45,13 @@ class Brotorift
|
|
45
45
|
end
|
46
46
|
|
47
47
|
|
48
|
-
def generate_all_code runtime
|
48
|
+
def generate_all_code runtime, generate_diagram
|
49
49
|
runtime.directions.each do |direction|
|
50
50
|
generate_code runtime, direction.client, :client
|
51
51
|
generate_code runtime, direction.server, :server
|
52
52
|
end
|
53
53
|
|
54
|
-
generate_sequence_diagrams runtime
|
54
|
+
generate_sequence_diagrams runtime if generate_diagram
|
55
55
|
end
|
56
56
|
|
57
57
|
|
@@ -88,7 +88,7 @@ class Brotorift
|
|
88
88
|
Generator.generators.find { |g| g.language == language and g.side == side }
|
89
89
|
end
|
90
90
|
|
91
|
-
def run file_name
|
91
|
+
def run file_name, generate_diagram
|
92
92
|
load_generators
|
93
93
|
compiler = Compiler.new
|
94
94
|
compiler.compile file_name, true
|
@@ -96,7 +96,7 @@ class Brotorift
|
|
96
96
|
print_compile_errors compiler.errors
|
97
97
|
exit 1
|
98
98
|
else
|
99
|
-
generate_all_code compiler.runtime
|
99
|
+
generate_all_code compiler.runtime, generate_diagram
|
100
100
|
end
|
101
101
|
end
|
102
102
|
end
|