lita-crazycaps 0.0.1 → 0.0.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
  SHA1:
3
- metadata.gz: 6caa98f298d5e02f86cca7ffebf7e77bdfdd6214
4
- data.tar.gz: 8cb727e35e43bd54488c8b5935fd6d17edd57522
3
+ metadata.gz: b3cd751acffc1970d3cc71b5b0bd936dae5100bc
4
+ data.tar.gz: 97d63a68605a179843aff832cfc80aa0c2ed7a7d
5
5
  SHA512:
6
- metadata.gz: 7bf591b8fa2e9d08211dafb1131e6ec2f7643e08b7a7d03c5d47e04fb181e411cbfccc10aab5b73159c4ec69693a8118e301e1eba4ddda513cebfa763f8b930c
7
- data.tar.gz: 0874d2217ded6ba99086e52aed6ea682f46c9b4255ccb024ae1127ccaa27b2acd899a40a05d84924ff1561c87c5241bf041b757045d09cedb60f8684b5c4ea35
6
+ metadata.gz: 2f2b8bcbad204582fbd3ab237c6194ca0d137477e24826dd9354498597046a784ee691ef6f3b5180b104aa1c8df0faddb281668f26eddcfabfac81be26013662
7
+ data.tar.gz: 905d6ae0cce7086d9be5a4869b89f6103eecedf47049b36e65c2a5eb896b54823c59b7862475fee0262b689d040e81555bb41d3c1ac93c7d0bc1e961fc563cee
data/Gemfile CHANGED
@@ -1,3 +1,3 @@
1
- source "https://rubygems.org"
1
+ source 'https://rubygems.org'
2
2
 
3
3
  gemspec
data/README.md CHANGED
@@ -7,7 +7,7 @@
7
7
  Add lita-crazycaps to your Lita instance's Gemfile:
8
8
 
9
9
  ``` ruby
10
- gem "lita-crazycaps"
10
+ gem 'lita-crazycaps'
11
11
  ```
12
12
 
13
13
  ## Usage
data/Rakefile CHANGED
@@ -1,5 +1,5 @@
1
- require "bundler/gem_tasks"
2
- require "rspec/core/rake_task"
1
+ require 'bundler/gem_tasks'
2
+ require 'rspec/core/rake_task'
3
3
 
4
4
  RSpec::Core::RakeTask.new(:spec)
5
5
 
@@ -1,26 +1,20 @@
1
- require "lita"
1
+ require 'lita'
2
2
 
3
3
  module Lita
4
4
  module Handlers
5
5
  class Crazycaps < Handler
6
6
  route(/^(?:cc|crazycaps)\s+(.+)/i, :crazycaps, command: true, help: {
7
- "cc PHRASE" => "Return PHRASE as a randomly capitalized new phrase."
7
+ 'cc PHRASE' => 'Return PHRASE as a randomly capitalized new phrase.'
8
8
  })
9
-
9
+
10
10
  def crazycaps(response)
11
11
  phrase = response.matches[0][0]
12
- phrase_cc = ""
13
-
12
+ phrase_cc = ''
13
+
14
14
  phrase.each_char do |c|
15
- r = Random.new.rand(0..1)
16
- if (r == 0)
17
- c = c.upcase
18
- else
19
- c = c.downcase
20
- end
21
- phrase_cc += c
15
+ phrase_cc += [true, false].sample ? c.downcase : c.upcase
22
16
  end
23
-
17
+
24
18
  response.reply(phrase_cc)
25
19
  end
26
20
  end
@@ -1,7 +1,7 @@
1
- require "lita"
1
+ require 'lita'
2
2
 
3
3
  Lita.load_locales Dir[File.expand_path(
4
- File.join("..", "..", "locales", "*.yml"), __FILE__
4
+ File.join('..', '..', 'locales', '*.yml'), __FILE__
5
5
  )]
6
6
 
7
- require "lita/handlers/crazycaps"
7
+ require 'lita/handlers/crazycaps'
@@ -1,24 +1,24 @@
1
1
  Gem::Specification.new do |spec|
2
- spec.name = "lita-crazycaps"
3
- spec.version = "0.0.1"
4
- spec.authors = ["Michael Chadwick"]
5
- spec.email = ["michael.chadwick@gmail.com"]
6
- spec.description = %q{A Lita handler that randomizes the capitalization of a phrase.}
7
- spec.summary = %q{A Lita handler that randomizes the capitalization of a phrase.}
8
- spec.homepage = "https://github.com/michaelchadwick/lita-crazycaps"
9
- spec.license = "MIT"
10
- spec.metadata = { "lita_plugin_type" => "handler" }
2
+ spec.name = 'lita-crazycaps'
3
+ spec.version = '0.0.2'
4
+ spec.authors = ['Michael Chadwick']
5
+ spec.email = ['michael.chadwick@gmail.com']
6
+ spec.description = ['A Lita handler that randomizes the capitalization of a phrase.']
7
+ spec.summary = ['A Lita handler that randomizes the capitalization of a phrase.']
8
+ spec.homepage = 'https://github.com/michaelchadwick/lita-crazycaps'
9
+ spec.license = 'MIT'
10
+ spec.metadata = { 'lita_plugin_type' => 'handler' }
11
11
 
12
12
  spec.files = `git ls-files`.split($/)
13
13
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
14
14
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
15
- spec.require_paths = ["lib"]
15
+ spec.require_paths = ['lib']
16
16
 
17
- spec.add_runtime_dependency "lita", ">= 2.7"
17
+ spec.add_runtime_dependency 'lita', '>= 2.7'
18
18
 
19
- spec.add_development_dependency "bundler", "~> 1.3"
20
- spec.add_development_dependency "rake"
21
- spec.add_development_dependency "rspec", ">= 3.0.0.beta2"
22
- spec.add_development_dependency "simplecov"
23
- spec.add_development_dependency "coveralls"
19
+ spec.add_development_dependency 'bundler', '~> 1.3'
20
+ spec.add_development_dependency 'rake'
21
+ spec.add_development_dependency 'rspec', '>= 3.0.0.beta2'
22
+ spec.add_development_dependency 'simplecov'
23
+ spec.add_development_dependency 'coveralls'
24
24
  end
@@ -1,13 +1,13 @@
1
- require "spec_helper"
1
+ require 'spec_helper'
2
2
 
3
3
  describe Lita::Handlers::Crazycaps, lita_handler: true do
4
- it { routes_command("cc phrase").to(:crazycaps) }
5
- it { routes_command("crazycaps phrase").to(:crazycaps) }
6
-
7
- describe "#crazycaps" do
8
- it "responds with crazycapped PHRASE" do
9
- send_command("cc hello")
10
- expect(replies.last.downcase).to eq("hello")
4
+ it { routes_command('cc phrase').to(:crazycaps) }
5
+ it { routes_command('crazycaps phrase').to(:crazycaps) }
6
+
7
+ describe '#crazycaps' do
8
+ it 'responds with crazycapped PHRASE' do
9
+ send_command('cc hello')
10
+ expect(replies.last.downcase).to eq('hello')
11
11
  end
12
12
  end
13
13
  end
data/spec/spec_helper.rb CHANGED
@@ -1,10 +1,10 @@
1
- require "simplecov"
2
- require "coveralls"
1
+ require 'simplecov'
2
+ require 'coveralls'
3
3
  SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
4
4
  SimpleCov::Formatter::HTMLFormatter,
5
5
  Coveralls::SimpleCov::Formatter
6
6
  ]
7
- SimpleCov.start { add_filter "/spec/" }
7
+ SimpleCov.start { add_filter '/spec/' }
8
8
 
9
- require "lita-crazycaps"
10
- require "lita/rspec"
9
+ require 'lita-crazycaps'
10
+ require 'lita/rspec'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lita-crazycaps
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Chadwick
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-01 00:00:00.000000000 Z
11
+ date: 2016-03-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lita
@@ -94,7 +94,7 @@ dependencies:
94
94
  - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
- description: A Lita handler that randomizes the capitalization of a phrase.
97
+ description: '["A Lita handler that randomizes the capitalization of a phrase."]'
98
98
  email:
99
99
  - michael.chadwick@gmail.com
100
100
  executables: []
@@ -134,10 +134,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
134
134
  version: '0'
135
135
  requirements: []
136
136
  rubyforge_project:
137
- rubygems_version: 2.2.2
137
+ rubygems_version: 2.5.1
138
138
  signing_key:
139
139
  specification_version: 4
140
- summary: A Lita handler that randomizes the capitalization of a phrase.
140
+ summary: '["A Lita handler that randomizes the capitalization of a phrase."]'
141
141
  test_files:
142
142
  - spec/lita/handlers/crazycaps_spec.rb
143
143
  - spec/spec_helper.rb