t_chatter 0.1.4 → 0.1.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/t_chatter/version.rb +1 -1
- metadata +2 -13
- data/.gitignore +0 -13
- data/.travis.yml +0 -4
- data/CODE_OF_CONDUCT.md +0 -13
- data/Gemfile +0 -6
- data/LICENSE.txt +0 -21
- data/README.md +0 -101
- data/Rakefile +0 -1
- data/bin/console +0 -24
- data/bin/setup +0 -9
- data/t_chatter-0.1.0.gem +0 -0
- data/t_chatter.gemspec +0 -42
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5e97b1ae9033ff6d007278f5dd77d4f6d6fcea42
|
4
|
+
data.tar.gz: 65a73828e8e659d054eca35aaec8a2fe0646a0da
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: db17eb0043b84f060caaa5c341d6ce91a708351ebb475333758ba0d4ef27065a5d0a9d4e9518973aba7a8a40d055f06951e23d8afa60c2e4f5c004d5db9fe575
|
7
|
+
data.tar.gz: 06242f9a816983dacf338de09e8e200650e946011fa2bd5eeffe7ba00543bfd19ac99dbb9cf53b1d2d4bfb6f40c2762a7ec1e04cd22d2eccdc53246d42325398
|
data/lib/t_chatter/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: t_chatter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.4
|
4
|
+
version: 0.1.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Oreoluwa Akinniranye
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-10-
|
11
|
+
date: 2015-10-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -52,15 +52,6 @@ executables:
|
|
52
52
|
extensions: []
|
53
53
|
extra_rdoc_files: []
|
54
54
|
files:
|
55
|
-
- ".gitignore"
|
56
|
-
- ".travis.yml"
|
57
|
-
- CODE_OF_CONDUCT.md
|
58
|
-
- Gemfile
|
59
|
-
- LICENSE.txt
|
60
|
-
- README.md
|
61
|
-
- Rakefile
|
62
|
-
- bin/console
|
63
|
-
- bin/setup
|
64
55
|
- bin/setup_t_chatter
|
65
56
|
- bin/t_chatter
|
66
57
|
- lib/t_chatter.rb
|
@@ -68,8 +59,6 @@ files:
|
|
68
59
|
- lib/t_chatter/config_setup.rb
|
69
60
|
- lib/t_chatter/entry.rb
|
70
61
|
- lib/t_chatter/version.rb
|
71
|
-
- t_chatter-0.1.0.gem
|
72
|
-
- t_chatter.gemspec
|
73
62
|
homepage: https://github.com/andela-oakinniranye/t_chatter
|
74
63
|
licenses:
|
75
64
|
- MIT
|
data/.gitignore
DELETED
data/.travis.yml
DELETED
data/CODE_OF_CONDUCT.md
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
# Contributor Code of Conduct
|
2
|
-
|
3
|
-
As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
|
4
|
-
|
5
|
-
We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.
|
6
|
-
|
7
|
-
Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
|
8
|
-
|
9
|
-
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
|
10
|
-
|
11
|
-
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
|
12
|
-
|
13
|
-
This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
|
data/Gemfile
DELETED
data/LICENSE.txt
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
The MIT License (MIT)
|
2
|
-
|
3
|
-
Copyright (c) 2015 Oreoluwa Akinniranye
|
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
|
13
|
-
all 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
|
21
|
-
THE SOFTWARE.
|
data/README.md
DELETED
@@ -1,101 +0,0 @@
|
|
1
|
-
# TChatter
|
2
|
-
|
3
|
-
## Installation
|
4
|
-
Install with:
|
5
|
-
```
|
6
|
-
gem install t_chatter
|
7
|
-
```
|
8
|
-
May not be useful in your application though, but in case you want to experiment with it
|
9
|
-
|
10
|
-
```
|
11
|
-
gem 't_chatter'
|
12
|
-
```
|
13
|
-
|
14
|
-
## Setup
|
15
|
-
I have written a small setup script which only requires you run:
|
16
|
-
```
|
17
|
-
setup_t_chatter
|
18
|
-
```
|
19
|
-
It takes you through an interactive console to setup the chatter.
|
20
|
-
|
21
|
-
All the answers are optional.
|
22
|
-
In case you don't want to use the default server the application uses, you can also enter your own server
|
23
|
-
Make sure you have a `\receive` route which sends a response in JSON format. The response must contain a
|
24
|
-
`message` and `last_message_id` keys.
|
25
|
-
And the `\send` route which accepts a post request and returns the `last_message_id` key.
|
26
|
-
|
27
|
-
## Usage
|
28
|
-
To check it out, simply call type:
|
29
|
-
```
|
30
|
-
t_chatter
|
31
|
-
```
|
32
|
-
on your terminal and watch the message stream in.
|
33
|
-
|
34
|
-
If you specified to receive message, you will only see the messages, if to send message you will only be able to send
|
35
|
-
However if you specified for both, you can both send an receive messages.
|
36
|
-
|
37
|
-
Don't worry if you didn't do it at first though. you can always set it up again.
|
38
|
-
|
39
|
-
```
|
40
|
-
PS: To keep the application as slim and compact as possible, there is no database involved in this application nor the server, everything is stored in an array which puts us at the mercy of the hosting provider and updates. Therefore don't expect much in terms of data persistence.
|
41
|
-
```
|
42
|
-
|
43
|
-
## History
|
44
|
-
|
45
|
-
Thanks for wanting to try out TChatter.
|
46
|
-
TChatter is just an experiment and a hack on concurrency in Ruby applications.
|
47
|
-
So, I was thinking of something crazy I could do while learning something new and
|
48
|
-
I thought of a chat messenger. However, there are many chat messengers out there
|
49
|
-
And another could easily be spawned if I was using a web framework, therefore not
|
50
|
-
much of a learning.
|
51
|
-
I then thought of a chatting application on the terminal hence: TChatter(Terminal Chatter)
|
52
|
-
The problem I realized I would have encountered which wasn't much of a problem in
|
53
|
-
a web application was concurrency:
|
54
|
-
`How do I implement an application that would listen for input from the user as well
|
55
|
-
as update almost in realtime the content on another terminal.`
|
56
|
-
|
57
|
-
### Solutions
|
58
|
-
`The first solution may not always be the best solution`
|
59
|
-
|
60
|
-
The first solution I thought of was a sort of loop, however this was a blocking solution,
|
61
|
-
I could have put it in a Timeout block, however, this still didn't seem to be the best
|
62
|
-
|
63
|
-
In came EventMachine, which was awesome.
|
64
|
-
Due to a very shallow understanding of EventMachine I used some sort of periodic timer which
|
65
|
-
which also didnt appear to be the best solution, as I had to send messages on one terminal
|
66
|
-
and receive on another.
|
67
|
-
|
68
|
-
Thread to the rescue
|
69
|
-
Then I learnt of the Ruby Thread which was no finally used.
|
70
|
-
The Thread seem to be the most effecient as it could do many things at the same time.
|
71
|
-
|
72
|
-
One major pitfall with Thread is that it may not be stopped even after exiting your
|
73
|
-
loop in the application as it 'kinda' freezes my console (I had to depress a key twice
|
74
|
-
for the console to respond).
|
75
|
-
|
76
|
-
The way I found around that was to use the Ruby trap method as in
|
77
|
-
```ruby
|
78
|
-
trap("INT") {
|
79
|
-
puts "Exiting the chat"
|
80
|
-
threads.each{|t|
|
81
|
-
t.exit
|
82
|
-
}
|
83
|
-
}
|
84
|
-
```
|
85
|
-
Thanks to [SO(stackoverflow)](http://stackoverflow.com/questions/27642943/kill-all-threads-on-terminate?answertab=votes#tab-top).
|
86
|
-
|
87
|
-
This is not close to the best application I have and will build, however I seem to be most excited
|
88
|
-
about this for now.
|
89
|
-
|
90
|
-
Let's see where the future takes me.
|
91
|
-
[To know how I feel about this you have to listen to this](http://www.youtube.com/watch?v=ZR0v0i63PQ4)
|
92
|
-
|
93
|
-
|
94
|
-
## Contributing
|
95
|
-
|
96
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/andela-oakinniranye/t_chatter. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
|
97
|
-
|
98
|
-
|
99
|
-
## License
|
100
|
-
|
101
|
-
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
data/Rakefile
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
require "bundler/gem_tasks"
|
data/bin/console
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
# require "pry"
|
4
|
-
require "bundler/setup"
|
5
|
-
require "t_chatter"
|
6
|
-
|
7
|
-
# You can add fixtures and/or initialization code here to make experimenting
|
8
|
-
# with your gem easier. You can also use a different console, if you like.
|
9
|
-
def reload!
|
10
|
-
puts "Reloading..."
|
11
|
-
files = $LOADED_FEATURES.select { |feat| feat =~ /\/t_chatter\// }
|
12
|
-
files.each { |file| load file }
|
13
|
-
true
|
14
|
-
ARGV.clear
|
15
|
-
end
|
16
|
-
# reload!
|
17
|
-
# Pry.start
|
18
|
-
|
19
|
-
# (If you use this, don't forget to add pry to your Gemfile!)
|
20
|
-
Pry.start
|
21
|
-
|
22
|
-
# require "irb"
|
23
|
-
# IRB.start
|
24
|
-
# TChatter::Start.chat
|
data/bin/setup
DELETED
data/t_chatter-0.1.0.gem
DELETED
Binary file
|
data/t_chatter.gemspec
DELETED
@@ -1,42 +0,0 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
lib = File.expand_path('../lib', __FILE__)
|
3
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require 't_chatter/version'
|
5
|
-
|
6
|
-
Gem::Specification.new do |spec|
|
7
|
-
spec.name = "t_chatter"
|
8
|
-
spec.version = TChatter::VERSION
|
9
|
-
spec.authors = ["Oreoluwa Akinniranye"]
|
10
|
-
spec.email = ["oreoluwa.akinniranye@andela.com"]
|
11
|
-
|
12
|
-
spec.summary = %q{Allows you to chat on your terminal|command line}
|
13
|
-
spec.homepage = "https://github.com/andela-oakinniranye/t_chatter"
|
14
|
-
|
15
|
-
spec.description = <<-EOS
|
16
|
-
TChatter allows you to chat with your friends on your
|
17
|
-
terminal.
|
18
|
-
You can extend it further though to chat with your
|
19
|
-
friends on Slack and other applications."
|
20
|
-
Visit TChatter's homepage to read more on the application.
|
21
|
-
EOS
|
22
|
-
|
23
|
-
spec.license = "MIT"
|
24
|
-
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
25
|
-
spec.bindir = "bin"
|
26
|
-
spec.executables = ['t_chatter', 'setup_t_chatter']
|
27
|
-
spec.require_paths = ["lib"]
|
28
|
-
|
29
|
-
|
30
|
-
spec.post_install_message = <<-EOS
|
31
|
-
|
32
|
-
Thanks for trying out my interesting gem.
|
33
|
-
To complete the installation, run `setup_t_chatter` to
|
34
|
-
create a .chatter.yml configuration file.
|
35
|
-
This allows you to use your own url and set defaults
|
36
|
-
for your version of TChatter
|
37
|
-
|
38
|
-
EOS
|
39
|
-
|
40
|
-
spec.add_development_dependency "bundler", "~> 1.10"
|
41
|
-
spec.add_development_dependency "rake", "~> 10.0"
|
42
|
-
end
|