lita-onewheel-moonphase 2.0.0 → 2.0.1

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
  SHA1:
3
- metadata.gz: 183a754e5ff2c25a117568596c0caa002e62b8fe
4
- data.tar.gz: fc8f1303613a395dcfb0fe0b18c921ff0f6d5c0a
3
+ metadata.gz: 8a7d041dde8e1efb8eaee9efab33bce5ba0363a0
4
+ data.tar.gz: 6cd106bdc9811c0d445ec9ba7f93d75ebbf5d9b6
5
5
  SHA512:
6
- metadata.gz: ae62b04972b4b3a0d71fe661d0a0f39b88274b2576188dce8d60bf173fe16605a035532134da5c40650bd13262eac62fa1f2969a8c2f14cba920103841cfd16e
7
- data.tar.gz: f4154c2e2296e9ea8a9d88ed9ca587522a05f1f312864ab9b664dd8d0a498b3d8711fc59480733f25c9a4c909a1900cb733b22da69fcbc83974d2481c314e6a7
6
+ metadata.gz: 853e0d580ba2590265bff0debab71090abf985fe2a7970dea5d555486254db54630d26eb10fa6afcf42cfe556c8c08ba0365eaa00bf4df23062413cc8041d3da
7
+ data.tar.gz: 25287ddb8822fdf9c7d5041bdc5473c275ddb3db8d0cd45ca1ef432a297c4cce9139ab782e469c440d16efdf11e88250a1bbb967edc2ece601bcd88ee1b2ae37
data/.gitignore CHANGED
@@ -4,3 +4,4 @@ coverage
4
4
  Gemfile.lock
5
5
  .bundle
6
6
  bin
7
+ *.gem
@@ -9,18 +9,27 @@ module Lita
9
9
  help: {'moon [location]' => 'Get Moon phase data'}
10
10
 
11
11
  # 🌑🌛
12
- # emoonjis = %w(🌚🌘🌗🌔🌕🌖🌓🌒)
13
12
 
14
13
  def moon(response)
15
14
  location = get_location(response)
16
-
17
15
  moon = get_data(location)
18
16
 
19
17
  # today = Time.now
20
18
  rise_time = Time.parse moon['moondata']['rise']
21
19
  set_time = Time.parse moon['moondata']['set']
22
20
 
23
- reply = "#{get_moonmoji(moon['moondata']['fracillum'], moon['moondata']['curphase'])} Moon phase #{moon['moondata']['fracillum']}, #{moon['moondata']['curphase']}. "
21
+ emoonjis = {
22
+ 'New Moon' => '🌚',
23
+ 'Waning Crescent' => '🌘',
24
+ 'Last Quarter' => '🌗',
25
+ 'Waxing Gibbous' => '🌔',
26
+ 'Full Moon' => '🌕',
27
+ 'Waning Gibbous' => '🌖',
28
+ 'First Quarter' => '🌓',
29
+ 'Waxing Crescent' => '🌒'
30
+ }
31
+
32
+ reply = "#{emoonjis[moon['moondata']['curphase']]} Moon phase #{moon['moondata']['fracillum']}, #{moon['moondata']['curphase']}. "
24
33
  reply += "Rise: #{rise_time.strftime("%H:%M")} Set: #{set_time.strftime('%H:%M')}"
25
34
  Lita.logger.debug "Replying with #{reply}"
26
35
  response.reply reply
@@ -44,28 +53,28 @@ module Lita
44
53
  end
45
54
 
46
55
  # Next step, determine waxing or waning.
47
- def get_moonmoji(percent_full, phase)
48
- moonmoji = ''
49
- waning = false
50
-
51
- if phase.match /waning/i
52
- waning = true
53
- end
56
+ # def get_moonmoji(percent_full, phase)
57
+ # moonmoji = ''
58
+ # waning = false
54
59
 
55
- case percent_full.sub('%', '').to_i
56
- when 0..1
57
- moonmoji = '🌚'
58
- when 2..32
59
- moonmoji = waning ? '🌘' : '🌒'
60
- when 33..62
61
- moonmoji = phase.match(/last/i) ? '🌗' : '🌓'
62
- when 63..90
63
- moonmoji = waning ? '🌖' : '🌔'
64
- when 91..100
65
- moonmoji = '🌕'
66
- end
67
- moonmoji
68
- end
60
+ # if phase.match /waning/i
61
+ # waning = true
62
+ # end
63
+ #
64
+ # case percent_full.sub('%', '').to_i
65
+ # when 0..1
66
+ # moonmoji = '🌚'
67
+ # when 2..32
68
+ # moonmoji = waning ? '🌘' : '🌒'
69
+ # when 33..62
70
+ # moonmoji = phase.match(/last/i) ? '🌗' : '🌓'
71
+ # when 63..90
72
+ # moonmoji = waning ? '🌖' : '🌔'
73
+ # when 91..100
74
+ # moonmoji = '🌕'
75
+ # end
76
+ # moonmoji
77
+ # end
69
78
 
70
79
  Lita.register_handler(self)
71
80
  end
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'lita-onewheel-moonphase'
3
- spec.version = '2.0.0'
3
+ spec.version = '2.0.1'
4
4
  spec.authors = ['Andrew Kreps']
5
5
  spec.email = ['andrew.kreps@gmail.com']
6
6
  spec.description = %q{Lita interface to a lambda representing Moon phase data.}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lita-onewheel-moonphase
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kreps