brewer 0.0.83 → 0.0.89

Sign up to get free protection for your applications and to get access to all the features.
data/spec/helpers_spec.rb CHANGED
File without changes
@@ -1,7 +1,7 @@
1
1
  require_relative 'spec_helper'
2
2
 
3
3
 
4
- describe "Settings" do
4
+ describe Settings do
5
5
 
6
6
  before :all do
7
7
  @adaptibrew = Adaptibrew.new.clone
@@ -139,16 +139,4 @@ describe "Settings" do
139
139
  end
140
140
  end
141
141
 
142
- describe ".type_cast" do
143
- before { @settings.parse }
144
-
145
- specify { expect(@settings.settings['pumpRelay']).to be_an_instance_of String }
146
- specify { expect(@settings.settings['DEBUG']).to eq("False") }
147
- it "casts values to correct type" do
148
- @settings.type_cast
149
- expect(@settings.settings['pumpRelay']).to be_an_instance_of Fixnum
150
- expect(@settings.settings['DEBUG']).to be false
151
- end
152
- end
153
-
154
142
  end
data/spec/spec_helper.rb CHANGED
@@ -6,3 +6,5 @@ SimpleCov.command_name 'RSpec'
6
6
  SimpleCov.start
7
7
 
8
8
  require_relative "../lib/brewer"
9
+
10
+ include Brewer
data/views/index.erb ADDED
@@ -0,0 +1,216 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.6/css/bootstrap.min.css">
6
+ <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
7
+ <link rel="stylesheet" href="https://code.getmdl.io/1.2.1/material.blue_grey-indigo.min.css" />
8
+ <script defer src="https://code.getmdl.io/1.2.1/material.min.js"></script>
9
+ <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:300,400,500,700" type="text/css">
10
+ <title>Brewer Home</title>
11
+ <style media="screen">
12
+ .card-wide {
13
+ width: 100%;
14
+ margin-top: 2em;
15
+ }
16
+ </style>
17
+ </head>
18
+ <body>
19
+ <div class="mdl-layout mdl-js-layout mdl-layout--fixed-header">
20
+ <header class="mdl-layout__header">
21
+ <div class="mdl-layout__tab-bar mdl-js-ripple-effect">
22
+ <a href="#scroll-tab-1" class="mdl-layout__tab is-active">Relays & Pump</a>
23
+ <a href="#scroll-tab-2" class="mdl-layout__tab">PID</a>
24
+ <a href="#scroll-tab-3" class="mdl-layout__tab">Procedures</a>
25
+ </div>
26
+ </header>
27
+
28
+ <main class="mdl-layout__content">
29
+ <div class="container">
30
+ <div class="page-content">
31
+ <div class="row">
32
+ <!-- Tab 1 -->
33
+ <section class="mdl-layout__tab-panel is-active" id="scroll-tab-1">
34
+ <div class="col-md-6">
35
+ <br>
36
+ <!-- Relay Status Card / Table -->
37
+ <div class="mdl-card card-wide mdl-shadow--4dp">
38
+ <div class="mdl-card__title mdl-card--expand">
39
+ <h2 class="mdl-card__title-text">Relay Status</h2>
40
+ </div>
41
+ <div class="mdl-card__supporting-text">
42
+ <table class="mdl-data-table mdl-js-data-table mdl-shadow--2dp" style="width: 100%;">
43
+ <thead>
44
+ <tr>
45
+ <th class="mdl-data-table__cell--non-numeric">Relay Name</th>
46
+ <th>Status</th>
47
+ </tr>
48
+ </thead>
49
+ <tbody>
50
+ <% @relays_status.each do |relay_name, status| %>
51
+ <tr>
52
+ <td class="mdl-data-table__cell--non-numeric"><strong><%= relay_name %></strong></td>
53
+ <td><strong><%= status %></strong></td>
54
+ </tr>
55
+ <% end %>
56
+ </tbody>
57
+ </table>
58
+ </div>
59
+ </div>
60
+ </div>
61
+ <div class="col-md-6">
62
+ <!-- Relay Configuration Card / Form -->
63
+ <br>
64
+ <div class="mdl-shadow--4dp card-wide mdl-card">
65
+ <div class="mdl-card__title mdl-card--expand">
66
+ <h2 class="mdl-card__title-text">Custom Relay Configuration</h2>
67
+ </div>
68
+ <div class="mdl-card__supporting-text">
69
+ <form action="/apply-relay-config" enctype='application/json' method="post">
70
+ <!-- HLT to option -->
71
+
72
+ <div class="mdl-select mdl-select--floating-label">
73
+ <label class="mdl-select__label" for="hlt_to">Divert HLT to: </label>
74
+ <select class="mdl-select__input" id="hlt_to" name="hlt_to">
75
+ <option value="mash" <%= @relays_status['spargeToMashRelay'].to_b ? nil : "selected" %>>Mash</option>
76
+ <option value="boil" <%= @relays_status['spargeToMashRelay'].to_b ? "selected" : nil %>>Boil</option>
77
+ </select>
78
+ </div>
79
+ <br>
80
+ <!-- RIMS to option -->
81
+ <div class="mdl-select mdl-select--floating-label">
82
+ <label class="mdl-select__label" for="rims_to">Divert RIMS to: </label>
83
+ <select class="mdl-select__input" id="rims_to" name="rims_to">
84
+ <option value="mash" <%= @relays_status['rimsToMashRelay'].to_b ? nil : "selected" %>>Mash (Circulate)</option>
85
+ <option value="boil" <%= @relays_status['rimsToMashRelay'].to_b ? "selected" : nil %>>Boil</option>
86
+ </select>
87
+ </div>
88
+ <br>
89
+ <!-- HLT on option -->
90
+ <label class="mdl-switch mdl-js-switch mdl-js-ripple-effect" for="hlt">
91
+ <input type="hidden" name="hlt" value="false">
92
+ <input type="checkbox" id="hlt" name="hlt" value="true" class="mdl-switch__input" <%= @relays_status['spargeRelay'].to_b ? "checked" : nil %>>
93
+ <span class="mdl-switch__label">HLT Flowing?</span>
94
+ </label>
95
+ <br><br><hr><br>
96
+ <!-- Pump option -->
97
+ <label class="mdl-switch mdl-js-switch mdl-js-ripple-effect" for="pump">
98
+ <input type="hidden" name="pump" value="0">
99
+ <input type="checkbox" id="pump" name="pump" value="1" class="mdl-switch__input" <%= @relays_status['pumpRelay'].to_b ? "checked" : nil %>>
100
+ <span class="mdl-switch__label">Pump On?</span>
101
+ </label>
102
+ <br>
103
+ </div>
104
+ <div class="mdl-card__actions mdl-card--border">
105
+ <button type="submit" class="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-button--accent">
106
+ Apply Configuration
107
+ </button>
108
+ </div>
109
+ </form>
110
+ </div>
111
+ </div>
112
+ </div>
113
+ </section>
114
+ <!-- Tab 2 -->
115
+ <section class="mdl-layout__tab-panel" id="scroll-tab-2">
116
+ <div class="col-md-12">
117
+ <div class="mdl-card card-wide mdl-shadow--4dp">
118
+ <div class="mdl-card__title mdl-card--expand">
119
+ <h2 class="mdl-card__title-text">RIMS/PID Status</h2>
120
+ </div>
121
+ <div class="mdl-card__supporting-text">
122
+ <div class="col-md-6">
123
+ <h1><%= @pid_status['pv_temp'] %>° F</h1>
124
+ <h3>Proccess Value Temp</h3>
125
+ </div>
126
+ <div class="col-md-6">
127
+ <h1><%= @pid_status['sv_temp'] %>° F</h1>
128
+ <h3>Set Value Temp</h3>
129
+ </div>
130
+ <br>
131
+ <div class="container">
132
+ <div class="row">
133
+ <div class="col-md-12">
134
+ <h3>RIMS Heater is <%= @pid_status['pid_running'].to_b ? "On" : "Off" %></h3>
135
+ </div>
136
+ </div>
137
+ </div>
138
+ </div>
139
+ </div>
140
+ </div>
141
+ </section>
142
+ <!-- Tab 3 -->
143
+ <section class="mdl-layout__tab-panel" id="scroll-tab-3">
144
+ <div class="col-md-12">
145
+ <div class="mdl-card card-wide mdl-shadow--4dp">
146
+ <div class="mdl-card__supporting-text">
147
+ <h2>Choose a procedure: </h2>
148
+ <form action="/start-procedure" method="post">
149
+ <label class="mdl-radio mdl-js-radio mdl-js-ripple-effect" for="master">
150
+ <input type="radio" id="master" class="mdl-radio__button" name="procedure" value="master">
151
+ <span class="mdl-radio__label">Master</span>
152
+ <br>
153
+ <i>
154
+ (Does all the following procedures)
155
+ </i>
156
+ </label>
157
+ <hr>
158
+ <label class="mdl-radio mdl-js-radio mdl-js-ripple-effect" for="boot">
159
+ <input type="radio" id="boot" class="mdl-radio__button" name="procedure" value="boot">
160
+ <span class="mdl-radio__label">Boot</span>
161
+ </label>
162
+ <br><br>
163
+ <label class="mdl-radio mdl-js-radio mdl-js-ripple-effect" for="heat-strike-water">
164
+ <input type="radio" id="heat-strike-water" class="mdl-radio__button" name="procedure" value="heat-strike-water">
165
+ <span class="mdl-radio__label">Heat Strike Water</span>
166
+ </label>
167
+ <br><br>
168
+ <label class="mdl-radio mdl-js-radio mdl-js-ripple-effect" for="dough-in">
169
+ <input type="radio" id="dough-in" class="mdl-radio__button" name="procedure" value="dough-in">
170
+ <span class="mdl-radio__label">Dough In</span>
171
+ </label>
172
+ <br><br>
173
+ <label class="mdl-radio mdl-js-radio mdl-js-ripple-effect" for="mash">
174
+ <input type="radio" id="mash" class="mdl-radio__button" name="procedure" value="mash">
175
+ <span class="mdl-radio__label">Mash</span>
176
+ </label>
177
+ <br><br>
178
+ <label class="mdl-radio mdl-js-radio mdl-js-ripple-effect" for="mashout">
179
+ <input type="radio" id="mashout" class="mdl-radio__button" name="procedure" value="mashout">
180
+ <span class="mdl-radio__label">Mashout</span>
181
+ </label>
182
+ <br><br>
183
+ <label class="mdl-radio mdl-js-radio mdl-js-ripple-effect" for="sparge">
184
+ <input type="radio" id="sparge" class="mdl-radio__button" name="procedure" value="sparge">
185
+ <span class="mdl-radio__label">Sparge</span>
186
+ </label>
187
+ <br><br>
188
+ <label class="mdl-radio mdl-js-radio mdl-js-ripple-effect" for="top-off">
189
+ <input type="radio" id="top-off" class="mdl-radio__button" name="procedure" value="top-off">
190
+ <span class="mdl-radio__label">Top Off</span>
191
+ </label>
192
+ <br><br>
193
+ <label class="mdl-radio mdl-js-radio mdl-js-ripple-effect" for="boil">
194
+ <input type="radio" id="boil" class="mdl-radio__button" name="procedure" value="boil">
195
+ <span class="mdl-radio__label">Boil</span>
196
+ </label>
197
+ <br>
198
+ <br>
199
+ </div>
200
+ <div class="mdl-card__actions mdl-card--border">
201
+ <!-- Submit button -->
202
+ <button type="submit" class="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-button--accent">
203
+ Start Procedure
204
+ </button>
205
+ </form>
206
+ </div>
207
+ </div>
208
+ </div>
209
+ </section>
210
+ </div>
211
+ </div>
212
+ </div>
213
+ </main>
214
+ </div>
215
+ </body>
216
+ </html>
@@ -0,0 +1,24 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <title>Page Not Found</title>
6
+ <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
7
+ <link rel="stylesheet" href="https://code.getmdl.io/1.2.1/material.blue_grey-indigo.min.css" />
8
+ <script defer src="https://code.getmdl.io/1.2.1/material.min.js"></script>
9
+ <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:300,400,500,700" type="text/css">
10
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.6/css/bootstrap.min.css">
11
+ </head>
12
+ <body>
13
+ <div class="row">
14
+ <div class="col-md-4 col-md-offset-4">
15
+ <br><br>
16
+ <div class="mdl-card mdl-shadow--4dp">
17
+ <div class="mdl-card__supporting-text">
18
+ <h2>Error 404: Page Not Found</h2>
19
+ </div>
20
+ </div>
21
+ </div>
22
+ </div>
23
+ </body>
24
+ </html>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: brewer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.83
4
+ version: 0.0.89
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luke Sweeney
@@ -31,35 +31,35 @@ dependencies:
31
31
  - !ruby/object:Gem::Version
32
32
  version: 1.3.0
33
33
  - !ruby/object:Gem::Dependency
34
- name: ripl
34
+ name: net-ping
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
37
  - - "~>"
38
38
  - !ruby/object:Gem::Version
39
- version: 0.7.0
39
+ version: '1.7'
40
40
  type: :runtime
41
41
  prerelease: false
42
42
  version_requirements: !ruby/object:Gem::Requirement
43
43
  requirements:
44
44
  - - "~>"
45
45
  - !ruby/object:Gem::Version
46
- version: 0.7.0
46
+ version: '1.7'
47
47
  - !ruby/object:Gem::Dependency
48
- name: net-ping
48
+ name: wannabe_bool
49
49
  requirement: !ruby/object:Gem::Requirement
50
50
  requirements:
51
- - - "~>"
51
+ - - ">="
52
52
  - !ruby/object:Gem::Version
53
- version: '1.7'
53
+ version: '0'
54
54
  type: :runtime
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  requirements:
58
- - - "~>"
58
+ - - ">="
59
59
  - !ruby/object:Gem::Version
60
- version: '1.7'
60
+ version: '0'
61
61
  - !ruby/object:Gem::Dependency
62
- name: wannabe_bool
62
+ name: slack-notifier
63
63
  requirement: !ruby/object:Gem::Requirement
64
64
  requirements:
65
65
  - - ">="
@@ -73,7 +73,7 @@ dependencies:
73
73
  - !ruby/object:Gem::Version
74
74
  version: '0'
75
75
  - !ruby/object:Gem::Dependency
76
- name: slack-notifier
76
+ name: require_all
77
77
  requirement: !ruby/object:Gem::Requirement
78
78
  requirements:
79
79
  - - ">="
@@ -87,7 +87,7 @@ dependencies:
87
87
  - !ruby/object:Gem::Version
88
88
  version: '0'
89
89
  - !ruby/object:Gem::Dependency
90
- name: require_all
90
+ name: sinatra
91
91
  requirement: !ruby/object:Gem::Requirement
92
92
  requirements:
93
93
  - - ">="
@@ -128,6 +128,34 @@ dependencies:
128
128
  - - ">="
129
129
  - !ruby/object:Gem::Version
130
130
  version: '0'
131
+ - !ruby/object:Gem::Dependency
132
+ name: rack-flash3
133
+ requirement: !ruby/object:Gem::Requirement
134
+ requirements:
135
+ - - ">="
136
+ - !ruby/object:Gem::Version
137
+ version: '0'
138
+ type: :runtime
139
+ prerelease: false
140
+ version_requirements: !ruby/object:Gem::Requirement
141
+ requirements:
142
+ - - ">="
143
+ - !ruby/object:Gem::Version
144
+ version: '0'
145
+ - !ruby/object:Gem::Dependency
146
+ name: pry
147
+ requirement: !ruby/object:Gem::Requirement
148
+ requirements:
149
+ - - ">="
150
+ - !ruby/object:Gem::Version
151
+ version: '0'
152
+ type: :runtime
153
+ prerelease: false
154
+ version_requirements: !ruby/object:Gem::Requirement
155
+ requirements:
156
+ - - ">="
157
+ - !ruby/object:Gem::Version
158
+ version: '0'
131
159
  - !ruby/object:Gem::Dependency
132
160
  name: rake
133
161
  requirement: !ruby/object:Gem::Requirement
@@ -240,6 +268,7 @@ description: A Ruby API for adaptiman/adaptibrew
240
268
  email: luke@thesweeneys.org
241
269
  executables:
242
270
  - brewer
271
+ - brewer-server
243
272
  extensions: []
244
273
  extra_rdoc_files: []
245
274
  files:
@@ -248,6 +277,7 @@ files:
248
277
  - README.md
249
278
  - Rakefile
250
279
  - bin/brewer
280
+ - bin/brewer-server
251
281
  - lib/brewer.rb
252
282
  - lib/brewer/adaptibrew.rb
253
283
  - lib/brewer/brewer.rb
@@ -256,12 +286,15 @@ files:
256
286
  - lib/brewer/procedures.rb
257
287
  - lib/brewer/recipe.rb
258
288
  - lib/brewer/settings.rb
289
+ - lib/gems.rb
259
290
  - spec/adaptibrew_spec.rb
260
291
  - spec/brewer_spec.rb
261
292
  - spec/hardware_spec.rb
262
293
  - spec/helpers_spec.rb
263
294
  - spec/settings_spec.rb
264
295
  - spec/spec_helper.rb
296
+ - views/index.erb
297
+ - views/not_found.erb
265
298
  homepage: https://rubygems.org/gems/brewer
266
299
  licenses:
267
300
  - MIT