sinatra_sockets 0.0.4 → 0.0.5

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: c54288802748884e7b74e50b154fab2d598ea346
4
- data.tar.gz: 363af3452bfd9684bd332d6c7988afc2d2b641b5
3
+ metadata.gz: 15ceae9b0ffb57cf0402226553bbf1d0cead1365
4
+ data.tar.gz: 1c6991d6bff221887618e35f20946e61b7320161
5
5
  SHA512:
6
- metadata.gz: 3e5d8b07d6fe155af2297117a9e253631919e92b5aee628d90facbbcaa26c384a8b829e9fea94fd898026b62551da157feda59a9835a4685a5d82d7d760015c2
7
- data.tar.gz: 6d59490fd5530989a90e0b031a0deb5069d849c09c4eb3ac819257b83378ba78fef91ff8e7efbb394059341375a572b4697a2769ef33f70074b820e6be59964a
6
+ metadata.gz: 8d9bfe79ce004845abb884862540554e14ed3713b2c11fb2594ab0600138aa048b6d9500a6726ae40b12ec19652a97c12aa8d2de3df084b2aca4d833c18ca38d
7
+ data.tar.gz: b5daeb4d873e9f103fbf0fb4f50173adec5e18040a6baf508fac4c86c5577aeb56107f5001ab9fa1f5ea1804924a9fcbd1e17b26e2c2f145859e4377569adcf0
data/README.md CHANGED
@@ -1,15 +1,39 @@
1
- This is a gem which is available through rubygems:
1
+ ```sh
2
+ $ gem install sinatra_sockets
3
+ $ sinatra_sockets generate .
4
+ ```
2
5
 
3
- > gem install sinatra_sockets
6
+ It will print the generated directory tree:
4
7
 
5
- After doing this the `sinatra_sockets generate PATH` shell command can be used.
8
+ ```txt
9
+ Generated directory:
10
+ ./server_skeleton
11
+ ├── config.ru
12
+ ├── Gemfile
13
+ ├── Gemfile.lock
14
+ ├── lib
15
+ │   ├── routes
16
+ │   │   └── ws.rb
17
+ │   └── routes.rb
18
+ ├── README.md
19
+ └── server.rb
6
20
 
7
- The generated directory will be called `server_skeleton`. The PATH can be set to `.` for `./server_skeleton` to be created.
21
+ 2 directories, 7 files
22
+ ```
8
23
 
9
- The generated code is commented and should be read through and customized.
24
+ Start the server with thin:
10
25
 
11
- In its basic form it's a websocket server using faye-websockets and a very small sinatra front-end with Slim.
26
+ ```sh
27
+ cd server_skeleton
28
+ bundle exec thin start
29
+ # ... listening on localhost:3000
30
+ ```
12
31
 
13
- Once generated, `cd server_skeleton` and run `thin start`. Then visit `localhost:3000` and open the dev console.
32
+ Earlier iterations of this had more files, mainly because of front-end stuff. However, I think a boiler is best
33
+ if it's kept minimal, so I removed all that and now it's API only. At the same time, though, I added a token-based
34
+ credential system as well as Github oAuth. Now it can tie in well with a front-end that's hosted on another server like
35
+ Webpack.
14
36
 
15
- The client will have pinged a message to the server, and the server responds by saying `got <message>`
37
+ This can be seen in action in another boilerplate, [vue-webpack-coffee-slim-boiler](https://github.com/maxpleaner/vue-webpack-coffee-slim-boiler). sinatra_sockets is used as the server component there.
38
+
39
+ The source code includes comments.
@@ -1,5 +1,6 @@
1
1
  source "http://rubygems.org"
2
2
 
3
+ gem 'byebug'
3
4
  gem 'sinatra'
4
5
  gem 'faye-websocket'
5
6
  gem "thin"
data/lib/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module SinatraSockets
2
- VERSION = '0.0.4'
2
+ VERSION = '0.0.5'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sinatra_sockets
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - maxpleaner