intel-backlight 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/backlight.rb +7 -5
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 766e927b4ff289648a970087ac5db66a7966f252
4
- data.tar.gz: b5a8fae57fbdb09335d19cfed12cbd804daf4571
3
+ metadata.gz: 843cdb05ac49c7dc4eb6a064035ac7b7cf686ff8
4
+ data.tar.gz: 554b63a05556904d89cf4a531f7da3af9ef72cba
5
5
  SHA512:
6
- metadata.gz: f59f1b066569ddf39fb7909dc9670721e595a3917d541631dead2bfe64be25ee86bd1443d378466ea6b5e560b6cfb2b4a0b4a0c47153e88cd40baad58923958c
7
- data.tar.gz: 790c60347b75fd26208dc3672ca1b90a7d1b9e1330a764e1358f7604b47e579b0db192e81caf0040937a4ba11f7613447dedd0c32ad70633d2b45e02a6debc66
6
+ metadata.gz: f51988cd022fba8f2a43cbce4f720c0eec1f325de141c28f18135725fdc8f17ba434da4e398b02f6788a9bbc3fa0fa88553227d237ee03aa7f869240f7bd5f72
7
+ data.tar.gz: e9cda49e98d150c557f3538ea48159e309cf91504d25ca158e0fc5c4e024c6c57cb5144b000ad0b282c7f240f256de88efaad3f5f8b190bd9f667dbb6fc526ce
@@ -57,7 +57,9 @@ module Backlight
57
57
  end
58
58
 
59
59
  ##
60
- # Sets the value of the backlight, from zero to the set maximum
60
+ # Sets the value of the backlight, from zero to the set maximum. Should
61
+ # be given in integer form - Strings will be converted, floats will be
62
+ # truncated.
61
63
  #
62
64
  # ==== Attributes
63
65
  #
@@ -71,17 +73,17 @@ module Backlight
71
73
  end
72
74
 
73
75
  ##
74
- # Sets the backlight brightness as a percentage
76
+ # Sets the backlight brightness as a percentage.
75
77
  #
76
78
  def set(percent)
77
- self.value = percent * @max / 100
79
+ self.value = (percent * @max / 100.0).round
78
80
  end
79
81
 
80
82
  ##
81
- # Gets the backlight brightness as a percentage
83
+ # Gets the backlight brightness as a percentage.
82
84
  #
83
85
  def get
84
- 100 * @value / @max
86
+ (100.0 * @value / @max).round
85
87
  end
86
88
  end
87
89
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: intel-backlight
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Caleb Smith