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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f18f855bd1d254a6d1d3bf6ece470236ff110b53
4
- data.tar.gz: d684104c83763463f0fdd4d143b08a56916373ed
3
+ metadata.gz: 85e14c83ac66b5a28f743a59b9821f75d4e50ef6
4
+ data.tar.gz: 8a7238c82a83a9108fbdfc01f22b18fd24e45b90
5
5
  SHA512:
6
- metadata.gz: 13387d00aa13f76fe9f3f3a6a0060bf19e9c94d81373989a0e5517679f45fa4aa7a3965842eedbf879e1385a7a7727dc7149fc9b0649d2a25758fe1e22af9146
7
- data.tar.gz: 94bd016f7ee50d627775707b9245d3858ad7bb90e5c42dd26c819004f3b65d8a23f239586e1dec231629ce8a116f5bc9a460533bf819bdaa0113235050bffb53
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, :required => :true, :aliases => "-b"
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[:batch_name]
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
@@ -1,3 +1,3 @@
1
1
  module MilkMaid
2
- VERSION = "0.2.7"
2
+ VERSION = "0.2.8"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: milk_maid
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.7
4
+ version: 0.2.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steve Newell