milk_maid 0.2.7 → 0.2.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/milk_maid/cli.rb +6 -2
- data/lib/milk_maid/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 85e14c83ac66b5a28f743a59b9821f75d4e50ef6
|
4
|
+
data.tar.gz: 8a7238c82a83a9108fbdfc01f22b18fd24e45b90
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2d6fe840d2ab159843b80a81cef2319b48ba7ce730bde261991596f8aaebbca857c9449e8a468c08bae383eedb320412bcdda5598ab075f53514e49f67df1206
|
7
|
+
data.tar.gz: 69da5db52b4d23a5d53c8b9fc5e7362914d3f23a54dafac6b3359a08c9782285b81b9c41078a72636b133112761f1e6aaede38cd57be1525cba71cdb48dc1b3a
|
data/lib/milk_maid/cli.rb
CHANGED
@@ -9,13 +9,13 @@ module MilkMaid
|
|
9
9
|
and begin monitoring it for 30 minutes
|
10
10
|
|
11
11
|
DESC
|
12
|
-
option :batch_name, :type => :string, :
|
12
|
+
option :batch_name, :type => :string, :aliases => "-b"
|
13
13
|
option :temperature, :type => :numeric, :required => :false, :default => 30, :aliases => '-t'
|
14
14
|
option :duration, :type => :numeric, :required => false, :default => 30, :aliases => '-d'
|
15
15
|
option :logger, :type => :string, :required => false, :default => 'Console', :aliases => '-l'
|
16
16
|
option :sensor, :type => :boolean, :required => false, :default => true, :aliases => '-s'
|
17
17
|
def monitor_batch
|
18
|
-
batch_name = options
|
18
|
+
batch_name = options.fetch(:batch_name, default_batch_name)
|
19
19
|
temperature = options[:temperature].to_i
|
20
20
|
duration = options[:duration].to_i
|
21
21
|
logger_type = options[:logger]
|
@@ -33,6 +33,10 @@ module MilkMaid
|
|
33
33
|
default_task :monitor_batch
|
34
34
|
|
35
35
|
no_commands do
|
36
|
+
def default_batch_name
|
37
|
+
Time.now.strftime("Batch-%Y-%m-%d %H:%M:%S")
|
38
|
+
end
|
39
|
+
|
36
40
|
def get_sensor(sensor_type)
|
37
41
|
sensor_type ? ::MilkMaid::TemperatureSensor.new : ::MilkMaid::MockTemperatureSensor.new(options[:temperature].to_i - 20, options[:temperature].to_i + 30)
|
38
42
|
end
|
data/lib/milk_maid/version.rb
CHANGED