cinch-pax-timer 1.0.8 → 1.0.9

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
  !binary "U0hBMQ==":
3
- metadata.gz: 6542cd26536f474ce63151ade6f3985d25f9891b
4
- data.tar.gz: ba6a7c075bec53d12bb292f5147dbc5dd80882ef
3
+ metadata.gz: 3f1c898bd1fa9cd896337dd1ca310ce4ce59e015
4
+ data.tar.gz: 4b0f01fb4682f35579180021a165c1dcf8660959
5
5
  SHA512:
6
- metadata.gz: 7a8f3c49cc32d5a78ad55892429ff4b0b35478ceae5d17fda7cbe3288b2c76477ac37502f6c53c59af7243afb1fdc4745ab162b30e8d34c80045620762cb29d8
7
- data.tar.gz: ccf75c5d922f78e38a72e32904536b442319d035c041661f8ee42bc54aa0563cf6ab495d39ffe9e244f56080d86d22f162b54685361020c4b26a7c1d51cb66d6
6
+ metadata.gz: 53cd0490621d4603869ec1948b908648d925fde67e451b2219309e2ea438e6591482343b4d1d3dcdc5b0470bf313d5357e4acb0810d5e34c55ddf18ec9eadff9
7
+ data.tar.gz: a6fb22aea22530de1c2f623c205c482b0fc1b379abb022a094a6f76fe19c2a483566c2e5b2e6aff138cbb0b28c25bb4b526ca710dfbe04f73db4ff68defa4ef3
data/.travis.yml CHANGED
@@ -10,7 +10,6 @@ rvm:
10
10
  - 1.8.7
11
11
  - jruby-18mode
12
12
  - jruby-19mode
13
- - rbx
14
13
  - ruby-head
15
14
  - jruby-head
16
15
  - ree
@@ -8,21 +8,20 @@ Gem::Specification.new do |gem|
8
8
  gem.version = Cinch::Plugins::PaxTimer::VERSION
9
9
  gem.authors = ['Brian Haberer']
10
10
  gem.email = ['bhaberer@gmail.com']
11
- gem.description = %q{Cinch plugin that allows users to see the relative time till the various PAX events}
12
- gem.summary = %q{Cinch Plugin that acts as a PAX countdown}
11
+ gem.description = %q(Cinch plugin that allows users to see the relative time till the various PAX events)
12
+ gem.summary = %q(Cinch Plugin that acts as a PAX countdown)
13
13
  gem.homepage = 'https://github.com/bhaberer/cinch-pax-timer'
14
14
  gem.license = 'MIT'
15
-
16
15
  gem.files = `git ls-files`.split($/)
17
- gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
18
- gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
16
+ gem.executables = gem.files.grep(/^bin\//).map { |f| File.basename(f) }
17
+ gem.test_files = gem.files.grep(/^(test|spec|features)\//)
19
18
  gem.require_paths = ['lib']
20
19
 
21
- gem.add_development_dependency 'rake'
22
- gem.add_development_dependency 'rspec'
23
- gem.add_development_dependency 'coveralls'
24
- gem.add_development_dependency 'cinch-test'
25
-
26
- gem.add_dependency 'cinch-cooldown', '~> 1.1.1'
27
- gem.add_dependency 'cinch-toolbox', '~> 1.1.0'
20
+ gem.add_development_dependency 'rake', '~> 10'
21
+ gem.add_development_dependency 'rspec', '~> 3'
22
+ gem.add_development_dependency 'coveralls', '~> 0.7'
23
+ gem.add_development_dependency 'cinch-test', '~> 0.1', '>= 0.1.0'
24
+ gem.add_dependency 'cinch', '~> 2'
25
+ gem.add_dependency 'cinch-cooldown', '~> 1.1', '>= 1.1.1'
26
+ gem.add_dependency 'cinch-toolbox', '~> 1.1'
28
27
  end
@@ -4,77 +4,79 @@ require 'time-lord'
4
4
  require 'cinch/toolbox'
5
5
  require 'cinch/cooldown'
6
6
 
7
- module Cinch::Plugins
8
- # Cinch Cooldown for PAX countdowns
9
- class PaxTimer
10
- include Cinch::Plugin
7
+ module Cinch
8
+ module Plugins
9
+ # Cinch Cooldown for PAX countdowns
10
+ class PaxTimer
11
+ include Cinch::Plugin
11
12
 
12
- enforce_cooldown
13
+ enforce_cooldown
13
14
 
14
- self.help = 'Use .pax for the next pax or .east, .prime, .south or .aus ' +
15
- 'for the time to a specific pax.'
15
+ self.help = 'Use .pax for the next pax or .east, .prime, .south or ' \
16
+ '.aus for the time to a specific pax.'
16
17
 
17
- match /pax\z/, method: :next_pax
18
+ match(/pax\z/, method: :next_pax)
18
19
 
19
- def next_pax(m)
20
- m.reply get_next_pax
21
- end
20
+ def next_pax(m)
21
+ m.reply get_next_pax
22
+ end
22
23
 
23
- PAXES = [
24
- { type: 'aus',
25
- name: 'PAX Australia',
26
- date: Time.parse('2014-10-31 08:00:00 +11:00'),
27
- estimated: false },
28
- { type: 'prime',
29
- name: 'PAX Prime',
30
- date: Time.parse('2014-08-29 08:00:00 -08:00'),
31
- estimated: false },
32
- { type: 'south',
33
- name: 'PAX South',
34
- date: Time.parse('2015-01-23 08:00:00 -06:00'),
35
- estimated: false },
36
- { type: 'east',
37
- name: 'PAX East',
38
- date: Time.parse('2015-03-06 08:00:00 -05:00'),
39
- estimated: false }
40
- ]
41
-
42
- PAXES.map { |p| p[:type] }.each do |pax|
43
- match /(#{pax}|pax#{pax})\z/, method: "next_#{pax}"
44
-
45
- define_method "next_#{pax}" do |m|
46
- debug "#{pax}"
47
- m.reply get_next_pax(pax.to_s)
24
+ PAXES = [
25
+ { type: 'aus',
26
+ name: 'PAX Australia',
27
+ date: Time.parse('2014-10-31 08:00:00 +11:00'),
28
+ estimated: false },
29
+ { type: 'prime',
30
+ name: 'PAX Prime',
31
+ date: Time.parse('2014-08-29 08:00:00 -08:00'),
32
+ estimated: false },
33
+ { type: 'south',
34
+ name: 'PAX South',
35
+ date: Time.parse('2015-01-23 08:00:00 -06:00'),
36
+ estimated: false },
37
+ { type: 'east',
38
+ name: 'PAX East',
39
+ date: Time.parse('2015-03-06 08:00:00 -05:00'),
40
+ estimated: false }
41
+ ]
42
+
43
+ PAXES.map { |p| p[:type] }.each do |pax|
44
+ match(/(#{pax}|pax#{pax})\z/, method: "next_#{pax}")
45
+
46
+ define_method "next_#{pax}" do |m|
47
+ debug "#{pax}"
48
+ m.reply get_next_pax(pax.to_s)
49
+ end
48
50
  end
49
- end
50
51
 
51
- private
52
+ private
52
53
 
53
- def get_next_pax(type = nil)
54
- @pax = get_next_pax_for(type)
54
+ def get_next_pax(type = nil)
55
+ @pax = get_next_pax_for(type)
55
56
 
56
- return 'I don\'t have info for the next one of those PAXes' if @pax.nil?
57
+ return 'I don\'t have info for the next one of those PAXes' if @pax.nil?
57
58
 
58
- message = ["#{@pax[:name]} is"]
59
- message << 'approximately' if @pax[:estimated]
59
+ message = ["#{@pax[:name]} is"]
60
+ message << 'approximately' if @pax[:estimated]
60
61
 
61
- # Uncomment this once we can specify granularity in Time Lord.
62
- # message << TimeLord::Period.new(@pax[:date], Time.now).to_words
63
- message << Cinch::Toolbox.time_format(@pax[:date] - Time.now, [:days])
64
- message << 'from now'
62
+ # Uncomment this once we can specify granularity in Time Lord.
63
+ # message << TimeLord::Period.new(@pax[:date], Time.now).to_words
64
+ message << Cinch::Toolbox.time_format(@pax[:date] - Time.now, [:days])
65
+ message << 'from now'
65
66
 
66
- message << ' (No official date, yet)' if @pax[:estimated]
67
- message.join(' ')
68
- end
67
+ message << ' (No official date, yet)' if @pax[:estimated]
68
+ message.join(' ')
69
+ end
69
70
 
70
- def get_next_pax_for(type)
71
- paxes = PAXES.dup
71
+ def get_next_pax_for(type)
72
+ paxes = PAXES.dup
72
73
 
73
- paxes.delete_if { |pax| pax[:date] - Time.now < 0 }
74
- paxes.delete_if { |pax| pax[:type] != type } unless type.nil?
75
- paxes.sort! { |a, b| b[:date] <=> a[:date] }
74
+ paxes.delete_if { |pax| pax[:date] - Time.now < 0 }
75
+ paxes.delete_if { |pax| pax[:type] != type } unless type.nil?
76
+ paxes.sort! { |a, b| b[:date] <=> a[:date] }
76
77
 
77
- paxes.last
78
+ paxes.last
79
+ end
78
80
  end
79
81
  end
80
82
  end
@@ -3,7 +3,7 @@ module Cinch
3
3
  module Plugins
4
4
  # Versioning info
5
5
  class PaxTimer
6
- VERSION = '1.0.8'
6
+ VERSION = '1.0.9'
7
7
  end
8
8
  end
9
9
  end
@@ -15,50 +15,49 @@ describe Cinch::Plugins::PaxTimer do
15
15
  describe :pax do
16
16
  it 'should return the next pax' do
17
17
  msg = make_message(@bot, '!pax')
18
- get_replies(msg).first.text.
19
- should match(/PAX.+is (approximatly )?\d+ days from now/)
18
+ msg = get_replies(msg).first
19
+ expect(msg.text).to match(/PAX.+is (approximatly )?\d+ days from now/)
20
20
  end
21
21
 
22
22
  it 'should return nothing if there are arguments' do
23
23
  msg = make_message(@bot, '!pax fail')
24
- get_replies(msg).first.
25
- should be_nil
24
+ expect(get_replies(msg).first).to be_nil
26
25
  end
27
26
  end
28
27
 
29
28
  it 'should respond to .prime correctly' do
30
29
  msg = make_message(@bot, '!prime')
31
- get_replies(msg).first.text.
32
- should match(/PAX Prime is.+days from now/)
30
+ msg = get_replies(msg).first
31
+ expect(msg.text).to match(/PAX Prime is.+days from now/)
33
32
  end
34
33
 
35
34
  it 'should respond to .paxprime correctly' do
36
35
  msg = make_message(@bot, '!paxprime')
37
- get_replies(msg).first.text.
38
- should match(/PAX Prime is.+days from now/)
36
+ msg = get_replies(msg).first
37
+ expect(msg.text).to match(/PAX Prime is.+days from now/)
39
38
  end
40
39
 
41
40
  it 'should respond to .east correctly' do
42
41
  msg = make_message(@bot, '!east')
43
- get_replies(msg).first.text.
44
- should match(/PAX East is.+days from now/)
42
+ msg = get_replies(msg).first
43
+ expect(msg.text).to match(/PAX East is.+days from now/)
45
44
  end
46
45
 
47
46
  it 'should respond to .paxeast correctly' do
48
47
  msg = make_message(@bot, '!paxeast')
49
- get_replies(msg).first.text.
50
- should match(/PAX East is.+days from now/)
48
+ msg = get_replies(msg).first
49
+ expect(msg.text).to match(/PAX East is.+days from now/)
51
50
  end
52
51
 
53
52
  it 'should respond to .aus correctly' do
54
53
  msg = make_message(@bot, '!aus')
55
- get_replies(msg).first.text.
56
- should match(/PAX Australia is.+days from now/)
54
+ msg = get_replies(msg).first
55
+ expect(msg.text).to match(/PAX Australia is.+days from now/)
57
56
  end
58
57
 
59
58
  it 'should respond to .paxaus correctly' do
60
59
  msg = make_message(@bot, '!paxaus')
61
- get_replies(msg).first.text.
62
- should match(/PAX Australia is.+days from now/)
60
+ msg = get_replies(msg).first
61
+ expect(msg.text).to match(/PAX Australia is.+days from now/)
63
62
  end
64
63
  end
metadata CHANGED
@@ -1,76 +1,99 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cinch-pax-timer
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.8
4
+ version: 1.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Haberer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-29 00:00:00.000000000 Z
11
+ date: 2014-08-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ! '>='
17
+ - - ~>
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: '10'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ! '>='
24
+ - - ~>
25
25
  - !ruby/object:Gem::Version
26
- version: '0'
26
+ version: '10'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rspec
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ! '>='
31
+ - - ~>
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: '3'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ! '>='
38
+ - - ~>
39
39
  - !ruby/object:Gem::Version
40
- version: '0'
40
+ version: '3'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: coveralls
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ! '>='
45
+ - - ~>
46
46
  - !ruby/object:Gem::Version
47
- version: '0'
47
+ version: '0.7'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ! '>='
52
+ - - ~>
53
53
  - !ruby/object:Gem::Version
54
- version: '0'
54
+ version: '0.7'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: cinch-test
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: '0.1'
59
62
  - - ! '>='
60
63
  - !ruby/object:Gem::Version
61
- version: '0'
64
+ version: 0.1.0
62
65
  type: :development
63
66
  prerelease: false
64
67
  version_requirements: !ruby/object:Gem::Requirement
65
68
  requirements:
69
+ - - ~>
70
+ - !ruby/object:Gem::Version
71
+ version: '0.1'
66
72
  - - ! '>='
67
73
  - !ruby/object:Gem::Version
68
- version: '0'
74
+ version: 0.1.0
75
+ - !ruby/object:Gem::Dependency
76
+ name: cinch
77
+ requirement: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - ~>
80
+ - !ruby/object:Gem::Version
81
+ version: '2'
82
+ type: :runtime
83
+ prerelease: false
84
+ version_requirements: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - ~>
87
+ - !ruby/object:Gem::Version
88
+ version: '2'
69
89
  - !ruby/object:Gem::Dependency
70
90
  name: cinch-cooldown
71
91
  requirement: !ruby/object:Gem::Requirement
72
92
  requirements:
73
93
  - - ~>
94
+ - !ruby/object:Gem::Version
95
+ version: '1.1'
96
+ - - ! '>='
74
97
  - !ruby/object:Gem::Version
75
98
  version: 1.1.1
76
99
  type: :runtime
@@ -78,6 +101,9 @@ dependencies:
78
101
  version_requirements: !ruby/object:Gem::Requirement
79
102
  requirements:
80
103
  - - ~>
104
+ - !ruby/object:Gem::Version
105
+ version: '1.1'
106
+ - - ! '>='
81
107
  - !ruby/object:Gem::Version
82
108
  version: 1.1.1
83
109
  - !ruby/object:Gem::Dependency
@@ -86,14 +112,14 @@ dependencies:
86
112
  requirements:
87
113
  - - ~>
88
114
  - !ruby/object:Gem::Version
89
- version: 1.1.0
115
+ version: '1.1'
90
116
  type: :runtime
91
117
  prerelease: false
92
118
  version_requirements: !ruby/object:Gem::Requirement
93
119
  requirements:
94
120
  - - ~>
95
121
  - !ruby/object:Gem::Version
96
- version: 1.1.0
122
+ version: '1.1'
97
123
  description: Cinch plugin that allows users to see the relative time till the various
98
124
  PAX events
99
125
  email: