brotorift 0.7.2 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/bin/brotorift +9 -2
  3. data/lib/brotorift.rb +4 -4
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5dcfa0499745e387f4780970db3f823da01309a8bbcdd7c0ce3ed6f7732bf31e
4
- data.tar.gz: 8cb5291054bf10194f20a285290635189139aaf1720ff12bc3f43c4df9635ed1
3
+ metadata.gz: b9f356872e186ceca556c1de43b78220131aac244cbe70635eb9c5c5fabcaf05
4
+ data.tar.gz: 0c01b105e89a854b7ac7a596564fbe1c972e29e8c78f4484335f7a29a6e51e32
5
5
  SHA512:
6
- metadata.gz: 0562c396bd954280c5b4d5c084bd7e0f277bf83f79948ca4bd9fe8f398c336a1520c6c1b83c5cbba1d233d96911018a4db4ea55907378b538ad8a7a89123a6a6
7
- data.tar.gz: 34754d69f54443e33e8fa8a85fbbfd532dc47ef64195085ed3fb448d89cd490e15271bbead5e05fb33bf0dc88a97401a2401be0a24a8c24db8cbf22a7e014f8e
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
- brotorift.run ARGV[0]
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
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.7.2
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Ren