etherpad-lite 0.2.3 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: d745cb72cb181e73a58f018361f65076f5c71271
4
+ data.tar.gz: 37b34bf47ae14afd97d03bc68517ea6695a5bdea
5
+ SHA512:
6
+ metadata.gz: 33430a5fffc2557c13305e928aa43ee9def25c0a77630af96ead8ed7ba099e1908395332581d028628ec9c9046089fd101ad787d5c1d5fe32a99b2760480c65f
7
+ data.tar.gz: 1377f2b2e7a8b4aacf4712e30b393b5bed5247c6f4fe3c3e73b2be7532de96f0b6b55a5b0c132089e96c9c012f96cf3fb9bbf733b82e11e1401e2cbb22852b21
data/CHANGELOG CHANGED
@@ -1,3 +1,11 @@
1
+ ** RELEASE 0.3.0 (2013-08-27) **
2
+
3
+ * 100th commit, woot!
4
+ * Target version 1.2.8 of API
5
+ * Added EtherpadLite::API_VERSION constant to reflect the above
6
+ * Added EtherpadLite::Pad#diff (EtherpadLite::Diff)
7
+ * Added EtherpadLite::Pad#changeset
8
+
1
9
  ** RELEASE 0.2.3 (2013-04-11) **
2
10
 
3
11
  * Add support for Chat API
@@ -39,7 +39,7 @@ The above example deals with public pads, accessible to anyone through the Web U
39
39
  Examples are documented in EtherpadLite::Group, EtherpadLite::Author, and EtherpadLite::Session.
40
40
 
41
41
  == Example use in Rails
42
- For your view, I recommend the jQuery plugin at {github.com/johnyma22/etherpad-lite-jquery-plugin}[https://github.com/johnyma22/etherpad-lite-jquery-plugin].
42
+ For your view, I recommend the jQuery plugin at {github.com/ether/etherpad-lite-jquery-plugin}[https://github.com/ether/etherpad-lite-jquery-plugin].
43
43
  Also, I recommend reading the docs for EtherpadLite::Group first.
44
44
 
45
45
  Add the following to your Gemfile
@@ -1,6 +1,7 @@
1
1
  require 'etherpad-lite/models/padded'
2
2
  require 'etherpad-lite/models/instance'
3
3
  require 'etherpad-lite/models/pad'
4
+ require 'etherpad-lite/models/diff'
4
5
  require 'etherpad-lite/models/chat_message'
5
6
  require 'etherpad-lite/models/group'
6
7
  require 'etherpad-lite/models/author'
@@ -0,0 +1,43 @@
1
+ module EtherpadLite
2
+ # Represents a diff between two Pad revisions.
3
+ class Diff
4
+ # The EtherpadLite::Instance object
5
+ attr_accessor :instance
6
+ # The EtherpadLite::Pad object
7
+ attr_accessor :pad
8
+ # Diff start revision
9
+ attr_accessor :start_rev
10
+ # Diff end revision
11
+ attr_accessor :end_rev
12
+
13
+ # If end_rev is not specified, the latest revision will be used
14
+ def initialize(pad, start_rev, end_rev=nil)
15
+ @instance = pad.instance
16
+ @pad = pad
17
+ @start_rev = start_rev
18
+ @end_rev = end_rev || pad.revision_numbers.last
19
+ end
20
+
21
+ # Returns the diff as html
22
+ def html
23
+ diff[:html]
24
+ end
25
+
26
+ # Returns the IDs of the authors who were involved in the diff
27
+ def author_ids
28
+ diff[:authors]
29
+ end
30
+
31
+ # Returns Authors who were involved in the diff
32
+ def authors
33
+ @authors ||= author_ids.map { |id| Author.new(instance, id) }
34
+ end
35
+
36
+ private
37
+
38
+ # Queries and caches the diff
39
+ def diff
40
+ @diff ||= instance.client.createDiffHTML(padID: pad.id, startRev: start_rev, endRev: end_rev)
41
+ end
42
+ end
43
+ end
@@ -121,6 +121,16 @@ module EtherpadLite
121
121
  revision_numbers.map { |n| Pad.new(@instance, @id, :rev => n) }
122
122
  end
123
123
 
124
+ # Returns a Diff. If end_rev is not specified, the latest revision will be used
125
+ def diff(start_rev, end_rev=nil)
126
+ Diff.new(self, start_rev, end_rev)
127
+ end
128
+
129
+ # Returns the changeset for the given revision
130
+ def changeset(rev)
131
+ @instance.client.getRevisionChangeset(padID: @id, rev: rev)
132
+ end
133
+
124
134
  # Returns an array of users hashes, representing users currently using the pad
125
135
  def users
126
136
  @instance.client.padUsers(padID: @id)[:padUsers]
@@ -1,4 +1,6 @@
1
1
  module EtherpadLite
2
- # The library version
3
- VERSION = '0.2.3'
2
+ # Library version
3
+ VERSION = '0.3.0'
4
+ # API target version
5
+ API_VERSION = '1.2.8'
4
6
  end
metadata CHANGED
@@ -1,30 +1,27 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: etherpad-lite
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
5
- prerelease:
4
+ version: 0.3.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Jordan Hollinger
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-04-11 00:00:00.000000000 Z
11
+ date: 2013-09-27 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: rest-client
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - '>='
20
18
  - !ruby/object:Gem::Version
21
19
  version: '1.6'
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - '>='
28
25
  - !ruby/object:Gem::Version
29
26
  version: '1.6'
30
27
  description: etherpad-lite is a Ruby interface to Etherpad Lite's HTTP JSON API
@@ -34,42 +31,42 @@ extensions: []
34
31
  extra_rdoc_files:
35
32
  - README.rdoc
36
33
  files:
37
- - lib/etherpad-lite/models/author.rb
38
- - lib/etherpad-lite/models/session.rb
34
+ - lib/etherpad-lite/client.rb
35
+ - lib/etherpad-lite/version.rb
39
36
  - lib/etherpad-lite/models/group.rb
40
- - lib/etherpad-lite/models/pad.rb
41
37
  - lib/etherpad-lite/models/chat_message.rb
42
- - lib/etherpad-lite/models/instance.rb
43
38
  - lib/etherpad-lite/models/padded.rb
39
+ - lib/etherpad-lite/models/pad.rb
40
+ - lib/etherpad-lite/models/diff.rb
41
+ - lib/etherpad-lite/models/author.rb
42
+ - lib/etherpad-lite/models/instance.rb
43
+ - lib/etherpad-lite/models/session.rb
44
44
  - lib/etherpad-lite/models.rb
45
- - lib/etherpad-lite/client.rb
46
- - lib/etherpad-lite/version.rb
47
45
  - lib/etherpad-lite.rb
48
46
  - README.rdoc
49
47
  - CHANGELOG
50
48
  - LICENSE
51
49
  homepage: http://github.com/jhollinger/ruby-etherpad-lite
52
50
  licenses: []
51
+ metadata: {}
53
52
  post_install_message:
54
53
  rdoc_options: []
55
54
  require_paths:
56
55
  - lib
57
56
  required_ruby_version: !ruby/object:Gem::Requirement
58
- none: false
59
57
  requirements:
60
- - - ! '>='
58
+ - - '>='
61
59
  - !ruby/object:Gem::Version
62
60
  version: '0'
63
61
  required_rubygems_version: !ruby/object:Gem::Requirement
64
- none: false
65
62
  requirements:
66
- - - ! '>='
63
+ - - '>='
67
64
  - !ruby/object:Gem::Version
68
65
  version: '0'
69
66
  requirements: []
70
67
  rubyforge_project:
71
- rubygems_version: 1.8.23
68
+ rubygems_version: 2.0.3
72
69
  signing_key:
73
- specification_version: 3
70
+ specification_version: 4
74
71
  summary: A Ruby client library for Etherpad Lite
75
72
  test_files: []