MrMurano 1.6.3 → 1.7.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.
- checksums.yaml +4 -4
- data/.gitignore +1 -2
- data/Gemfile +1 -1
- data/MrMurano.gemspec +1 -1
- data/README.markdown +4 -0
- data/TODO.taskpaper +17 -4
- data/lib/MrMurano/Account.rb +5 -1
- data/lib/MrMurano/Config.rb +3 -1
- data/lib/MrMurano/Product-Resources.rb +239 -0
- data/lib/MrMurano/Product.rb +51 -2
- data/lib/MrMurano/Solution-Cors.rb +81 -0
- data/lib/MrMurano/Solution-Endpoint.rb +8 -4
- data/lib/MrMurano/Solution-File.rb +4 -2
- data/lib/MrMurano/Solution-ServiceConfig.rb +74 -1
- data/lib/MrMurano/Solution-Services.rb +4 -2
- data/lib/MrMurano/Solution-Users.rb +6 -3
- data/lib/MrMurano/Solution.rb +6 -274
- data/lib/MrMurano/SyncUpDown.rb +433 -0
- data/lib/MrMurano/commands/completion.rb +152 -0
- data/lib/MrMurano/commands/content.rb +15 -14
- data/lib/MrMurano/commands/cors.rb +11 -38
- data/lib/MrMurano/commands/exportImport.rb +4 -3
- data/lib/MrMurano/commands/keystore.rb +15 -16
- data/lib/MrMurano/commands/logs.rb +2 -2
- data/lib/MrMurano/commands/productCreate.rb +4 -4
- data/lib/MrMurano/commands/productDelete.rb +6 -8
- data/lib/MrMurano/commands/productSpec.rb +31 -36
- data/lib/MrMurano/commands/productWrite.rb +9 -7
- data/lib/MrMurano/commands/serialNumberCmds.rb +4 -4
- data/lib/MrMurano/commands/solutionCreate.rb +4 -4
- data/lib/MrMurano/commands/solutionDelete.rb +5 -5
- data/lib/MrMurano/commands/status.rb +9 -42
- data/lib/MrMurano/commands/sync.rb +15 -71
- data/lib/MrMurano/commands/timeseries.rb +23 -29
- data/lib/MrMurano/commands/tsdb.rb +202 -0
- data/lib/MrMurano/commands/zshcomplete.erb +112 -0
- data/lib/MrMurano/commands.rb +4 -1
- data/lib/MrMurano/http.rb +4 -3
- data/lib/MrMurano/makePretty.rb +15 -6
- data/lib/MrMurano/verbosing.rb +71 -0
- data/lib/MrMurano/version.rb +1 -1
- data/lib/MrMurano.rb +1 -0
- data/spec/ConfigFile_spec.rb +3 -3
- data/spec/ProductContent_spec.rb +2 -2
- data/spec/ProductResources_spec.rb +152 -0
- data/spec/Product_spec.rb +38 -1
- data/spec/Solution-Cors_spec.rb +134 -0
- data/spec/Solution-ServiceConfig_spec.rb +198 -0
- data/spec/SyncRoot_spec.rb +74 -0
- data/spec/cmd_config_spec.rb +51 -0
- data/spec/fixtures/.mrmuranorc +9 -0
- data/spec/{testfiles → fixtures}/configfile +0 -0
- data/spec/fixtures/mrmuranorc_deleted_bob +8 -0
- data/spec/fixtures/product_spec_files/example.exoline.spec.yaml +116 -0
- data/spec/fixtures/product_spec_files/example.murano.spec.yaml +14 -0
- data/spec/fixtures/product_spec_files/gwe.exoline.spec.yaml +21 -0
- data/spec/fixtures/product_spec_files/gwe.murano.spec.yaml +16 -0
- data/spec/{lightbulb.yaml → fixtures/product_spec_files/lightbulb.yaml} +0 -0
- data/spec/spec_helper.rb +4 -4
- metadata +47 -19
@@ -0,0 +1,198 @@
|
|
1
|
+
require 'MrMurano/version'
|
2
|
+
require 'MrMurano/Solution-ServiceConfig'
|
3
|
+
require 'tempfile'
|
4
|
+
|
5
|
+
RSpec.describe MrMurano::ServiceConfig do
|
6
|
+
before(:example) do
|
7
|
+
$cfg = MrMurano::Config.new
|
8
|
+
$cfg.load
|
9
|
+
$cfg['net.host'] = 'bizapi.hosted.exosite.io'
|
10
|
+
$cfg['solution.id'] = 'XYZ'
|
11
|
+
|
12
|
+
@srv = MrMurano::ServiceConfig.new
|
13
|
+
allow(@srv).to receive(:token).and_return("TTTTTTTTTT")
|
14
|
+
end
|
15
|
+
|
16
|
+
it "initializes" do
|
17
|
+
uri = @srv.endPoint('/')
|
18
|
+
expect(uri.to_s).to eq("https://bizapi.hosted.exosite.io/api:1/solution/XYZ/serviceconfig/")
|
19
|
+
end
|
20
|
+
|
21
|
+
it "lists" do
|
22
|
+
body = {:items=>[{:id=>"9K0",
|
23
|
+
:name=>"debug",
|
24
|
+
:alias=>"XYZ_debug",
|
25
|
+
:solution_id=>"XYZ",
|
26
|
+
:service=>"device",
|
27
|
+
:status=>"ready",
|
28
|
+
:created_at=>"2016-07-07T19:16:19.479Z",
|
29
|
+
:updated_at=>"2016-09-12T13:26:55.868Z",
|
30
|
+
:deleted_at=>nil}],
|
31
|
+
:total=>1}
|
32
|
+
stub_request(:get, "https://bizapi.hosted.exosite.io/api:1/solution/XYZ/serviceconfig").
|
33
|
+
with(:headers=>{'Authorization'=>'token TTTTTTTTTT',
|
34
|
+
'Content-Type'=>'application/json'}).
|
35
|
+
to_return(body: body.to_json)
|
36
|
+
|
37
|
+
ret = @srv.list()
|
38
|
+
expect(ret).to eq(body[:items])
|
39
|
+
end
|
40
|
+
|
41
|
+
it "fetches" do
|
42
|
+
body = {:id=>"9K0",
|
43
|
+
:name=>"debug",
|
44
|
+
:alias=>"XYZ_debug",
|
45
|
+
:solution_id=>"XYZ",
|
46
|
+
:service=>"device",
|
47
|
+
:status=>"ready",
|
48
|
+
:created_at=>"2016-07-07T19:16:19.479Z",
|
49
|
+
:updated_at=>"2016-09-12T13:26:55.868Z"
|
50
|
+
}
|
51
|
+
stub_request(:get, "https://bizapi.hosted.exosite.io/api:1/solution/XYZ/serviceconfig/9K0").
|
52
|
+
with(:headers=>{'Authorization'=>'token TTTTTTTTTT',
|
53
|
+
'Content-Type'=>'application/json'}).
|
54
|
+
to_return(body: body.to_json)
|
55
|
+
|
56
|
+
ret = @srv.fetch('9K0')
|
57
|
+
expect(ret).to eq(body)
|
58
|
+
end
|
59
|
+
|
60
|
+
it "gets id from service" do
|
61
|
+
body = {:items=>[{:id=>"9K0",
|
62
|
+
:name=>"debug",
|
63
|
+
:alias=>"XYZ_debug",
|
64
|
+
:solution_id=>"XYZ",
|
65
|
+
:service=>"device",
|
66
|
+
:status=>"ready",
|
67
|
+
:created_at=>"2016-07-07T19:16:19.479Z",
|
68
|
+
:updated_at=>"2016-09-12T13:26:55.868Z",
|
69
|
+
:deleted_at=>nil}],
|
70
|
+
:total=>1}
|
71
|
+
stub_request(:get, "https://bizapi.hosted.exosite.io/api:1/solution/XYZ/serviceconfig").
|
72
|
+
with(:headers=>{'Authorization'=>'token TTTTTTTTTT',
|
73
|
+
'Content-Type'=>'application/json'}).
|
74
|
+
to_return(body: body.to_json)
|
75
|
+
|
76
|
+
ret = @srv.scid_for_name('device')
|
77
|
+
expect(ret).to eq("9K0")
|
78
|
+
end
|
79
|
+
|
80
|
+
it "gets nil if not there" do
|
81
|
+
body = {:items=>[{:id=>"9K0",
|
82
|
+
:name=>"debug",
|
83
|
+
:alias=>"XYZ_debug",
|
84
|
+
:solution_id=>"XYZ",
|
85
|
+
:service=>"device",
|
86
|
+
:status=>"ready",
|
87
|
+
:created_at=>"2016-07-07T19:16:19.479Z",
|
88
|
+
:updated_at=>"2016-09-12T13:26:55.868Z",
|
89
|
+
:deleted_at=>nil}],
|
90
|
+
:total=>1}
|
91
|
+
stub_request(:get, "https://bizapi.hosted.exosite.io/api:1/solution/XYZ/serviceconfig").
|
92
|
+
with(:headers=>{'Authorization'=>'token TTTTTTTTTT',
|
93
|
+
'Content-Type'=>'application/json'}).
|
94
|
+
to_return(body: body.to_json)
|
95
|
+
|
96
|
+
ret = @srv.scid_for_name('debug')
|
97
|
+
expect(ret).to eq(nil)
|
98
|
+
end
|
99
|
+
|
100
|
+
it "gets info" do
|
101
|
+
body = {:calls=>{:daily=>0, :monthly=>0, :total=>0}}
|
102
|
+
stub_request(:get, "https://bizapi.hosted.exosite.io/api:1/solution/XYZ/serviceconfig/9K0/info").
|
103
|
+
with(:headers=>{'Authorization'=>'token TTTTTTTTTT',
|
104
|
+
'Content-Type'=>'application/json'}).
|
105
|
+
to_return(body: body.to_json)
|
106
|
+
|
107
|
+
ret = @srv.info('9K0')
|
108
|
+
expect(ret).to eq(body)
|
109
|
+
end
|
110
|
+
|
111
|
+
context "calls" do
|
112
|
+
before(:example) do
|
113
|
+
allow(@srv).to receive(:scid).and_return("9K0")
|
114
|
+
end
|
115
|
+
it "a get" do
|
116
|
+
body = {:calls=>{:daily=>0, :monthly=>0, :total=>0}}
|
117
|
+
stub_request(:get, "https://bizapi.hosted.exosite.io/api:1/solution/XYZ/serviceconfig/9K0/call/info").
|
118
|
+
with(:headers=>{'Authorization'=>'token TTTTTTTTTT',
|
119
|
+
'Content-Type'=>'application/json'}).
|
120
|
+
to_return(body: body.to_json)
|
121
|
+
|
122
|
+
ret = @srv.call(:info)
|
123
|
+
expect(ret).to eq(body)
|
124
|
+
end
|
125
|
+
|
126
|
+
it "a get with query" do
|
127
|
+
body = {:calls=>{:daily=>0, :monthly=>0, :total=>0}}
|
128
|
+
stub_request(:get, "https://bizapi.hosted.exosite.io/api:1/solution/XYZ/serviceconfig/9K0/call/ask?q=what").
|
129
|
+
with(:headers=>{'Authorization'=>'token TTTTTTTTTT',
|
130
|
+
'Content-Type'=>'application/json'}).
|
131
|
+
to_return(body: body.to_json)
|
132
|
+
|
133
|
+
ret = @srv.call(:ask, :get, {:q=>'what'})
|
134
|
+
expect(ret).to eq(body)
|
135
|
+
end
|
136
|
+
|
137
|
+
it "a post" do
|
138
|
+
body = {:calls=>{:daily=>0, :monthly=>0, :total=>0}}
|
139
|
+
stub_request(:post, "https://bizapi.hosted.exosite.io/api:1/solution/XYZ/serviceconfig/9K0/call/ask").
|
140
|
+
with(:body => JSON.generate({:q=> 'what'}),
|
141
|
+
:headers=>{'Authorization'=>'token TTTTTTTTTT',
|
142
|
+
'Content-Type'=>'application/json'}).
|
143
|
+
to_return(body: body.to_json)
|
144
|
+
|
145
|
+
ret = @srv.call(:ask, :post, {:q=>'what'})
|
146
|
+
expect(ret).to eq(body)
|
147
|
+
end
|
148
|
+
|
149
|
+
it "a post without data" do
|
150
|
+
body = {:calls=>{:daily=>0, :monthly=>0, :total=>0}}
|
151
|
+
stub_request(:post, "https://bizapi.hosted.exosite.io/api:1/solution/XYZ/serviceconfig/9K0/call/ask").
|
152
|
+
with(:body => JSON.generate({}),
|
153
|
+
:headers=>{'Authorization'=>'token TTTTTTTTTT',
|
154
|
+
'Content-Type'=>'application/json'}).
|
155
|
+
to_return(body: body.to_json)
|
156
|
+
|
157
|
+
ret = @srv.call(:ask, :post)
|
158
|
+
expect(ret).to eq(body)
|
159
|
+
end
|
160
|
+
|
161
|
+
it "a put" do
|
162
|
+
body = {:calls=>{:daily=>0, :monthly=>0, :total=>0}}
|
163
|
+
stub_request(:put, "https://bizapi.hosted.exosite.io/api:1/solution/XYZ/serviceconfig/9K0/call/ask").
|
164
|
+
with(:body => JSON.generate({:q=> 'what'}),
|
165
|
+
:headers=>{'Authorization'=>'token TTTTTTTTTT',
|
166
|
+
'Content-Type'=>'application/json'}).
|
167
|
+
to_return(body: body.to_json)
|
168
|
+
|
169
|
+
ret = @srv.call(:ask, :put, {:q=>'what'})
|
170
|
+
expect(ret).to eq(body)
|
171
|
+
end
|
172
|
+
|
173
|
+
it "a put without data" do
|
174
|
+
body = {:calls=>{:daily=>0, :monthly=>0, :total=>0}}
|
175
|
+
stub_request(:put, "https://bizapi.hosted.exosite.io/api:1/solution/XYZ/serviceconfig/9K0/call/ask").
|
176
|
+
with(:body => JSON.generate({}),
|
177
|
+
:headers=>{'Authorization'=>'token TTTTTTTTTT',
|
178
|
+
'Content-Type'=>'application/json'}).
|
179
|
+
to_return(body: body.to_json)
|
180
|
+
|
181
|
+
ret = @srv.call(:ask, :put)
|
182
|
+
expect(ret).to eq(body)
|
183
|
+
end
|
184
|
+
|
185
|
+
it "a delete" do
|
186
|
+
body = {:calls=>{:daily=>0, :monthly=>0, :total=>0}}
|
187
|
+
stub_request(:delete, "https://bizapi.hosted.exosite.io/api:1/solution/XYZ/serviceconfig/9K0/call/gone").
|
188
|
+
with(:headers=>{'Authorization'=>'token TTTTTTTTTT',
|
189
|
+
'Content-Type'=>'application/json'}).
|
190
|
+
to_return(body: body.to_json)
|
191
|
+
|
192
|
+
ret = @srv.call(:gone, :delete)
|
193
|
+
expect(ret).to eq(body)
|
194
|
+
end
|
195
|
+
end
|
196
|
+
|
197
|
+
end
|
198
|
+
# vim: set ai et sw=2 ts=2 :
|
@@ -0,0 +1,74 @@
|
|
1
|
+
require 'MrMurano/version'
|
2
|
+
require 'MrMurano/Config'
|
3
|
+
require 'MrMurano/SyncUpDown'
|
4
|
+
|
5
|
+
RSpec.describe MrMurano::SyncRoot do
|
6
|
+
|
7
|
+
after(:example) do
|
8
|
+
MrMurano::SyncRoot.reset
|
9
|
+
end
|
10
|
+
|
11
|
+
it "Adds" do
|
12
|
+
class User
|
13
|
+
end
|
14
|
+
class Role
|
15
|
+
end
|
16
|
+
MrMurano::SyncRoot.add('user', User, 'U', "describe user")
|
17
|
+
MrMurano::SyncRoot.add('role', Role, 'R', "describe role")
|
18
|
+
end
|
19
|
+
|
20
|
+
context "b" do
|
21
|
+
before(:example) do
|
22
|
+
class User
|
23
|
+
end
|
24
|
+
class Role
|
25
|
+
end
|
26
|
+
MrMurano::SyncRoot.add('user', User, 'U', "describe user", true)
|
27
|
+
MrMurano::SyncRoot.add('role', Role, 'R', "describe role")
|
28
|
+
|
29
|
+
@options = {}
|
30
|
+
@options.define_singleton_method(:method_missing) do |mid,*args|
|
31
|
+
if mid.to_s.match(/^(.+)=$/) then
|
32
|
+
self[$1.to_sym] = args.first
|
33
|
+
else
|
34
|
+
self[mid]
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
end
|
39
|
+
|
40
|
+
it "iterrates on each" do
|
41
|
+
ret=[]
|
42
|
+
MrMurano::SyncRoot.each{|a,b,c| ret << a}
|
43
|
+
expect(ret).to eq(["user", "role"])
|
44
|
+
end
|
45
|
+
|
46
|
+
it "iterrates only on selected" do
|
47
|
+
@options.role = true
|
48
|
+
ret=[]
|
49
|
+
MrMurano::SyncRoot.each_filtered(@options) {|a,b,c| ret << a}
|
50
|
+
expect(ret).to eq(["role"])
|
51
|
+
end
|
52
|
+
|
53
|
+
it "selects all" do
|
54
|
+
@options.all = true
|
55
|
+
MrMurano::SyncRoot.checkSAME(@options)
|
56
|
+
expect(@options).to eq({:all=>true, :user=>true, :role=>true})
|
57
|
+
end
|
58
|
+
|
59
|
+
it "selects defaults when none" do
|
60
|
+
MrMurano::SyncRoot.checkSAME(@options)
|
61
|
+
expect(@options).to eq({:user=>true})
|
62
|
+
end
|
63
|
+
|
64
|
+
it "builds option params" do
|
65
|
+
ret=[]
|
66
|
+
MrMurano::SyncRoot.each_option do |s,l,d|
|
67
|
+
ret << [s,l,d]
|
68
|
+
end
|
69
|
+
expect(ret).to eq([["-u", "--[no-]user", "describe user"], ["-r", "--[no-]role", "describe role"]])
|
70
|
+
end
|
71
|
+
|
72
|
+
end
|
73
|
+
end
|
74
|
+
# vim: set ai et sw=2 ts=2 :
|
@@ -0,0 +1,51 @@
|
|
1
|
+
require 'tmpdir'
|
2
|
+
require 'open3'
|
3
|
+
require 'fileutils'
|
4
|
+
|
5
|
+
RSpec.describe 'mr config' do
|
6
|
+
|
7
|
+
pref = "ruby -Ilib bin/"
|
8
|
+
around(:example) do |ex|
|
9
|
+
Dir.mktmpdir do |dir|
|
10
|
+
@tmpdir = dir
|
11
|
+
ex.run
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
it "Needs a key" do
|
16
|
+
out, err, status = Open3.capture3("#{pref}mr config")
|
17
|
+
expect(status).to eq(0)
|
18
|
+
expect(out).to eq("\e[31mNeed a config key\e[0m\n")
|
19
|
+
expect(err).to eq('')
|
20
|
+
end
|
21
|
+
|
22
|
+
it "Sets a key" do
|
23
|
+
out, err, status = Open3.capture3("#{pref}mr config bob build")
|
24
|
+
expect(status).to eq(0)
|
25
|
+
expect(out).to eq('')
|
26
|
+
expect(err).to eq('')
|
27
|
+
end
|
28
|
+
|
29
|
+
it "Reads a key" do
|
30
|
+
FileUtils.copy_file 'spec/fixtures/.mrmuranorc', File.join(@tmpdir, '.mrmuranorc'), :verbose => true
|
31
|
+
out, err, status = Open3.capture3("#{pref}mr config --project doThisTest.bob")
|
32
|
+
expect(status).to eq(0)
|
33
|
+
expect(out).to eq('')
|
34
|
+
expect(err).to eq('')
|
35
|
+
end
|
36
|
+
|
37
|
+
it "Removes a key" do
|
38
|
+
rcf = File.join(@tmpdir, '.mrmuranorc')
|
39
|
+
FileUtils.copy_file 'spec/fixtures/.mrmuranorc', rcf, :verbose => true
|
40
|
+
out, err, status = Open3.capture3(%{#{pref}mr config --project --unset doThisTest.bob})
|
41
|
+
expect(status).to eq(0)
|
42
|
+
expect(out).to eq('')
|
43
|
+
expect(err).to eq('')
|
44
|
+
|
45
|
+
afile = IO.read(rcf)
|
46
|
+
bfile = IO.read('spec/fixtures/.mrmuranorc')
|
47
|
+
expect(afile).to eq(bfile)
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
# vim: set ai et sw=2 ts=2 :
|
File without changes
|
@@ -0,0 +1,116 @@
|
|
1
|
+
|
2
|
+
# Example client specification file
|
3
|
+
# Specification files are in YAML format (a superset of JSON
|
4
|
+
# with more readable syntax and support for comments) and
|
5
|
+
# look like this. They may contain comments that begin
|
6
|
+
# with a # sign.
|
7
|
+
|
8
|
+
# Device client model information
|
9
|
+
device:
|
10
|
+
model: "myModel"
|
11
|
+
vendor: "myVendor"
|
12
|
+
|
13
|
+
# list of dataports that must exist
|
14
|
+
dataports:
|
15
|
+
# this the absolute minimum needed to specify a
|
16
|
+
# dataport.
|
17
|
+
- alias: mystring
|
18
|
+
# names are created, but not compared
|
19
|
+
- name: Temperature
|
20
|
+
# aliases, type, and format are created
|
21
|
+
# and compared
|
22
|
+
alias: temp
|
23
|
+
format: float
|
24
|
+
unit: °F
|
25
|
+
- name: LED Control
|
26
|
+
alias: led6
|
27
|
+
format: integer
|
28
|
+
- alias: config
|
29
|
+
# format should be string, and parseable JSON
|
30
|
+
format: string/json
|
31
|
+
# initial value (if no other value is read back)
|
32
|
+
initial: '{"text": "555-555-1234", "email": "jeff@555.com"}'
|
33
|
+
- alias: person
|
34
|
+
format: string/json
|
35
|
+
# JSON schema specified inline (http://json-schema.org/)
|
36
|
+
# format must be string/json to do validate
|
37
|
+
# you may also specify a string to reference schema in an
|
38
|
+
# external file. E.g. jsonschema: personschema.json
|
39
|
+
jsonschema: {"title": "Person Schema",
|
40
|
+
"type": "object",
|
41
|
+
"properties": {"name": {"type": "string"}},
|
42
|
+
"required": ["name"]}
|
43
|
+
initial: '{"name":"John Doe"}'
|
44
|
+
- alias: place
|
45
|
+
# An description of the dataport.
|
46
|
+
description: 'This is a place I have been'
|
47
|
+
# Dataports are not public by default,
|
48
|
+
# but if you want to share one with the world
|
49
|
+
public: true
|
50
|
+
|
51
|
+
# any dataports not listed but found in the client
|
52
|
+
# are ignored. The spec command does not delete things.
|
53
|
+
|
54
|
+
# list of script datarules that must exist
|
55
|
+
scripts:
|
56
|
+
# by default, scripts are datarules with
|
57
|
+
# names and aliases set to the file name
|
58
|
+
- file: test/files/helloworld.lua
|
59
|
+
# you can also set them explicitly
|
60
|
+
- file: test/files/helloworld.lua
|
61
|
+
alias: greeting
|
62
|
+
# you can also place lua code inline
|
63
|
+
- alias: singleLineScript
|
64
|
+
code: debug('hello from inside lua!')
|
65
|
+
# multiline lua scripts should start with | and
|
66
|
+
# be indented inside the "code:" key.
|
67
|
+
- alias: multilineScript
|
68
|
+
code: |
|
69
|
+
for x=1,10 do
|
70
|
+
debug('hello from for loop ' .. x)
|
71
|
+
end
|
72
|
+
# simple templating for script aliases and
|
73
|
+
# content is also supported.
|
74
|
+
- file: test/files/convert.lua
|
75
|
+
# if <% id %> is embedded in aliases
|
76
|
+
# or script content, the --ids parameter must
|
77
|
+
# be passed in. The spec command then expects
|
78
|
+
# a script or dataport resource per id passed, substituting
|
79
|
+
# each ID for <% id %>. In this example, if the command was:
|
80
|
+
#
|
81
|
+
# $ exo spec mysensor sensorspec.yaml --ids=A,B
|
82
|
+
#
|
83
|
+
# ...then the spec command looks for *two* script datarules
|
84
|
+
# in mysensor, with aliases convertA.lua and convertB.lua.
|
85
|
+
# Additionally, any instances of <% id %> in the content of
|
86
|
+
# convert.lua are substituted with A and B before being
|
87
|
+
# written to each script datarule.
|
88
|
+
#
|
89
|
+
alias: convert<% id %>.lua
|
90
|
+
|
91
|
+
# list of dispatches that must exist
|
92
|
+
dispatches:
|
93
|
+
- alias: myDispatch
|
94
|
+
# email | http_get | http_post | http_put | sms | xmpp
|
95
|
+
method: email
|
96
|
+
recipient: support@exosite.com
|
97
|
+
message: hello from Exoline spec example!
|
98
|
+
subject: hello!
|
99
|
+
# may be an RID or alias
|
100
|
+
subscribe: mystring
|
101
|
+
|
102
|
+
# list of simple datarules that must exist.
|
103
|
+
# scripts may go here too, but it's better to
|
104
|
+
# to put them under scripts (above)
|
105
|
+
datarules:
|
106
|
+
- alias: highTemp
|
107
|
+
format: float
|
108
|
+
subscribe: temp
|
109
|
+
rule: {
|
110
|
+
"simple": {
|
111
|
+
"comparison": "gt",
|
112
|
+
"constant": 80,
|
113
|
+
"repeat": true
|
114
|
+
}
|
115
|
+
}
|
116
|
+
|
@@ -0,0 +1,14 @@
|
|
1
|
+
---
|
2
|
+
resources:
|
3
|
+
- alias: mystring
|
4
|
+
- alias: temp
|
5
|
+
format: float
|
6
|
+
- alias: led6
|
7
|
+
format: integer
|
8
|
+
- alias: config
|
9
|
+
format: string
|
10
|
+
initial: '{"text": "555-555-1234", "email": "jeff@555.com"}'
|
11
|
+
- alias: person
|
12
|
+
format: string
|
13
|
+
initial: '{"name":"John Doe"}'
|
14
|
+
- alias: place
|
@@ -0,0 +1,21 @@
|
|
1
|
+
---
|
2
|
+
dataports:
|
3
|
+
- alias: engine_fetch
|
4
|
+
format: string/json
|
5
|
+
- alias: sensors_report
|
6
|
+
format: string/json
|
7
|
+
- alias: update_interval
|
8
|
+
format: string
|
9
|
+
- alias: device_info
|
10
|
+
format: string/json
|
11
|
+
- alias: usage_report
|
12
|
+
format: string/json
|
13
|
+
- alias: fetch_status
|
14
|
+
format: string/json
|
15
|
+
- alias: engine_report
|
16
|
+
format: string/json
|
17
|
+
jsonschema: {"title": "Person Schema",
|
18
|
+
"type": "object",
|
19
|
+
"properties": {"name": {"type": "string"}},
|
20
|
+
"required": ["name"]}
|
21
|
+
|
@@ -0,0 +1,16 @@
|
|
1
|
+
---
|
2
|
+
resources:
|
3
|
+
- alias: engine_fetch
|
4
|
+
format: string
|
5
|
+
- alias: sensors_report
|
6
|
+
format: string
|
7
|
+
- alias: update_interval
|
8
|
+
format: string
|
9
|
+
- alias: device_info
|
10
|
+
format: string
|
11
|
+
- alias: usage_report
|
12
|
+
format: string
|
13
|
+
- alias: fetch_status
|
14
|
+
format: string
|
15
|
+
- alias: engine_report
|
16
|
+
format: string
|
File without changes
|
data/spec/spec_helper.rb
CHANGED
@@ -51,18 +51,18 @@ RSpec.configure do |config|
|
|
51
51
|
|
52
52
|
# The settings below are suggested to provide a good initial experience
|
53
53
|
# with RSpec, but feel free to customize to your heart's content.
|
54
|
-
|
54
|
+
|
55
55
|
# This allows you to limit a spec run to individual examples or groups
|
56
56
|
# you care about by tagging them with `:focus` metadata. When nothing
|
57
57
|
# is tagged with `:focus`, all examples get run. RSpec also provides
|
58
58
|
# aliases for `it`, `describe`, and `context` that include `:focus`
|
59
59
|
# metadata: `fit`, `fdescribe` and `fcontext`, respectively.
|
60
|
-
config.filter_run_when_matching :focus
|
60
|
+
#config.filter_run_when_matching :focus
|
61
61
|
|
62
62
|
# Allows RSpec to persist some state between runs in order to support
|
63
63
|
# the `--only-failures` and `--next-failure` CLI options. We recommend
|
64
64
|
# you configure your source control system to ignore this file.
|
65
|
-
config.example_status_persistence_file_path = "spec/examples.txt"
|
65
|
+
#config.example_status_persistence_file_path = "spec/examples.txt"
|
66
66
|
|
67
67
|
# Limits the available syntax to the non-monkey patched syntax that is
|
68
68
|
# recommended. For more details, see:
|
@@ -101,5 +101,5 @@ RSpec.configure do |config|
|
|
101
101
|
# test failures related to randomization by passing the same `--seed` value
|
102
102
|
# as the one that triggered the failure.
|
103
103
|
Kernel.srand config.seed
|
104
|
-
|
104
|
+
|
105
105
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: MrMurano
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Conrad Tadpol Tilstra
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 4.4.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: highline
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ~>
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 1.7.8
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ~>
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 1.7.8
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: terminal-table
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -94,20 +108,6 @@ dependencies:
|
|
94
108
|
- - ~>
|
95
109
|
- !ruby/object:Gem::Version
|
96
110
|
version: 1.0.1
|
97
|
-
- !ruby/object:Gem::Dependency
|
98
|
-
name: rainbow
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
100
|
-
requirements:
|
101
|
-
- - ~>
|
102
|
-
- !ruby/object:Gem::Version
|
103
|
-
version: 2.1.0
|
104
|
-
type: :runtime
|
105
|
-
prerelease: false
|
106
|
-
version_requirements: !ruby/object:Gem::Requirement
|
107
|
-
requirements:
|
108
|
-
- - ~>
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
version: 2.1.0
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: dotenv
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -200,16 +200,20 @@ files:
|
|
200
200
|
- lib/MrMurano.rb
|
201
201
|
- lib/MrMurano/Account.rb
|
202
202
|
- lib/MrMurano/Config.rb
|
203
|
+
- lib/MrMurano/Product-Resources.rb
|
203
204
|
- lib/MrMurano/Product.rb
|
205
|
+
- lib/MrMurano/Solution-Cors.rb
|
204
206
|
- lib/MrMurano/Solution-Endpoint.rb
|
205
207
|
- lib/MrMurano/Solution-File.rb
|
206
208
|
- lib/MrMurano/Solution-ServiceConfig.rb
|
207
209
|
- lib/MrMurano/Solution-Services.rb
|
208
210
|
- lib/MrMurano/Solution-Users.rb
|
209
211
|
- lib/MrMurano/Solution.rb
|
212
|
+
- lib/MrMurano/SyncUpDown.rb
|
210
213
|
- lib/MrMurano/commands.rb
|
211
214
|
- lib/MrMurano/commands/account.rb
|
212
215
|
- lib/MrMurano/commands/assign.rb
|
216
|
+
- lib/MrMurano/commands/completion.rb
|
213
217
|
- lib/MrMurano/commands/config.rb
|
214
218
|
- lib/MrMurano/commands/content.rb
|
215
219
|
- lib/MrMurano/commands/cors.rb
|
@@ -229,6 +233,8 @@ files:
|
|
229
233
|
- lib/MrMurano/commands/status.rb
|
230
234
|
- lib/MrMurano/commands/sync.rb
|
231
235
|
- lib/MrMurano/commands/timeseries.rb
|
236
|
+
- lib/MrMurano/commands/tsdb.rb
|
237
|
+
- lib/MrMurano/commands/zshcomplete.erb
|
232
238
|
- lib/MrMurano/hash.rb
|
233
239
|
- lib/MrMurano/http.rb
|
234
240
|
- lib/MrMurano/makePretty.rb
|
@@ -240,12 +246,23 @@ files:
|
|
240
246
|
- spec/MakePretties_spec.rb
|
241
247
|
- spec/ProductBase_spec.rb
|
242
248
|
- spec/ProductContent_spec.rb
|
249
|
+
- spec/ProductResources_spec.rb
|
243
250
|
- spec/Product_spec.rb
|
251
|
+
- spec/Solution-Cors_spec.rb
|
252
|
+
- spec/Solution-ServiceConfig_spec.rb
|
244
253
|
- spec/Solution-ServiceEventHandler_spec.rb
|
245
254
|
- spec/Solution-ServiceModules_spec.rb
|
246
|
-
- spec/
|
255
|
+
- spec/SyncRoot_spec.rb
|
256
|
+
- spec/cmd_config_spec.rb
|
257
|
+
- spec/fixtures/.mrmuranorc
|
258
|
+
- spec/fixtures/configfile
|
259
|
+
- spec/fixtures/mrmuranorc_deleted_bob
|
260
|
+
- spec/fixtures/product_spec_files/example.exoline.spec.yaml
|
261
|
+
- spec/fixtures/product_spec_files/example.murano.spec.yaml
|
262
|
+
- spec/fixtures/product_spec_files/gwe.exoline.spec.yaml
|
263
|
+
- spec/fixtures/product_spec_files/gwe.murano.spec.yaml
|
264
|
+
- spec/fixtures/product_spec_files/lightbulb.yaml
|
247
265
|
- spec/spec_helper.rb
|
248
|
-
- spec/testfiles/configfile
|
249
266
|
homepage: https://github.com/tadpol/MrMurano
|
250
267
|
licenses:
|
251
268
|
- MIT
|
@@ -277,9 +294,20 @@ test_files:
|
|
277
294
|
- spec/MakePretties_spec.rb
|
278
295
|
- spec/ProductBase_spec.rb
|
279
296
|
- spec/ProductContent_spec.rb
|
297
|
+
- spec/ProductResources_spec.rb
|
280
298
|
- spec/Product_spec.rb
|
299
|
+
- spec/Solution-Cors_spec.rb
|
300
|
+
- spec/Solution-ServiceConfig_spec.rb
|
281
301
|
- spec/Solution-ServiceEventHandler_spec.rb
|
282
302
|
- spec/Solution-ServiceModules_spec.rb
|
283
|
-
- spec/
|
303
|
+
- spec/SyncRoot_spec.rb
|
304
|
+
- spec/cmd_config_spec.rb
|
305
|
+
- spec/fixtures/.mrmuranorc
|
306
|
+
- spec/fixtures/configfile
|
307
|
+
- spec/fixtures/mrmuranorc_deleted_bob
|
308
|
+
- spec/fixtures/product_spec_files/example.exoline.spec.yaml
|
309
|
+
- spec/fixtures/product_spec_files/example.murano.spec.yaml
|
310
|
+
- spec/fixtures/product_spec_files/gwe.exoline.spec.yaml
|
311
|
+
- spec/fixtures/product_spec_files/gwe.murano.spec.yaml
|
312
|
+
- spec/fixtures/product_spec_files/lightbulb.yaml
|
284
313
|
- spec/spec_helper.rb
|
285
|
-
- spec/testfiles/configfile
|