netlinx-erb 1.0.0 → 1.1.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.
@@ -1,6 +1,8 @@
1
1
 
2
2
  require 'yard'
3
3
  require 'netlinx/rake/compile'
4
+ require 'netlinx/rake/workspace/create_workspace_config'
5
+ require 'netlinx/rake/workspace/generate_apw'
4
6
  require 'netlinx/rake/src'
5
7
 
6
8
  require_relative 'erb/generate_erb'
@@ -12,7 +14,10 @@ task :default=>[:generate_rpc, :check_for_docs, :compile, :pack]
12
14
 
13
15
  NetLinx::Rake::ERB::Lines.new
14
16
  NetLinx::Rake::ERB::GenerateERB.new
15
- NetLinx::Rake::ERB::GenerateRPC.new :generate_rpc => :generate_erb
17
+ NetLinx::Rake::ERB::GenerateRPC.new :generate_rpc => :generate_apw
18
+
19
+ NetLinx::Rake::Workspace::CreateWorkspaceConfig.new
20
+ NetLinx::Rake::Workspace::GenerateAPW.new :generate_apw => :generate_erb
16
21
 
17
22
  # Generate Ruby documentation.
18
23
  YARD::Rake::YardocTask.new :doc do |t|
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2015 Alex McLain and Joe McIlvain
3
+ Copyright (c) 2014-2015 Alex McLain and Joe McIlvain
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: netlinx-erb
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex McLain
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-01-30 00:00:00.000000000 Z
12
+ date: 2015-02-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: netlinx-compile
@@ -31,14 +31,14 @@ dependencies:
31
31
  requirements:
32
32
  - - "~>"
33
33
  - !ruby/object:Gem::Version
34
- version: 0.3.0
34
+ version: '1.0'
35
35
  type: :runtime
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
39
  - - "~>"
40
40
  - !ruby/object:Gem::Version
41
- version: 0.3.0
41
+ version: '1.0'
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: netlinx-src
44
44
  requirement: !ruby/object:Gem::Requirement
@@ -155,11 +155,13 @@ description: A code generation utility for AMX NetLinx control systems.
155
155
  email:
156
156
  - alex@alexmclain.com
157
157
  - joe.eli.mac@gmail.com
158
- executables: []
158
+ executables:
159
+ - netlinx-erb
159
160
  extensions: []
160
161
  extra_rdoc_files: []
161
162
  files:
162
163
  - README.md
164
+ - bin/netlinx-erb
163
165
  - doc/Array.html
164
166
  - doc/Hash.html
165
167
  - doc/HashHelpers.html
@@ -202,10 +204,7 @@ files:
202
204
  - lib/netlinx/rake/erb/generate_rpc.rb
203
205
  - lib/netlinx/rake/erb/lines.rb
204
206
  - license.txt
205
- - template/Gemfile
206
- - template/README.md
207
- - template/Rakefile
208
- - template/rpc.axi
207
+ - template.zip
209
208
  homepage: https://github.com/amclain/netlinx-erb
210
209
  licenses:
211
210
  - MIT
@@ -226,7 +225,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
226
225
  version: '0'
227
226
  requirements: []
228
227
  rubyforge_project:
229
- rubygems_version: 2.2.3
228
+ rubygems_version: 2.4.6
230
229
  signing_key:
231
230
  specification_version: 4
232
231
  summary: A code generation utility for AMX NetLinx control systems.
@@ -1,9 +0,0 @@
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'
@@ -1,130 +0,0 @@
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.
@@ -1,11 +0,0 @@
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'
@@ -1,148 +0,0 @@
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