gv_fsm 0.3.4 → 0.3.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 30faaffebbf1ff42588fc435f59e31bfaa4220bb3e32522476eefb5c6d10cbc8
4
- data.tar.gz: 02d6b6289dcbded60a6d65555e1decfcc61016cb55c02bcc29534187f6442fcd
3
+ metadata.gz: 86b23438e750da00df1eeb91db559d2176303a4a9c543fdb6acf471d5d112571
4
+ data.tar.gz: cb3c1ef9e8d2fe0fdf84740539425a9aa8aca3d0358de6ae2b5a69c209d4dfd7
5
5
  SHA512:
6
- metadata.gz: ea781eee2cabb30095e1ec7dd96a0b017bc0db35ee99e15dd760405387fd77b59068f5056827ab916c3d2745c06cf5b468a578ab7b8379b11aea06e965763a7b
7
- data.tar.gz: 87904b3267f573a7364a9f9c8d08eb01056f15cc9863f182ec465a665d490ce072f5b20166e0d53569a099901a650b2e74d7bb35a7810d7b6cab57d5c36c56c7
6
+ metadata.gz: 946b67acdc3dd2e435bdcda6588c2df81f4548d89003db424634b5d27e45e7a7b2698cd7583e5a51e5c1814dd5cdb5042fd719bd27d37c831dde30354935172f
7
+ data.tar.gz: 83b6474365979c04ea29346acc518746ee1d760eb4b144da251e2f3816956e488d68ebf4d52c7e4d234f3dfe92a14ad746f7b37d67c743078e06a68deb885177
data/lib/gv_fsm.rb CHANGED
@@ -144,8 +144,8 @@ module GV_FSM
144
144
  ext = @ino ? "cpp" : "c"
145
145
  fname = "#{filename}.#{ext}"
146
146
  File.open(fname, "w") do |f|
147
- f.puts ERB.new(HEADER, 0, "<>").result(binding)
148
- f.puts ERB.new(CC, 0, "<>").result(binding)
147
+ f.puts ERB.new(HEADER, trim_mode: "<>").result(binding)
148
+ f.puts ERB.new(CC, trim_mode: "<>").result(binding)
149
149
  end
150
150
  return fname
151
151
  end
@@ -153,8 +153,8 @@ module GV_FSM
153
153
  def generate_h(filename = @cname)
154
154
  fname = "#{filename}.h"
155
155
  File.open(fname, "w") do |f|
156
- f.puts ERB.new(HEADER, 0, "<>").result(binding)
157
- f.puts ERB.new(HH, 0, "<>").result(binding)
156
+ f.puts ERB.new(HEADER, trim_mode: "<>").result(binding)
157
+ f.puts ERB.new(HH, trim_mode: "<>").result(binding)
158
158
  end
159
159
  return fname
160
160
  end
data/lib/templates.rb CHANGED
@@ -25,6 +25,9 @@ module GV_FSM
25
25
  <% if !@ino then %>
26
26
  #ifndef <%= File::basename(@cname).upcase %>_H
27
27
  #define <%= File::basename(@cname).upcase %>_H
28
+ #ifdef __cplusplus
29
+ extern "C" {
30
+ #endif
28
31
  #include <stdlib.h>
29
32
  <% else %>
30
33
  #include <arduino.h>
@@ -95,7 +98,10 @@ module GV_FSM
95
98
  <%= @prefix %>state_t <%= @prefix %>run_state(<%= @prefix %>state_t cur_state, <%= @prefix %>state_data_t *data);
96
99
 
97
100
  <% if !@ino then %>
101
+ #ifdef __cplusplus
102
+ }
98
103
  #endif
104
+ #endif // <%= File::basename(@cname).upcase %>_H
99
105
  <% end %>
100
106
  EOH
101
107
 
data/lib/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module GV_FSM
2
- VERSION = "0.3.4"
2
+ VERSION = "0.3.7"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gv_fsm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.3.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paolo Bosetti
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-04-04 00:00:00.000000000 Z
11
+ date: 2024-08-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby-graphviz