etherpad-lite 0.3.0 → 0.3.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 +5 -5
- data/README.rdoc +2 -2
- data/lib/etherpad-lite/client.rb +19 -2
- data/lib/etherpad-lite/version.rb +1 -1
- metadata +16 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 6e60ac28822b76594b6deefade5bc8dc793e7f8fda892862ed393061a8fc04d0
|
4
|
+
data.tar.gz: 6bdd88bd892d675dff75c9b44de75b751b84d446b75164fcc69d1f7edff60c6e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 04ddf7130b280b8c12d594d2db43e920b10bf9d691313acc98f91f9f529d78039bdb1df433dc784c77fbf0118d184617b824889eae29caeef0b9a576b009f4cb
|
7
|
+
data.tar.gz: f90d5cefeb797c74bd2862e12b697ac7cc4a376000fda82470a97e3a2064230e5926b15bc8e10efa3ca5b9636c50f06e75b1f8ebdf86f76ea8cb4a12ebd08f34
|
data/README.rdoc
CHANGED
@@ -74,7 +74,7 @@ Some example controller actions:
|
|
74
74
|
@group = ether.get_group(params[:ep_group_id])
|
75
75
|
@pad = @group.pad(params[:ep_pad_name])
|
76
76
|
# Map the user to an EtherpadLite Author
|
77
|
-
author = ether.author("my_app_user_#{current_user.id}", :
|
77
|
+
author = ether.author("my_app_user_#{current_user.id}", name: current_user.name)
|
78
78
|
# Get or create an hour-long session for this Author in this Group
|
79
79
|
sess = session[:ep_sessions][@group.id] ? ether.get_session(session[:ep_sessions][@group.id]) : @group.create_session(author, 60)
|
80
80
|
if sess.expired?
|
@@ -83,7 +83,7 @@ Some example controller actions:
|
|
83
83
|
end
|
84
84
|
session[:ep_sessions][@group.id] = sess.id
|
85
85
|
# Set the EtherpadLite session cookie. This will automatically be picked up by the jQuery plugin's iframe.
|
86
|
-
cookies[:sessionID] = {:
|
86
|
+
cookies[:sessionID] = {value: sess.id, domain: ".yourdomain.com"}
|
87
87
|
end
|
88
88
|
end
|
89
89
|
|
data/lib/etherpad-lite/client.rb
CHANGED
@@ -47,6 +47,12 @@ module EtherpadLite
|
|
47
47
|
@uri = URI.parse(url_or_port)
|
48
48
|
@api_key = api_key_or_file.is_a?(IO) ? api_key_or_file.read : api_key_or_file
|
49
49
|
@api_version = api_version ? api_version.to_s : current_api_version.to_s
|
50
|
+
@ssl_verify = OpenSSL::SSL::VERIFY_PEER
|
51
|
+
end
|
52
|
+
|
53
|
+
# Whether peer must be verified if the API URL is SSL
|
54
|
+
def ssl_verify(mode)
|
55
|
+
@ssl_verify = mode
|
50
56
|
end
|
51
57
|
|
52
58
|
# Call an API method
|
@@ -83,13 +89,24 @@ module EtherpadLite
|
|
83
89
|
# Makes a GET request
|
84
90
|
def get(path, params={})
|
85
91
|
params[:apikey] = self.api_key
|
86
|
-
RestClient.
|
92
|
+
RestClient::Request.execute(
|
93
|
+
:method => :get,
|
94
|
+
:url => "#{self.uri}#{path}",
|
95
|
+
:headers => {
|
96
|
+
:params => params
|
97
|
+
},
|
98
|
+
:verify_ssl=> @ssl_verify )
|
87
99
|
end
|
88
100
|
|
89
101
|
# Makes a POST request
|
90
102
|
def post(path, params={})
|
91
103
|
params[:apikey] = self.api_key
|
92
|
-
RestClient.
|
104
|
+
RestClient::Request.execute(
|
105
|
+
:method => :post,
|
106
|
+
:url => "#{self.uri}#{path}",
|
107
|
+
:headers=> {},
|
108
|
+
:payload=> params,
|
109
|
+
:verify_ssl=> @ssl_verify )
|
93
110
|
end
|
94
111
|
end
|
95
112
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: etherpad-lite
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jordan Hollinger
|
@@ -14,14 +14,14 @@ dependencies:
|
|
14
14
|
name: rest-client
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.6'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.6'
|
27
27
|
description: etherpad-lite is a Ruby interface to Etherpad Lite's HTTP JSON API
|
@@ -31,21 +31,21 @@ extensions: []
|
|
31
31
|
extra_rdoc_files:
|
32
32
|
- README.rdoc
|
33
33
|
files:
|
34
|
+
- CHANGELOG
|
35
|
+
- LICENSE
|
36
|
+
- README.rdoc
|
37
|
+
- lib/etherpad-lite.rb
|
34
38
|
- lib/etherpad-lite/client.rb
|
35
|
-
- lib/etherpad-lite/
|
36
|
-
- lib/etherpad-lite/models/
|
39
|
+
- lib/etherpad-lite/models.rb
|
40
|
+
- lib/etherpad-lite/models/author.rb
|
37
41
|
- lib/etherpad-lite/models/chat_message.rb
|
38
|
-
- lib/etherpad-lite/models/padded.rb
|
39
|
-
- lib/etherpad-lite/models/pad.rb
|
40
42
|
- lib/etherpad-lite/models/diff.rb
|
41
|
-
- lib/etherpad-lite/models/
|
43
|
+
- lib/etherpad-lite/models/group.rb
|
42
44
|
- lib/etherpad-lite/models/instance.rb
|
45
|
+
- lib/etherpad-lite/models/pad.rb
|
46
|
+
- lib/etherpad-lite/models/padded.rb
|
43
47
|
- lib/etherpad-lite/models/session.rb
|
44
|
-
- lib/etherpad-lite/
|
45
|
-
- lib/etherpad-lite.rb
|
46
|
-
- README.rdoc
|
47
|
-
- CHANGELOG
|
48
|
-
- LICENSE
|
48
|
+
- lib/etherpad-lite/version.rb
|
49
49
|
homepage: http://github.com/jhollinger/ruby-etherpad-lite
|
50
50
|
licenses: []
|
51
51
|
metadata: {}
|
@@ -55,17 +55,16 @@ require_paths:
|
|
55
55
|
- lib
|
56
56
|
required_ruby_version: !ruby/object:Gem::Requirement
|
57
57
|
requirements:
|
58
|
-
- -
|
58
|
+
- - ">="
|
59
59
|
- !ruby/object:Gem::Version
|
60
60
|
version: '0'
|
61
61
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
62
62
|
requirements:
|
63
|
-
- -
|
63
|
+
- - ">="
|
64
64
|
- !ruby/object:Gem::Version
|
65
65
|
version: '0'
|
66
66
|
requirements: []
|
67
|
-
|
68
|
-
rubygems_version: 2.0.3
|
67
|
+
rubygems_version: 3.0.3.1
|
69
68
|
signing_key:
|
70
69
|
specification_version: 4
|
71
70
|
summary: A Ruby client library for Etherpad Lite
|