lita-faker 0.1.0

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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 9bf1ff2a1f52f1943f80864b1a4f7f6d7a404459
4
+ data.tar.gz: 86f1b4f25ad0b05674dad79c2cd83a460c2095e9
5
+ SHA512:
6
+ metadata.gz: a79d2fd9649f08aaa5245cea800dc2b428f799ac37cb4aebbe4971de37f26d60b425d98268b6673e66e1d900b89a02be7a34ee656dbe4e0f89609041ce9c8136
7
+ data.tar.gz: 116fc329458d359050cc583189da30d590af416ee5ebbe3817d4fd4747deab0ba8bc590be7931624944d9dc8f139928e26de904caa2c685fc2603c20b1cc7fcb
@@ -0,0 +1,35 @@
1
+ *.gem
2
+ *.rbc
3
+ /.config
4
+ /coverage/
5
+ /InstalledFiles
6
+ /pkg/
7
+ /spec/reports/
8
+ /test/tmp/
9
+ /test/version_tmp/
10
+ /tmp/
11
+
12
+ ## Specific to RubyMotion:
13
+ .dat*
14
+ .repl_history
15
+ build/
16
+
17
+ ## Documentation cache and generated files:
18
+ /.yardoc/
19
+ /_yardoc/
20
+ /doc/
21
+ /rdoc/
22
+
23
+ ## Environment normalisation:
24
+ /.bundle/
25
+ /vendor/bundle
26
+ /lib/bundler/man/
27
+
28
+ # for a library or gem, you might want to ignore these files since the code is
29
+ # intended to run in multiple environments; otherwise, check them in:
30
+ /Gemfile.lock
31
+ /.ruby-version
32
+ /.ruby-gemset
33
+
34
+ # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
35
+ .rvmrc
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --require spec_helper
@@ -0,0 +1,3 @@
1
+ AllCops:
2
+ Exclude:
3
+ - vendor/**/*
@@ -0,0 +1,10 @@
1
+ require 'coveralls'
2
+
3
+ SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
4
+ SimpleCov::Formatter::HTMLFormatter,
5
+ Coveralls::SimpleCov::Formatter,
6
+ ]
7
+
8
+ SimpleCov.start do
9
+ add_filter '/spec/'
10
+ end
@@ -0,0 +1,14 @@
1
+ language: ruby
2
+
3
+ rvm:
4
+ - 2.0.0
5
+ - 2.1
6
+ - 2.2
7
+
8
+ script: bundle exec rake
9
+
10
+ before_install:
11
+ - gem update --system
12
+
13
+ services:
14
+ - redis-server
@@ -0,0 +1,29 @@
1
+ # Change Log
2
+
3
+ ## [v0.1.0](https://github.com/braiden-vasco/lita-faker/tree/v0.1.0) (2015-06-29)
4
+
5
+ **Merged pull requests:**
6
+
7
+ - Basic implementation [\#10](https://github.com/braiden-vasco/lita-faker/pull/10) ([braiden-vasco](https://github.com/braiden-vasco))
8
+
9
+ - Remove open-ended dependencies [\#9](https://github.com/braiden-vasco/lita-faker/pull/9) ([braiden-vasco](https://github.com/braiden-vasco))
10
+
11
+ - Initialize Lita handler [\#8](https://github.com/braiden-vasco/lita-faker/pull/8) ([braiden-vasco](https://github.com/braiden-vasco))
12
+
13
+ - Add changelog generator [\#7](https://github.com/braiden-vasco/lita-faker/pull/7) ([braiden-vasco](https://github.com/braiden-vasco))
14
+
15
+ - Configure Coveralls [\#6](https://github.com/braiden-vasco/lita-faker/pull/6) ([braiden-vasco](https://github.com/braiden-vasco))
16
+
17
+ - Configure Travis CI [\#5](https://github.com/braiden-vasco/lita-faker/pull/5) ([braiden-vasco](https://github.com/braiden-vasco))
18
+
19
+ - Add README [\#4](https://github.com/braiden-vasco/lita-faker/pull/4) ([braiden-vasco](https://github.com/braiden-vasco))
20
+
21
+ - Configure testing [\#3](https://github.com/braiden-vasco/lita-faker/pull/3) ([braiden-vasco](https://github.com/braiden-vasco))
22
+
23
+ - Configure linting [\#2](https://github.com/braiden-vasco/lita-faker/pull/2) ([braiden-vasco](https://github.com/braiden-vasco))
24
+
25
+ - Initialize gem [\#1](https://github.com/braiden-vasco/lita-faker/pull/1) ([braiden-vasco](https://github.com/braiden-vasco))
26
+
27
+
28
+
29
+ \* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in lita-faker.gemspec
4
+ gemspec
5
+
6
+ gem 'coveralls', require: false
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Braiden Vasco
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
@@ -0,0 +1,51 @@
1
+ Lita::Handlers::Faker
2
+ =====================
3
+
4
+ [![Gem Version](https://badge.fury.io/rb/lita-faker.svg)](http://badge.fury.io/rb/lita-faker)
5
+ [![Build Status](https://travis-ci.org/braiden-vasco/lita-faker.svg)](https://travis-ci.org/braiden-vasco/lita-faker)
6
+ [![Coverage Status](https://coveralls.io/repos/braiden-vasco/lita-faker/badge.svg)](https://coveralls.io/r/braiden-vasco/lita-faker)
7
+
8
+ Generator of fake data such as names, addresses,
9
+ and phone numbers for the Lita chat bot.
10
+
11
+ Usage
12
+ -----
13
+
14
+ At first, see the documentation for Lita: http://docs.lita.io/
15
+
16
+ ### Installation
17
+
18
+ Add **lita-faker** to your Lita instance's Gemfile:
19
+
20
+ ```ruby
21
+ gem 'lita-faker', '~> 0.1.0'
22
+ ```
23
+
24
+ ### Configuration
25
+
26
+ Faker requires locale. Put the following to config:
27
+
28
+ ```ruby
29
+ Lita.configure do |config|
30
+ config.robot.locale = 'en-US'
31
+ end
32
+ ```
33
+
34
+ ### Commands
35
+
36
+ **lita-faker** provides all commands of [Faker](https://github.com/stympy/faker)
37
+ which don't require arguments
38
+
39
+ Commands are written in `camel_case`, so `Faker::PhoneNumber.cell_phone`
40
+ became `faker phone_number cell_phone`
41
+
42
+ `fake` is alias for `faker`
43
+
44
+ ### Examples
45
+
46
+ ```
47
+ You: lita fake name name
48
+ Lita: Halie Waelchi
49
+ You: lita faker lorem sentence
50
+ Lita: Eveniet nemo tempore voluptatem et voluptas ea.
51
+ ```
@@ -0,0 +1,31 @@
1
+ require 'rubygems'
2
+
3
+ gemspec = Gem::Specification.load('lita-faker.gemspec')
4
+
5
+ github_user, github_project =
6
+ gemspec.homepage.scan(%r{^https://github\.com/([^/]+)/([^/]+)/?$})[0]
7
+
8
+ DEFAULT_EXCLUDE_LABELS = 'duplicate,question,invalid,wontfix'
9
+
10
+ require 'bundler/gem_tasks'
11
+
12
+ task default: [:spec, :lint]
13
+
14
+ require 'rspec/core/rake_task'
15
+ RSpec::Core::RakeTask.new
16
+
17
+ task lint: [:rubocop]
18
+
19
+ require 'rubocop/rake_task'
20
+ RuboCop::RakeTask.new
21
+
22
+ desc 'Generate changelog'
23
+ task :changelog, [:token] do |_t, args|
24
+ cmd = 'github_changelog_generator'
25
+ cmd << " -u #{github_user}"
26
+ cmd << " -p #{github_project}"
27
+ cmd << " -t #{args[:token]}" if args[:token]
28
+ cmd << " --exclude-labels version,#{DEFAULT_EXCLUDE_LABELS}"
29
+
30
+ sh cmd
31
+ end
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'bundler/setup'
4
+ require 'lita/faker'
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require 'irb'
14
+ IRB.start
@@ -0,0 +1,7 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+
5
+ bundle install
6
+
7
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,14 @@
1
+ # rubocop:disable Style/FileName
2
+
3
+ require 'lita'
4
+
5
+ Lita.load_locales Dir[File.expand_path(
6
+ File.join('..', '..', 'locales', '*.yml'), __FILE__
7
+ )]
8
+
9
+ require 'lita/handlers/faker'
10
+
11
+ Lita::Handlers::Faker.template_root File.expand_path(
12
+ File.join('..', '..', 'templates'),
13
+ __FILE__
14
+ )
@@ -0,0 +1,33 @@
1
+ require 'faker'
2
+
3
+ ##
4
+ # Lita module.
5
+ #
6
+ module Lita
7
+ ##
8
+ # Lita handlers module.
9
+ #
10
+ module Handlers
11
+ ##
12
+ # Generator of fake data such as names, addresses,
13
+ # and phone numbers for the Lita chat bot.
14
+ #
15
+ class Faker < Handler
16
+ route(
17
+ /^fake(r)?\s+(?<s>\w+)\s+(?<s>\w+)$/i,
18
+ :route_faker,
19
+ command: true
20
+ )
21
+
22
+ def route_faker(response)
23
+ matches = response.matches[0]
24
+ namespace = ::Faker.const_get(matches[0].split('_').map(&:capitalize).join.to_sym)
25
+ command = namespace.method(matches[1].to_sym)
26
+
27
+ response.reply(command.call)
28
+ end
29
+ end
30
+
31
+ Lita.register_handler(Faker)
32
+ end
33
+ end
@@ -0,0 +1,37 @@
1
+ # coding: utf-8
2
+
3
+ Gem::Specification.new do |spec|
4
+ spec.name = 'lita-faker'
5
+ spec.version = '0.1.0'
6
+ spec.authors = ['Braiden Vasco']
7
+ spec.email = ['braiden-vasco@mailtor.net']
8
+
9
+ spec.summary =
10
+ 'Generator of fake data such as names, addresses,' \
11
+ ' and phone numbers for the Lita chat bot'
12
+ spec.description =
13
+ 'Generator of fake data such as names, addresses,' \
14
+ ' and phone numbers for the Lita chat bot.'
15
+ spec.homepage = 'https://github.com/braiden-vasco/lita-faker'
16
+ spec.license = 'MIT'
17
+
18
+ spec.metadata['lita_plugin_type'] = 'handler'
19
+
20
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
21
+ f.match(%r{^(test|spec|features)/})
22
+ end
23
+
24
+ spec.bindir = 'exe'
25
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
26
+ spec.require_paths = ['lib']
27
+
28
+ spec.add_development_dependency 'bundler', '~> 1.7'
29
+ spec.add_development_dependency 'rake', '~> 10.0'
30
+ spec.add_development_dependency 'rubocop', '~> 0.31'
31
+ spec.add_development_dependency 'rspec', '~> 3.3'
32
+ spec.add_development_dependency 'simplecov', '~> 0.10'
33
+ spec.add_development_dependency 'github_changelog_generator', '~> 1.6'
34
+
35
+ spec.add_runtime_dependency 'lita', '~> 4.4'
36
+ spec.add_runtime_dependency 'faker', '~> 1.4'
37
+ end
@@ -0,0 +1,4 @@
1
+ en:
2
+ lita:
3
+ handlers:
4
+ faker:
File without changes
metadata ADDED
@@ -0,0 +1,176 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: lita-faker
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Braiden Vasco
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2015-06-29 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '1.7'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '1.7'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rubocop
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ~>
46
+ - !ruby/object:Gem::Version
47
+ version: '0.31'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: '0.31'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: '3.3'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ~>
67
+ - !ruby/object:Gem::Version
68
+ version: '3.3'
69
+ - !ruby/object:Gem::Dependency
70
+ name: simplecov
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ~>
74
+ - !ruby/object:Gem::Version
75
+ version: '0.10'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ~>
81
+ - !ruby/object:Gem::Version
82
+ version: '0.10'
83
+ - !ruby/object:Gem::Dependency
84
+ name: github_changelog_generator
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ~>
88
+ - !ruby/object:Gem::Version
89
+ version: '1.6'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ~>
95
+ - !ruby/object:Gem::Version
96
+ version: '1.6'
97
+ - !ruby/object:Gem::Dependency
98
+ name: lita
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ~>
102
+ - !ruby/object:Gem::Version
103
+ version: '4.4'
104
+ type: :runtime
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ~>
109
+ - !ruby/object:Gem::Version
110
+ version: '4.4'
111
+ - !ruby/object:Gem::Dependency
112
+ name: faker
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ~>
116
+ - !ruby/object:Gem::Version
117
+ version: '1.4'
118
+ type: :runtime
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ~>
123
+ - !ruby/object:Gem::Version
124
+ version: '1.4'
125
+ description: Generator of fake data such as names, addresses, and phone numbers for
126
+ the Lita chat bot.
127
+ email:
128
+ - braiden-vasco@mailtor.net
129
+ executables: []
130
+ extensions: []
131
+ extra_rdoc_files: []
132
+ files:
133
+ - .gitignore
134
+ - .rspec
135
+ - .rubocop.yml
136
+ - .simplecov
137
+ - .travis.yml
138
+ - CHANGELOG.md
139
+ - Gemfile
140
+ - LICENSE
141
+ - README.md
142
+ - Rakefile
143
+ - bin/console
144
+ - bin/setup
145
+ - lib/lita-faker.rb
146
+ - lib/lita/handlers/faker.rb
147
+ - lita-faker.gemspec
148
+ - locales/en.yml
149
+ - templates/.gitkeep
150
+ homepage: https://github.com/braiden-vasco/lita-faker
151
+ licenses:
152
+ - MIT
153
+ metadata:
154
+ lita_plugin_type: handler
155
+ post_install_message:
156
+ rdoc_options: []
157
+ require_paths:
158
+ - lib
159
+ required_ruby_version: !ruby/object:Gem::Requirement
160
+ requirements:
161
+ - - '>='
162
+ - !ruby/object:Gem::Version
163
+ version: '0'
164
+ required_rubygems_version: !ruby/object:Gem::Requirement
165
+ requirements:
166
+ - - '>='
167
+ - !ruby/object:Gem::Version
168
+ version: '0'
169
+ requirements: []
170
+ rubyforge_project:
171
+ rubygems_version: 2.4.8
172
+ signing_key:
173
+ specification_version: 4
174
+ summary: Generator of fake data such as names, addresses, and phone numbers for the
175
+ Lita chat bot
176
+ test_files: []