em-sessions 0.2.0 → 0.2.1

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: 59a427d0950a2335977750cc52fa6bd118584552
4
- data.tar.gz: f44b5e59c8523f1df399f122a0c68047b0af8fd2
3
+ metadata.gz: 97c1738cb29d068308ae318dd52f2a824d8628b1
4
+ data.tar.gz: b785c46e65fcc3b9d9b103678544c209ff2da2ae
5
5
  SHA512:
6
- metadata.gz: a6196edf9a09393110c2ac5bc749c96ce25311112bde04036ca5cc448622e064033af339210450946da13c6ae1ad0b69f284f3a65a164ab2a4d1074d23e2f135
7
- data.tar.gz: 59703da816c2f882b7146f7a26c41972b24316b3e05ebda8fcce780d5ca62e0dec793236e1af7272ec8150c63a5d7fb7255da0ef55447844a49683b87bfe78c6
6
+ metadata.gz: 58cd568cd4885be8a550999efda4eb6b6cc0a54a39f0d8b45b4d9987b0ea74532582efa3bfa6e9d10cbcc665bc6259ce13e4ce31da286507df9df6dce8d88f96
7
+ data.tar.gz: 5fb23f27b1bba3c63b0ea021c53a12f653d7091ab5020d45eb8c075b374d75d96fb7135074cdab955e9f3a30e12bc41b81bc4ebc29528def9f16cdc7fbe24d4a
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016 millim
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 CHANGED
@@ -1 +1,68 @@
1
- Developing!
1
+ # em-sessions #
2
+
3
+ em-sessions is rest-sessions ruby client, about see: [rest-sessions](https://github.com/smrchy/rest-sessions).
4
+
5
+ ## Installation ##
6
+
7
+ Install em-sessions as a gem:
8
+
9
+ ```
10
+ gem install em-sessions
11
+ ```
12
+
13
+ or add to your Gemfile:
14
+
15
+ ```ruby
16
+ # Gemfile
17
+ gem 'em-http-request'
18
+ gem 'em-sessions'
19
+
20
+ ```
21
+
22
+ and run `bundle install` to install the dependency.
23
+
24
+
25
+ ## Initialize ##
26
+
27
+ ```ruby
28
+ # default: init(url = 'localhost:3000', app = 'weapp')
29
+ Em::Sessions.init
30
+ client = Em::Sessions.client
31
+ ```
32
+ ## Notice ##
33
+ client`s all methods return two params, one code, one json, such as:
34
+ ```ruby
35
+ client.create('1') # [200, {"token": "9kwi9wu429dkw8urkhr923jrekw32" ]
36
+ ```
37
+ you can
38
+ ```ruby
39
+ code, json = client.create('1')
40
+ json['token'] # 9kwi9wu429dkw8urkhr923jrekw32
41
+ ```
42
+
43
+ ## Use List ##
44
+
45
+ ```ruby
46
+
47
+ client.create(id, out_time = 7200, ip = '0.0.0.0')
48
+
49
+ client.find_by_token(token)
50
+
51
+ client.find_by_id(id)
52
+
53
+ client.set_params_by_token(token, params = {})
54
+
55
+ client.delete_by_token(token)
56
+
57
+ client.delete_by_id(id)
58
+
59
+ client.delete_all
60
+
61
+ client.activity?
62
+ ```
63
+
64
+
65
+
66
+ ## Copyright ##
67
+
68
+ Copyright © 2011-2016. See [LICENSE](https://github.com/millim/em-sessions/blob/master/LICENSE.txt) for details.
@@ -1,5 +1,5 @@
1
1
  module Em
2
2
  module Sessions
3
- VERSION = "0.2.0"
3
+ VERSION = "0.2.1"
4
4
  end
5
5
  end
data/lib/em-sessions.rb CHANGED
@@ -11,7 +11,7 @@ module Em
11
11
  end
12
12
 
13
13
  def client
14
- raise 'Please run Em::Sessions.init(http_url, app) method' if @http_url.empty? && @app.empty?
14
+ raise 'Please run Em::Sessions.init(http_url, app) method' if @http_url.nil? && @app.nil?
15
15
  @client ||= Client.new @http_url, @app
16
16
  end
17
17
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: em-sessions
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - millim
@@ -47,6 +47,7 @@ extra_rdoc_files: []
47
47
  files:
48
48
  - ".gitignore"
49
49
  - Gemfile
50
+ - LICENSE.txt
50
51
  - README.md
51
52
  - Rakefile
52
53
  - em-sessions.gemspec