thyme_verbose 0.1.1 → 0.1.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f557c697d5cdac832fbcfeb5c129b98a5c0501703b2ee734fc0c4468e104c554
4
- data.tar.gz: 548398319e8428cffac00cdaead04605ab211345de61a0148b627292d0bd075d
3
+ metadata.gz: 6460eafbcd3cb96554a031732ce1fccd450a4cc72f4d8d6f426b89dc595cfcea
4
+ data.tar.gz: '0079432259f8c45cd012e7f2fda5d876affe42e457e87626bfd14aa900c7b91e'
5
5
  SHA512:
6
- metadata.gz: 0a80fc89586ee4ee84dd8708c231271d6d747227fd999209d81768fcc68b3215314813564c2cf88fa545374cd2ffe0b7997788b7ff1a20f40807429ddd6889b3
7
- data.tar.gz: 208315a487ee8c65d33f5183615fcf1cfe636b46ebab6eadd4499c4e64c1ef9718b4491c4bb6cbb1d54b23f53874366f89f841fba626a9d5b310f5a9d8ec703a
6
+ metadata.gz: 8d78894c43c445a7b21a694dc6d5a8c289c4489c6f083217eb9ecc124b2bcb5fbabc478d1c92094f7fb260cd55661098bfd620896cbc3c593d3dcad432fcdf2d
7
+ data.tar.gz: 7802411c2b3e58b2009ee0c02b519d62f9682f835182224d1bc8aecc55e3cf914c8d17952681090aca83dac18fa7c57a09289b42fce9e0f8da2578a9bb5631b0
@@ -1,9 +1,9 @@
1
1
 
2
2
  class ThymePluginLabel
3
3
  def initialize(thyme, options={})
4
- label = @label = ''
4
+ plugin_options = @plugin_options = {:label => ''}
5
5
  thyme.option :l, 'label str', 'Label' do |str|
6
- label.replace str
6
+ plugin_options[:label] = str
7
7
  @run = true
8
8
  end
9
9
  end
@@ -21,8 +21,8 @@ class ThymePluginLabel
21
21
  private
22
22
 
23
23
  def show_label
24
- if !@label.empty?
25
- caption = 'LABEL: ' + @label
24
+ if !@plugin_options[:label].empty?
25
+ caption = 'LABEL: ' + @plugin_options[:label]
26
26
  puts caption + ' ' * (50 - caption.length)
27
27
  end
28
28
  end
@@ -1,24 +1,26 @@
1
1
 
2
2
  class ThymePluginMusic
3
3
  def initialize(thyme, options={})
4
+ @thyme = thyme
4
5
  @player = options[:player] || 'spotify'
5
6
  @command_play = options[:command_play] || command_play
6
7
  @command_pause = options[:command_pause] || command_pause
7
- mute_music = @mute_music = false
8
- thyme.option :m, nil, 'disalbe music plugin for this Pomodoro' do
9
- mute_music.replace true
10
- @run = true
8
+
9
+ plugin_options = @plugin_options = {:mute => false}
10
+ @thyme.option :m, :mute, 'disalbe music plugin for this Pomodoro' do
11
+ plugin_options[:mute] = true
12
+ @run = true
11
13
  end
12
14
  end
13
15
 
14
16
  # Hooks
15
17
 
16
18
  def before
17
- `#{@command_play}` unless @break || @mute_music
19
+ `#{@command_play}` unless @thyme.break || @plugin_options[:mute]
18
20
  end
19
21
 
20
22
  def after(seconds_left)
21
- `#{@command_pause}` unless @break || @mute_music
23
+ `#{@command_pause}` unless @thyme.break || @plugin_options[:mute]
22
24
  end
23
25
 
24
26
  private
@@ -59,12 +61,5 @@ class ThymePluginMusic
59
61
  end
60
62
  return nil
61
63
  end
62
-
63
- def show_label
64
- if !@label.empty?
65
- caption = 'LABEL: ' + @label
66
- puts caption + ' ' * (50 - caption.length)
67
- end
68
- end
69
64
  end
70
65
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thyme_verbose
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ilya Shmygol
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-02-14 00:00:00.000000000 Z
11
+ date: 2019-02-15 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: " A set of lightweight plugins for the pomodoro timer 'thyme' aimed
14
14
  to improve verbosity.\n ThymePluginTime for printing current time before and