netlinx-erb 1.0.0

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.
Files changed (49) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +9 -0
  3. data/doc/Array.html +213 -0
  4. data/doc/Hash.html +266 -0
  5. data/doc/HashHelpers.html +413 -0
  6. data/doc/Helpers.html +2154 -0
  7. data/doc/NetLinx.html +128 -0
  8. data/doc/NetLinx/ERB.html +233 -0
  9. data/doc/NetLinx/ERB/HashHelpers.html +413 -0
  10. data/doc/NetLinx/ERB/Helpers.html +2157 -0
  11. data/doc/NetLinx/Rake.html +117 -0
  12. data/doc/NetLinx/Rake/ERB.html +117 -0
  13. data/doc/NetLinx/Rake/ERB/Compile.html +354 -0
  14. data/doc/NetLinx/Rake/ERB/GenerateERB.html +419 -0
  15. data/doc/NetLinx/Rake/ERB/GenerateRPC.html +349 -0
  16. data/doc/NetLinx/Rake/ERB/Lines.html +381 -0
  17. data/doc/NetLinx/Rake/Lines.html +381 -0
  18. data/doc/RPC.html +683 -0
  19. data/doc/String.html +322 -0
  20. data/doc/_index.html +248 -0
  21. data/doc/class_list.html +58 -0
  22. data/doc/css/common.css +1 -0
  23. data/doc/css/full_list.css +57 -0
  24. data/doc/css/style.css +339 -0
  25. data/doc/file.README.html +84 -0
  26. data/doc/file.license.html +73 -0
  27. data/doc/file_list.html +63 -0
  28. data/doc/frames.html +26 -0
  29. data/doc/index.html +84 -0
  30. data/doc/js/app.js +219 -0
  31. data/doc/js/full_list.js +181 -0
  32. data/doc/js/jquery.js +4 -0
  33. data/doc/method_list.html +237 -0
  34. data/doc/top-level-namespace.html +114 -0
  35. data/lib/netlinx-erb.rb +14 -0
  36. data/lib/netlinx/erb/erb.rb +19 -0
  37. data/lib/netlinx/erb/hash_helpers.rb +42 -0
  38. data/lib/netlinx/erb/helpers.rb +399 -0
  39. data/lib/netlinx/erb/rpc.rb +270 -0
  40. data/lib/netlinx/rake/erb.rb +26 -0
  41. data/lib/netlinx/rake/erb/generate_erb.rb +66 -0
  42. data/lib/netlinx/rake/erb/generate_rpc.rb +31 -0
  43. data/lib/netlinx/rake/erb/lines.rb +47 -0
  44. data/license.txt +21 -0
  45. data/template/Gemfile +9 -0
  46. data/template/README.md +130 -0
  47. data/template/Rakefile +11 -0
  48. data/template/rpc.axi +148 -0
  49. metadata +234 -0
data/template/Gemfile ADDED
@@ -0,0 +1,9 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem 'netlinx-erb'
4
+
5
+ # Development Tools
6
+ # -----------------
7
+ # gem 'rspec'
8
+ # gem 'rspec-its'
9
+ # gem 'fivemat'
@@ -0,0 +1,130 @@
1
+ This file can be viewed as HTML at:
2
+ doc/index.html
3
+
4
+ ----------------------------------------------------------------------
5
+
6
+ This project uses inline Ruby scripting (ERB) to generate substantial portions
7
+ of the NetLinx files. These files end in ***.axi.erb***, and the `.erb` extension
8
+ is dropped when the script is compiled.
9
+
10
+ ***MODIFICATIONS*** to the project should be performed in the `.axi.erb` files, as
11
+ their `.axi` counterparts are regenerated when the project is compiled.
12
+ This means that proficiency in the Ruby programming language is *REQUIRED*
13
+ to make changes to this project. There are plenty of online tutorials and
14
+ books about Ruby for a programmer to learn the skills required to maintain
15
+ this project within several weeks. See the development section below.
16
+
17
+ ***COMPILING*** the project is a simple process with the right
18
+ build tools, which are listed below.
19
+
20
+ ----------------------------------------------------------------------
21
+
22
+ ## Build Tools
23
+
24
+
25
+ In addition to the AMX developer tools, the following are required:
26
+
27
+
28
+ ### NetLinx ERB
29
+
30
+ [NetLinx ERB](https://github.com/amclain/netlinx-erb) is the code generation
31
+ framework used by this project. The installation process below should
32
+ automatically install this package. For information regarding its usage, see:
33
+
34
+ * [Readme](https://github.com/amclain/netlinx-erb/blob/master/README.md)
35
+ * [API Documentation](http://www.rubydoc.info/gems/netlinx-erb)
36
+
37
+ ### Ruby Installer
38
+
39
+ > http://rubyinstaller.org/downloads
40
+
41
+ Ruby 2.0.0-p451 was used for this project.
42
+ Higher versions will probably be compatible.
43
+
44
+ The DEVKIT listed on the download page should
45
+ also be installed.
46
+
47
+
48
+ ### Ruby Gems
49
+
50
+ Rake and Bundler are required.
51
+
52
+ From the command line:
53
+
54
+ gem install rake bundler
55
+
56
+
57
+ ### Building The Project
58
+
59
+ From the command line in the project's `amx` directory:
60
+
61
+ bundle
62
+ bundle exec rake
63
+
64
+ The files will be auto-generated and compiled, at which point
65
+ they can be loaded onto the master with the AMX FileTransfer2
66
+ utility or NetLinx Studio.
67
+
68
+
69
+
70
+ ## Development
71
+
72
+ Although it is possible to maintain this project with a standard text
73
+ editor, or possibly NetLinx Studio, it is far easier with a few
74
+ additional tools.
75
+
76
+
77
+ ### Sublime Text 3
78
+
79
+ > http://www.sublimetext.com/3
80
+
81
+
82
+ ### Sublime Text AMX NetLinx Plugin
83
+
84
+ > http://sourceforge.net/p/sublime-netlinx/wiki/install-via-version-control
85
+
86
+ This plugin, available for Sublime Text, allows for syntax highlighting of the
87
+ `.axi.erb` files and makes the inline Ruby blocks significantly easier to view.
88
+
89
+ Note: At the time of this writing the syntax highlighting is under development
90
+ in the `dev` branch of the plugin repository. However, it will ideally be merged
91
+ into `default` by the time this project needs to be maintained.
92
+
93
+
94
+ ### Rake
95
+
96
+ > https://github.com/jimweirich/rake
97
+
98
+ Installed via `gem install rake`.
99
+
100
+ This is the program that launches the automated tasks.
101
+
102
+ Build system:
103
+
104
+ `bundle exec rake`
105
+
106
+ Run tests, generate doc:
107
+
108
+ `bundle exec test'
109
+
110
+
111
+ ### RSpec
112
+
113
+ > https://relishapp.com/rspec
114
+
115
+ Installed via `bundle update`.
116
+
117
+ RSpec is a tool used to run tests on Ruby code, as well as serve as documentation.
118
+ There are many tutorials on RSpec online, including their website listed above.
119
+
120
+
121
+ ### Pry
122
+
123
+ > http://pryrepl.org
124
+
125
+ Installed via:
126
+
127
+ gem install pry
128
+ gem install rb-readline
129
+
130
+ Pry is a handy interactive terminal to manipluate running code.
data/template/Rakefile ADDED
@@ -0,0 +1,11 @@
1
+
2
+ # ------------------------------------------------------------
3
+ # This file contains a set of automated tasks.
4
+ # See project documentation at: doc/index.html
5
+ #
6
+ # Run `rake` from the command line to compile this project.
7
+ #
8
+ # Run `rake --task` from the command line to see all
9
+ # available tasks for this project.
10
+ # ------------------------------------------------------------
11
+ require 'netlinx/rake/erb'
data/template/rpc.axi ADDED
@@ -0,0 +1,148 @@
1
+ (***********************************************************
2
+ Remote Procedure Call (Troubleshoot by calling functions)
3
+ ************************************************************)
4
+ /*---------------------------------------------------------------------------
5
+ The MIT License (MIT)
6
+
7
+ Copyright (c) 2014 Alex McLain and Joe McIlvain
8
+
9
+ Permission is hereby granted, free of charge, to any person obtaining a copy
10
+ of this software and associated documentation files (the "Software"), to deal
11
+ in the Software without restriction, including without limitation the rights
12
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
+ copies of the Software, and to permit persons to whom the Software is
14
+ furnished to do so, subject to the following conditions:
15
+
16
+ The above copyright notice and this permission notice shall be included in
17
+ all copies or substantial portions of the Software.
18
+
19
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25
+ THE SOFTWARE.
26
+ ---------------------------------------------------------------------------*/
27
+
28
+ #if_not_defined PS_RPC
29
+ #define PS_RPC 1
30
+ (***********************************************************)
31
+ (* System Type : NetLinx *)
32
+ (***********************************************************)
33
+ (* DEVICE NUMBER DEFINITIONS GO BELOW *)
34
+ (***********************************************************)
35
+ DEFINE_DEVICE
36
+
37
+ #if_not_defined vdvRPC
38
+ // Virtual Debugging Device to receive RPC strings from user on.
39
+ // This can also be overridden in the master source code file if necessary.
40
+ vdvRPC = 34500:1:0;
41
+ #end_if
42
+
43
+ (***********************************************************)
44
+ (* CONSTANT DEFINITIONS GO BELOW *)
45
+ (***********************************************************)
46
+ DEFINE_CONSTANT
47
+
48
+ (***********************************************************)
49
+ (* INCLUDES GO BELOW *)
50
+ (***********************************************************)
51
+
52
+ (***********************************************************)
53
+ (* DATA TYPE DEFINITIONS GO BELOW *)
54
+ (***********************************************************)
55
+ DEFINE_TYPE
56
+
57
+ (***********************************************************)
58
+ (* VARIABLE DEFINITIONS GO BELOW *)
59
+ (***********************************************************)
60
+ DEFINE_VARIABLE
61
+
62
+ (***********************************************************)
63
+ (* SUBROUTINE/FUNCTION DEFINITIONS GO BELOW *)
64
+ (***********************************************************)
65
+
66
+
67
+ ///
68
+ // User input string parsing functions
69
+
70
+ // Parse and return the name of the function from the given input string
71
+ define_function char[255] rpc_function_name(char input[])
72
+ {
73
+ return rpc_get_arg(0, lower_string(input));
74
+ }
75
+
76
+ // Parse and return the nth argument of the function
77
+ define_function char[255] rpc_get_arg(integer index, char input[])
78
+ {
79
+ integer start;
80
+ integer end;
81
+ integer i;
82
+ char output[255];
83
+
84
+ end = 0;
85
+ for (i = 0; i <= index; i++)
86
+ {
87
+ start = end;
88
+ end = find_string(input, ' ', end+1);
89
+ }
90
+
91
+ return mid_string(input, start+1, end-start-1);
92
+ }
93
+
94
+ // Parse and return the nth argument of the function as a string (same as rpc_get_arg)
95
+ define_function char[255] rpc_get_arg_s(integer index, char input[])
96
+ {
97
+ return rpc_get_arg(index, input);
98
+ }
99
+
100
+ // Parse and return the nth argument of the function as an integer
101
+ define_function integer rpc_get_arg_i(integer index, char input[])
102
+ {
103
+ return atoi(rpc_get_arg(index, input));
104
+ }
105
+
106
+
107
+ ///
108
+ // Output logging functions
109
+
110
+ // Print the string return value of the function call
111
+ define_function rpc_log(char output[])
112
+ {
113
+ print(LOG_LEVEL_INFO, "'RPC function returned string: ', output");
114
+ }
115
+
116
+ // Print the string return value of the function call
117
+ define_function rpc_log_s(char output[])
118
+ {
119
+ print(LOG_LEVEL_INFO, "'RPC function returned string: ', output");
120
+ }
121
+
122
+ // Print the integer return value of the function call
123
+ define_function rpc_log_i(integer output)
124
+ {
125
+ print(LOG_LEVEL_INFO, "'RPC function returned integer: ', itoa(output)");
126
+ }
127
+
128
+
129
+ (***********************************************************)
130
+ (* STARTUP CODE GOES BELOW *)
131
+ (***********************************************************)
132
+ DEFINE_START
133
+
134
+ (***********************************************************)
135
+ (* THE EVENTS GO BELOW *)
136
+ (***********************************************************)
137
+ DEFINE_EVENT
138
+
139
+ (***********************************************************)
140
+ (* THE MAINLINE GOES BELOW *)
141
+ (***********************************************************)
142
+ DEFINE_PROGRAM
143
+
144
+ (***********************************************************)
145
+ (* END OF PROGRAM *)
146
+ (* DO NOT PUT ANY CODE BELOW THIS COMMENT *)
147
+ (***********************************************************)
148
+ #end_if
metadata ADDED
@@ -0,0 +1,234 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: netlinx-erb
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Alex McLain
8
+ - Joe Eli McIlvain
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2015-01-30 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: netlinx-compile
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - "~>"
19
+ - !ruby/object:Gem::Version
20
+ version: '3.1'
21
+ type: :runtime
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - "~>"
26
+ - !ruby/object:Gem::Version
27
+ version: '3.1'
28
+ - !ruby/object:Gem::Dependency
29
+ name: netlinx-workspace
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - "~>"
33
+ - !ruby/object:Gem::Version
34
+ version: 0.3.0
35
+ type: :runtime
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - "~>"
40
+ - !ruby/object:Gem::Version
41
+ version: 0.3.0
42
+ - !ruby/object:Gem::Dependency
43
+ name: netlinx-src
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - "~>"
47
+ - !ruby/object:Gem::Version
48
+ version: '0.3'
49
+ type: :runtime
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - "~>"
54
+ - !ruby/object:Gem::Version
55
+ version: '0.3'
56
+ - !ruby/object:Gem::Dependency
57
+ name: rake
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - "~>"
61
+ - !ruby/object:Gem::Version
62
+ version: '10.4'
63
+ type: :runtime
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - "~>"
68
+ - !ruby/object:Gem::Version
69
+ version: '10.4'
70
+ - !ruby/object:Gem::Dependency
71
+ name: yard
72
+ requirement: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - "~>"
75
+ - !ruby/object:Gem::Version
76
+ version: 0.8.7
77
+ type: :runtime
78
+ prerelease: false
79
+ version_requirements: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - "~>"
82
+ - !ruby/object:Gem::Version
83
+ version: 0.8.7
84
+ - !ruby/object:Gem::Dependency
85
+ name: rspec
86
+ requirement: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - "~>"
89
+ - !ruby/object:Gem::Version
90
+ version: '3.1'
91
+ type: :development
92
+ prerelease: false
93
+ version_requirements: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - "~>"
96
+ - !ruby/object:Gem::Version
97
+ version: '3.1'
98
+ - !ruby/object:Gem::Dependency
99
+ name: rspec-its
100
+ requirement: !ruby/object:Gem::Requirement
101
+ requirements:
102
+ - - "~>"
103
+ - !ruby/object:Gem::Version
104
+ version: '1.1'
105
+ type: :development
106
+ prerelease: false
107
+ version_requirements: !ruby/object:Gem::Requirement
108
+ requirements:
109
+ - - "~>"
110
+ - !ruby/object:Gem::Version
111
+ version: '1.1'
112
+ - !ruby/object:Gem::Dependency
113
+ name: fivemat
114
+ requirement: !ruby/object:Gem::Requirement
115
+ requirements:
116
+ - - "~>"
117
+ - !ruby/object:Gem::Version
118
+ version: '1.3'
119
+ type: :development
120
+ prerelease: false
121
+ version_requirements: !ruby/object:Gem::Requirement
122
+ requirements:
123
+ - - "~>"
124
+ - !ruby/object:Gem::Version
125
+ version: '1.3'
126
+ - !ruby/object:Gem::Dependency
127
+ name: pry
128
+ requirement: !ruby/object:Gem::Requirement
129
+ requirements:
130
+ - - ">="
131
+ - !ruby/object:Gem::Version
132
+ version: '0'
133
+ type: :development
134
+ prerelease: false
135
+ version_requirements: !ruby/object:Gem::Requirement
136
+ requirements:
137
+ - - ">="
138
+ - !ruby/object:Gem::Version
139
+ version: '0'
140
+ - !ruby/object:Gem::Dependency
141
+ name: rb-readline
142
+ requirement: !ruby/object:Gem::Requirement
143
+ requirements:
144
+ - - ">="
145
+ - !ruby/object:Gem::Version
146
+ version: '0'
147
+ type: :development
148
+ prerelease: false
149
+ version_requirements: !ruby/object:Gem::Requirement
150
+ requirements:
151
+ - - ">="
152
+ - !ruby/object:Gem::Version
153
+ version: '0'
154
+ description: A code generation utility for AMX NetLinx control systems.
155
+ email:
156
+ - alex@alexmclain.com
157
+ - joe.eli.mac@gmail.com
158
+ executables: []
159
+ extensions: []
160
+ extra_rdoc_files: []
161
+ files:
162
+ - README.md
163
+ - doc/Array.html
164
+ - doc/Hash.html
165
+ - doc/HashHelpers.html
166
+ - doc/Helpers.html
167
+ - doc/NetLinx.html
168
+ - doc/NetLinx/ERB.html
169
+ - doc/NetLinx/ERB/HashHelpers.html
170
+ - doc/NetLinx/ERB/Helpers.html
171
+ - doc/NetLinx/Rake.html
172
+ - doc/NetLinx/Rake/ERB.html
173
+ - doc/NetLinx/Rake/ERB/Compile.html
174
+ - doc/NetLinx/Rake/ERB/GenerateERB.html
175
+ - doc/NetLinx/Rake/ERB/GenerateRPC.html
176
+ - doc/NetLinx/Rake/ERB/Lines.html
177
+ - doc/NetLinx/Rake/Lines.html
178
+ - doc/RPC.html
179
+ - doc/String.html
180
+ - doc/_index.html
181
+ - doc/class_list.html
182
+ - doc/css/common.css
183
+ - doc/css/full_list.css
184
+ - doc/css/style.css
185
+ - doc/file.README.html
186
+ - doc/file.license.html
187
+ - doc/file_list.html
188
+ - doc/frames.html
189
+ - doc/index.html
190
+ - doc/js/app.js
191
+ - doc/js/full_list.js
192
+ - doc/js/jquery.js
193
+ - doc/method_list.html
194
+ - doc/top-level-namespace.html
195
+ - lib/netlinx-erb.rb
196
+ - lib/netlinx/erb/erb.rb
197
+ - lib/netlinx/erb/hash_helpers.rb
198
+ - lib/netlinx/erb/helpers.rb
199
+ - lib/netlinx/erb/rpc.rb
200
+ - lib/netlinx/rake/erb.rb
201
+ - lib/netlinx/rake/erb/generate_erb.rb
202
+ - lib/netlinx/rake/erb/generate_rpc.rb
203
+ - lib/netlinx/rake/erb/lines.rb
204
+ - license.txt
205
+ - template/Gemfile
206
+ - template/README.md
207
+ - template/Rakefile
208
+ - template/rpc.axi
209
+ homepage: https://github.com/amclain/netlinx-erb
210
+ licenses:
211
+ - MIT
212
+ metadata: {}
213
+ post_install_message:
214
+ rdoc_options: []
215
+ require_paths:
216
+ - lib
217
+ required_ruby_version: !ruby/object:Gem::Requirement
218
+ requirements:
219
+ - - ">="
220
+ - !ruby/object:Gem::Version
221
+ version: '0'
222
+ required_rubygems_version: !ruby/object:Gem::Requirement
223
+ requirements:
224
+ - - ">="
225
+ - !ruby/object:Gem::Version
226
+ version: '0'
227
+ requirements: []
228
+ rubyforge_project:
229
+ rubygems_version: 2.2.3
230
+ signing_key:
231
+ specification_version: 4
232
+ summary: A code generation utility for AMX NetLinx control systems.
233
+ test_files: []
234
+ has_rdoc: