lita-onewheel-old-reddit 0.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: eca47d20275e0dd31e34156c97a5c65617df38b5d9025182524dca383a31bf18
4
+ data.tar.gz: eec4e38ed5c41db9c0fec8104f6e79a06013fcd865ac062b577c79a2bcd12bf1
5
+ SHA512:
6
+ metadata.gz: fd9651f27a4c4c934cd6dbd63761d3b41e5c30e5653bf1d64c9d2c291544b30d47cecd0262d08f4bd1541c4a9edd5f712f65aef380f90f7c048433e088a75d33
7
+ data.tar.gz: 3b4ef761d1b99910a2056b0bf658c7d28f0c84e05b388903c7736c0c1dc84b557deef3c077978d102e8738348d3d30eaf4f6d581d7bff7fdbd7a6885e6ac1313
@@ -0,0 +1,5 @@
1
+ .idea
2
+ bin
3
+ coverage
4
+ *~
5
+ .bundle
@@ -0,0 +1,8 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.5.1
4
+ script: bundle exec rake
5
+ before_install:
6
+ - gem update --system
7
+ services:
8
+ - redis-server
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
@@ -0,0 +1,89 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ lita-onewheel-old-reddit (0.0.0)
5
+ lita (~> 4)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ concurrent-ruby (1.0.5)
11
+ coveralls (0.8.21)
12
+ json (>= 1.8, < 3)
13
+ simplecov (~> 0.14.1)
14
+ term-ansicolor (~> 1.3)
15
+ thor (~> 0.19.4)
16
+ tins (~> 1.6)
17
+ diff-lcs (1.3)
18
+ docile (1.1.5)
19
+ faraday (0.15.3)
20
+ multipart-post (>= 1.2, < 3)
21
+ http_router (0.11.2)
22
+ rack (>= 1.0.0)
23
+ url_mount (~> 0.2.1)
24
+ i18n (1.1.0)
25
+ concurrent-ruby (~> 1.0)
26
+ ice_nine (0.11.2)
27
+ json (2.1.0)
28
+ lita (4.7.1)
29
+ bundler (>= 1.3)
30
+ faraday (>= 0.8.7)
31
+ http_router (>= 0.11.2)
32
+ i18n (>= 0.6.9)
33
+ ice_nine (>= 0.11.0)
34
+ multi_json (>= 1.7.7)
35
+ puma (>= 2.7.1)
36
+ rack (>= 1.5.2, < 2.0.0)
37
+ rb-readline (>= 0.5.1)
38
+ redis-namespace (>= 1.3.0)
39
+ thor (>= 0.18.1)
40
+ multi_json (1.13.1)
41
+ multipart-post (2.0.0)
42
+ puma (3.12.0)
43
+ rack (1.6.8)
44
+ rack-test (0.7.0)
45
+ rack (>= 1.0, < 3)
46
+ rake (12.0.0)
47
+ rb-readline (0.5.5)
48
+ redis (4.0.2)
49
+ redis-namespace (1.6.0)
50
+ redis (>= 3.0.4)
51
+ rspec (3.6.0)
52
+ rspec-core (~> 3.6.0)
53
+ rspec-expectations (~> 3.6.0)
54
+ rspec-mocks (~> 3.6.0)
55
+ rspec-core (3.6.0)
56
+ rspec-support (~> 3.6.0)
57
+ rspec-expectations (3.6.0)
58
+ diff-lcs (>= 1.2.0, < 2.0)
59
+ rspec-support (~> 3.6.0)
60
+ rspec-mocks (3.6.0)
61
+ diff-lcs (>= 1.2.0, < 2.0)
62
+ rspec-support (~> 3.6.0)
63
+ rspec-support (3.6.0)
64
+ simplecov (0.14.1)
65
+ docile (~> 1.1.0)
66
+ json (>= 1.8, < 3)
67
+ simplecov-html (~> 0.10.0)
68
+ simplecov-html (0.10.1)
69
+ term-ansicolor (1.6.0)
70
+ tins (~> 1.0)
71
+ thor (0.19.4)
72
+ tins (1.15.0)
73
+ url_mount (0.2.1)
74
+ rack
75
+
76
+ PLATFORMS
77
+ ruby
78
+
79
+ DEPENDENCIES
80
+ bundler (~> 1)
81
+ coveralls (~> 0)
82
+ lita-onewheel-old-reddit!
83
+ rack-test (~> 0)
84
+ rake (~> 12)
85
+ rspec (~> 3)
86
+ simplecov (~> 0)
87
+
88
+ BUNDLED WITH
89
+ 1.16.1
@@ -0,0 +1,19 @@
1
+ # lita-onewheel-old-reddit
2
+
3
+ [![Build Status](https://travis-ci.org/onewheelskyward/lita-onewheel-old-reddit.png?branch=master)](https://travis-ci.org/onewheelskyward/lita-onewheel-old-reddit)
4
+ [![Coverage Status](https://coveralls.io/repos/onewheelskyward/lita-onewheel-old-reddit/badge.png)](https://coveralls.io/r/onewheelskyward/lita-onewheel-old-reddit)
5
+
6
+ Gives you old reddit links 'cause new reddit suuuucks
7
+
8
+ ## Installation
9
+
10
+ Add lita-onewheel-old-reddit to your Lita instance's Gemfile:
11
+
12
+ ``` ruby
13
+ gem "lita-onewheel-old-reddit"
14
+ ```
15
+
16
+ ## Usage
17
+
18
+ https://reddit.com
19
+
@@ -0,0 +1,6 @@
1
+ require 'bundler/gem_tasks'
2
+ require 'rspec/core/rake_task'
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task default: :spec
@@ -0,0 +1,3 @@
1
+ require 'lita'
2
+
3
+ require 'lita/handlers/onewheel_old_reddit'
@@ -0,0 +1,18 @@
1
+ module Lita
2
+ module Handlers
3
+ class OnewheelOldReddit < Handler
4
+ route(/(https:\/\/.*reddit.com\/[^\s]+)/i, :old_reddit)
5
+
6
+ def old_reddit(response)
7
+ reddit_uri = response.matches[0][0]
8
+ Lita.logger.debug "Incoming URI: #{reddit_uri}"
9
+ reddit_uri.sub! /https:\/\/www.reddit.com/, 'https://old.reddit.com'
10
+ reddit_uri.sub! /https:\/\/reddit.com/, 'https://old.reddit.com'
11
+ Lita.logger.debug "Modified URI: #{reddit_uri}"
12
+ response.reply reddit_uri
13
+ end
14
+
15
+ Lita.register_handler(self)
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,25 @@
1
+ Gem::Specification.new do |spec|
2
+ spec.name = 'lita-onewheel-old-reddit'
3
+ spec.version = '0.0.0'
4
+ spec.authors = ['Andrew Kreps']
5
+ spec.email = ['andrew.kreps@gmail.com']
6
+ spec.description = %q{Lita interface to give you old reddit links because new reddit sucks.}
7
+ spec.summary = %q{See above.}
8
+ spec.homepage = 'https://github.com/onewheelskyward/lita-onewheel-old-reddit'
9
+ spec.license = 'MIT'
10
+ spec.metadata = { 'lita_plugin_type' => 'handler'}
11
+
12
+ spec.files = `git ls-files`.split($/)
13
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
14
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
15
+ spec.require_paths = ['lib']
16
+
17
+ spec.add_runtime_dependency 'lita', '~> 4'
18
+
19
+ spec.add_development_dependency 'bundler', '~> 1'
20
+ spec.add_development_dependency 'rake', '~> 12'
21
+ spec.add_development_dependency 'rack-test', '~> 0'
22
+ spec.add_development_dependency 'rspec', '~> 3'
23
+ spec.add_development_dependency 'simplecov', '~> 0'
24
+ spec.add_development_dependency 'coveralls', '~> 0'
25
+ end
@@ -0,0 +1,13 @@
1
+ require 'spec_helper'
2
+
3
+ describe Lita::Handlers::OnewheelOldReddit, lita_handler: true do
4
+ it 'will fix the uri' do
5
+ send_message 'https://www.reddit.com/r/xyz'
6
+ expect(replies.last).to eq('https://old.reddit.com/r/xyz')
7
+ end
8
+
9
+ it 'will fix the other uri' do
10
+ send_message 'https://reddit.com/r/xyz'
11
+ expect(replies.last).to eq('https://old.reddit.com/r/xyz')
12
+ end
13
+ end
@@ -0,0 +1,19 @@
1
+ require 'simplecov'
2
+ require 'coveralls'
3
+ SimpleCov.formatters = [
4
+ SimpleCov::Formatter::HTMLFormatter,
5
+ Coveralls::SimpleCov::Formatter
6
+ ]
7
+ SimpleCov.start { add_filter '/spec/' }
8
+
9
+ require 'lita-onewheel-old-reddit'
10
+ require 'lita/rspec'
11
+
12
+ # A compatibility mode is provided for older plugins upgrading from Lita 3. Since this plugin
13
+ # was generated with Lita 4, the compatibility mode should be left disabled.
14
+ Lita.version_3_compatibility_mode = false
15
+
16
+ def mock_fixture(fixture)
17
+ mock = File.open("spec/fixtures/#{fixture}.html").read
18
+ allow(RestClient).to receive(:get) { mock }
19
+ end
metadata ADDED
@@ -0,0 +1,156 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: lita-onewheel-old-reddit
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Andrew Kreps
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2018-10-10 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: lita
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '4'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '4'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '12'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '12'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rack-test
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rspec
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '3'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '3'
83
+ - !ruby/object:Gem::Dependency
84
+ name: simplecov
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: coveralls
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ description: Lita interface to give you old reddit links because new reddit sucks.
112
+ email:
113
+ - andrew.kreps@gmail.com
114
+ executables: []
115
+ extensions: []
116
+ extra_rdoc_files: []
117
+ files:
118
+ - ".gitignore"
119
+ - ".travis.yml"
120
+ - Gemfile
121
+ - Gemfile.lock
122
+ - README.md
123
+ - Rakefile
124
+ - lib/lita-onewheel-old-reddit.rb
125
+ - lib/lita/handlers/onewheel_old_reddit.rb
126
+ - lita-onewheel-old-reddit.gemspec
127
+ - spec/lita/handlers/onewheel_old_reddit_spec.rb
128
+ - spec/spec_helper.rb
129
+ homepage: https://github.com/onewheelskyward/lita-onewheel-old-reddit
130
+ licenses:
131
+ - MIT
132
+ metadata:
133
+ lita_plugin_type: handler
134
+ post_install_message:
135
+ rdoc_options: []
136
+ require_paths:
137
+ - lib
138
+ required_ruby_version: !ruby/object:Gem::Requirement
139
+ requirements:
140
+ - - ">="
141
+ - !ruby/object:Gem::Version
142
+ version: '0'
143
+ required_rubygems_version: !ruby/object:Gem::Requirement
144
+ requirements:
145
+ - - ">="
146
+ - !ruby/object:Gem::Version
147
+ version: '0'
148
+ requirements: []
149
+ rubyforge_project:
150
+ rubygems_version: 2.7.6
151
+ signing_key:
152
+ specification_version: 4
153
+ summary: See above.
154
+ test_files:
155
+ - spec/lita/handlers/onewheel_old_reddit_spec.rb
156
+ - spec/spec_helper.rb