pubnub 3.5.14 → 3.6.7

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of pubnub might be problematic. Click here for more details.

Files changed (108) hide show
  1. checksums.yaml +4 -4
  2. data/3.5_to_3.6_upgrade_notes.md +148 -0
  3. data/{CHANGELOG → CHANGELOG.txt} +15 -0
  4. data/Gemfile.lock +5 -4
  5. data/LICENSE.txt +28 -0
  6. data/README.md +164 -19
  7. data/Rakefile +1 -6
  8. data/examples/demo_console.rb +370 -329
  9. data/fixtures/vcr_cassettes/grant-multiple-channels-presence-multi-1.yml +44 -0
  10. data/fixtures/vcr_cassettes/grant-multiple-channels-presence-multi-2.yml +44 -0
  11. data/fixtures/vcr_cassettes/grant-multiple-channels-presence-multi-3.yml +44 -0
  12. data/fixtures/vcr_cassettes/grant-multiple-channels-presence-multi-4.yml +44 -0
  13. data/fixtures/vcr_cassettes/grant-multiple-channels-presence.yml +44 -0
  14. data/fixtures/vcr_cassettes/heartbeated-subscribe.yml +1 -1
  15. data/fixtures/vcr_cassettes/here_now-nonssl-block-valid-200-async.yml +1 -1
  16. data/fixtures/vcr_cassettes/here_now-nonssl-block-valid-200-sync.yml +1 -1
  17. data/fixtures/vcr_cassettes/here_now-nonssl-block-valid-non-200-async.yml +1 -1
  18. data/fixtures/vcr_cassettes/here_now-nonssl-block-valid-non-200-sync.yml +1 -1
  19. data/fixtures/vcr_cassettes/here_now-nonssl-parameter-valid-200-async.yml +1 -1
  20. data/fixtures/vcr_cassettes/here_now-nonssl-parameter-valid-200-sync.yml +1 -1
  21. data/fixtures/vcr_cassettes/here_now-nonssl-parameter-valid-non-200-async.yml +1 -1
  22. data/fixtures/vcr_cassettes/here_now-nonssl-parameter-valid-non-200-sync.yml +1 -1
  23. data/fixtures/vcr_cassettes/here_now-ssl-block-valid-200-async.yml +1 -1
  24. data/fixtures/vcr_cassettes/here_now-ssl-block-valid-200-sync.yml +1 -1
  25. data/fixtures/vcr_cassettes/here_now-ssl-block-valid-non-200-async.yml +1 -1
  26. data/fixtures/vcr_cassettes/here_now-ssl-block-valid-non-200-sync.yml +1 -1
  27. data/fixtures/vcr_cassettes/here_now-ssl-parameter-valid-200-async.yml +1 -1
  28. data/fixtures/vcr_cassettes/here_now-ssl-parameter-valid-200-sync.yml +1 -1
  29. data/fixtures/vcr_cassettes/here_now-ssl-parameter-valid-non-200-async.yml +1 -1
  30. data/fixtures/vcr_cassettes/here_now-ssl-parameter-valid-non-200-sync.yml +1 -1
  31. data/fixtures/vcr_cassettes/leave-nonssl-block-valid-200-async.yml +1 -1
  32. data/fixtures/vcr_cassettes/leave-nonssl-block-valid-200-sync.yml +1 -1
  33. data/fixtures/vcr_cassettes/leave-nonssl-block-valid-non-200-async.yml +1 -1
  34. data/fixtures/vcr_cassettes/leave-nonssl-block-valid-non-200-sync.yml +1 -1
  35. data/fixtures/vcr_cassettes/leave-nonssl-parameter-valid-200-async.yml +1 -1
  36. data/fixtures/vcr_cassettes/leave-nonssl-parameter-valid-200-sync.yml +1 -1
  37. data/fixtures/vcr_cassettes/leave-nonssl-parameter-valid-non-200-async.yml +1 -1
  38. data/fixtures/vcr_cassettes/leave-nonssl-parameter-valid-non-200-sync.yml +1 -1
  39. data/fixtures/vcr_cassettes/leave-ssl-block-valid-200-async.yml +1 -1
  40. data/fixtures/vcr_cassettes/leave-ssl-block-valid-200-sync.yml +1 -1
  41. data/fixtures/vcr_cassettes/leave-ssl-block-valid-non-200-async.yml +1 -1
  42. data/fixtures/vcr_cassettes/leave-ssl-block-valid-non-200-sync.yml +1 -1
  43. data/fixtures/vcr_cassettes/leave-ssl-parameter-valid-200-async.yml +1 -1
  44. data/fixtures/vcr_cassettes/leave-ssl-parameter-valid-200-sync.yml +1 -1
  45. data/fixtures/vcr_cassettes/leave-ssl-parameter-valid-non-200-async.yml +1 -1
  46. data/fixtures/vcr_cassettes/leave-ssl-parameter-valid-non-200-sync.yml +1 -1
  47. data/fixtures/vcr_cassettes/state-async-set-state-via-subbedclient-2.yml +140 -0
  48. data/fixtures/vcr_cassettes/state-async-set-state-via-subbedclient.yml +131 -0
  49. data/fixtures/vcr_cassettes/state-async-set-state-via-subscribe.yml +90 -0
  50. data/fixtures/vcr_cassettes/state-set-state-via-client-2.yml +140 -0
  51. data/fixtures/vcr_cassettes/state-set-state-via-client.yml +90 -0
  52. data/fixtures/vcr_cassettes/state-set-state-via-subscribe.yml +90 -0
  53. data/fixtures/vcr_cassettes/where_now-ssl-block-invalid-200-async.yml +49 -0
  54. data/fixtures/vcr_cassettes/where_now-ssl-block-invalid-200-sync.yml +49 -0
  55. data/fixtures/vcr_cassettes/where_now-ssl-block-invalid-non-200-async.yml +49 -0
  56. data/fixtures/vcr_cassettes/where_now-ssl-block-invalid-non-200-sync.yml +49 -0
  57. data/fixtures/vcr_cassettes/where_now-ssl-block-valid-200-async.yml +49 -0
  58. data/fixtures/vcr_cassettes/where_now-ssl-block-valid-200-sync.yml +49 -0
  59. data/fixtures/vcr_cassettes/where_now-ssl-block-valid-non-200-async.yml +49 -0
  60. data/fixtures/vcr_cassettes/where_now-ssl-block-valid-non-200-sync.yml +49 -0
  61. data/fixtures/vcr_cassettes/where_now-ssl-parameter-invalid-200-async.yml +49 -0
  62. data/fixtures/vcr_cassettes/where_now-ssl-parameter-invalid-200-sync.yml +49 -0
  63. data/fixtures/vcr_cassettes/where_now-ssl-parameter-invalid-non-200-async.yml +49 -0
  64. data/fixtures/vcr_cassettes/where_now-ssl-parameter-invalid-non-200-sync.yml +49 -0
  65. data/fixtures/vcr_cassettes/where_now-ssl-parameter-valid-200-async.yml +49 -0
  66. data/fixtures/vcr_cassettes/where_now-ssl-parameter-valid-200-sync.yml +49 -0
  67. data/fixtures/vcr_cassettes/where_now-ssl-parameter-valid-non-200-async.yml +49 -0
  68. data/fixtures/vcr_cassettes/where_now-ssl-parameter-valid-non-200-sync.yml +49 -0
  69. data/lib/pubnub.rb +1 -2
  70. data/lib/pubnub/client.rb +97 -21
  71. data/lib/pubnub/configuration.rb +1 -1
  72. data/lib/pubnub/envelope.rb +3 -2
  73. data/lib/pubnub/event.rb +9 -5
  74. data/lib/pubnub/events/audit.rb +1 -1
  75. data/lib/pubnub/events/grant.rb +1 -1
  76. data/lib/pubnub/events/heartbeat.rb +7 -3
  77. data/lib/pubnub/events/here_now.rb +7 -4
  78. data/lib/pubnub/events/history.rb +1 -1
  79. data/lib/pubnub/events/leave.rb +10 -4
  80. data/lib/pubnub/events/presence.rb +1 -1
  81. data/lib/pubnub/events/publish.rb +6 -2
  82. data/lib/pubnub/events/revoke.rb +1 -1
  83. data/lib/pubnub/events/set_state.rb +77 -0
  84. data/lib/pubnub/events/state.rb +63 -0
  85. data/lib/pubnub/events/subscribe.rb +7 -0
  86. data/lib/pubnub/events/where_now.rb +55 -0
  87. data/lib/pubnub/pam.rb +10 -16
  88. data/lib/pubnub/version.rb +2 -2
  89. data/pubnub.gemspec +21 -19
  90. data/spec/lib/channel_presence_concat_pam_spec.rb +94 -0
  91. data/spec/lib/client_spec.rb +3 -4
  92. data/spec/lib/heartbeat_spec.rb +16 -16
  93. data/spec/lib/integration/global_here_now_dpc_spec.rb +10 -10
  94. data/spec/lib/integration/global_here_now_spec.rb +8 -8
  95. data/spec/lib/integration/here_now_dpc_spec.rb +24 -24
  96. data/spec/lib/integration/here_now_spec.rb +24 -24
  97. data/spec/lib/integration/leave_dpc_spec.rb +24 -25
  98. data/spec/lib/integration/leave_spec.rb +24 -24
  99. data/spec/lib/integration/publish_spec.rb +5 -0
  100. data/spec/lib/integration/state_spec.rb +84 -0
  101. data/spec/lib/integration/where_now_spec.rb +312 -0
  102. metadata +108 -26
  103. data/LICENSE +0 -27
  104. data/VERSION +0 -1
  105. data/examples/demo_console_new.rb +0 -286
  106. data/fixtures/vcr_cassettes/heartbeat-non200.yml +0 -667
  107. data/spec/tools/pam-test-generator.rb +0 -367
  108. data/spec/tools/test-generator.rb +0 -310
@@ -35,4 +35,4 @@ module Pubnub
35
35
  ].join('/')
36
36
  end
37
37
  end
38
- end
38
+ end
@@ -56,4 +56,4 @@ module Pubnub
56
56
  end
57
57
 
58
58
  end
59
- end
59
+ end
@@ -31,9 +31,13 @@ module Pubnub
31
31
  end
32
32
 
33
33
  def parameters(app)
34
- params = super(app)
35
- params.merge!({ :state => URI.encode_www_form_component({}) })
36
- params
34
+ parameters = super(app)
35
+ parameters.merge!({:state => encode_state(app.env[:state][@origin])}) if app.env[:state] && app.env[:state][@origin]
36
+ parameters
37
+ end
38
+
39
+ def encode_state(state)
40
+ URI.encode_www_form_component(state.to_json).gsub('+', '%20')
37
41
  end
38
42
 
39
43
  def format_envelopes(response, app, error)
@@ -49,9 +49,12 @@ module Pubnub
49
49
  envelopes = Array.new
50
50
  envelopes << Envelope.new(
51
51
  {
52
- :message => parsed_response,
53
- :channel => @channel,
54
- :response_message => parsed_response
52
+ :parsed_response => parsed_response,
53
+ :occupancy => (parsed_response['occupancy'] if parsed_response),
54
+ :service => (parsed_response['service'] if parsed_response),
55
+ :message => (parsed_response['message'] if parsed_response),
56
+ :uuid => (parsed_response['uuids'] if parsed_response),
57
+ :status => (parsed_response['status'] if parsed_response)
55
58
  },
56
59
  app
57
60
  )
@@ -61,4 +64,4 @@ module Pubnub
61
64
  envelopes
62
65
  end
63
66
  end
64
- end
67
+ end
@@ -107,4 +107,4 @@ module Pubnub
107
107
 
108
108
  end
109
109
  end
110
- end
110
+ end
@@ -41,7 +41,9 @@ module Pubnub
41
41
  @left = true
42
42
  end unless @skip_remove
43
43
  end
44
- super
44
+ envelopes = super
45
+ app.start_subscribe
46
+ envelopes
45
47
  end
46
48
 
47
49
  private
@@ -65,8 +67,12 @@ module Pubnub
65
67
  envelopes = Array.new
66
68
  envelopes << Envelope.new(
67
69
  {
68
- :message => parsed_response,
69
- :response_message => parsed_response
70
+ :parsed_response => parsed_response,
71
+ :action => (parsed_response['action'] if parsed_response),
72
+ :message => (parsed_response['message'] if parsed_response),
73
+ :uuid => (parsed_response['uuid'] if parsed_response),
74
+ :status => (parsed_response['status'] if parsed_response),
75
+ :service => (parsed_response['service'] if parsed_response)
70
76
  },
71
77
  app
72
78
  )
@@ -78,4 +84,4 @@ module Pubnub
78
84
  end
79
85
 
80
86
  end
81
- end
87
+ end
@@ -32,4 +32,4 @@ module Pubnub
32
32
 
33
33
 
34
34
  end
35
- end
35
+ end
@@ -12,7 +12,10 @@ module Pubnub
12
12
  @event = 'publish'
13
13
  @allow_multiple_channels = false
14
14
 
15
- raise ArgumentError.new(:object => self, :message => ':message argument is too big, encoded uri would excess 32k size limit') if uri(app).to_s.bytesize > 32000
15
+ $logger.info('Pubnub'){ "Bytesize: #{uri(app).to_s.bytesize}" }
16
+ $logger.info('Pubnub'){ "Lenght: #{uri(app).to_s.length}" }
17
+
18
+ # raise ArgumentError.new(:object => self, :message => ':message argument is too big, encoded uri would excess 32k size limit') if uri(app).to_s.bytesize > 32000
16
19
  end
17
20
 
18
21
  def validate!
@@ -54,6 +57,7 @@ module Pubnub
54
57
  envelopes = Array.new
55
58
  envelopes << Envelope.new(
56
59
  {
60
+ :parsed_response => parsed_response,
57
61
  :message => @message,
58
62
  :published_message => @message,
59
63
  :channel => @channel,
@@ -69,4 +73,4 @@ module Pubnub
69
73
 
70
74
  end
71
75
  end
72
- end
76
+ end
@@ -53,4 +53,4 @@ module Pubnub
53
53
  end
54
54
 
55
55
  end
56
- end
56
+ end
@@ -0,0 +1,77 @@
1
+ module Pubnub
2
+ class SetState
3
+ include Pubnub::Event
4
+ include Pubnub::SingleEvent
5
+ include Pubnub::Formatter
6
+ include Pubnub::Validator
7
+
8
+ def initialize(options, app)
9
+ super
10
+ @state = options[:state]
11
+
12
+ app.env[:state] = Hash.new if app.env[:state].nil?
13
+ app.env[:state][@origin] = Hash.new if app.env[:state][@origin].nil?
14
+ @channel.each do |channel|
15
+ app.env[:state][@origin][channel.to_s] = @state
16
+ end
17
+
18
+ @allow_multiple_channels = true
19
+ @event = 'set_state'
20
+ end
21
+
22
+ def validate!
23
+ super
24
+ # check state
25
+ raise 'You can set state only as hash' unless (@state.is_a?(Hash) || @state.is_a?(NilClass))
26
+
27
+ # check channel/channels
28
+ raise ArgumentError.new(:object => self, :message => 'SetState requires :channel or :channels argument') unless @channel
29
+ raise ArgumentError.new(:object => self, :message => 'Invalid channel(s) format! Should be type of: String, Symbol, or Array of both') unless valid_channel?
30
+ end
31
+
32
+ private
33
+
34
+ def parameters(app)
35
+ parameters = super(app)
36
+ parameters.merge!({:state => encode_state(@state)})
37
+ parameters
38
+ end
39
+
40
+ def path(app)
41
+ '/' + [
42
+ 'v2',
43
+ 'presence',
44
+ 'sub-key',
45
+ @subscribe_key,
46
+ 'channel',
47
+ @channel,
48
+ 'uuid',
49
+ app.env[:uuid],
50
+ 'data'
51
+ ].join('/')
52
+ end
53
+
54
+ def format_envelopes(response, app, error)
55
+
56
+ parsed_response = Parser.parse_json(response.body) if Parser.valid_json?(response.body)
57
+
58
+ envelopes = Array.new
59
+ envelopes << Envelope.new({
60
+ :parsed_response => parsed_response,
61
+ :payload => (parsed_response['payload'] if parsed_response),
62
+ :service => (parsed_response['service'] if parsed_response),
63
+ :message => (parsed_response['message'] if parsed_response),
64
+ :status => (parsed_response['status'] if parsed_response)
65
+ }, app)
66
+
67
+ envelopes = add_common_data_to_envelopes(envelopes, response, app, error)
68
+
69
+ envelopes
70
+
71
+ end
72
+
73
+ def encode_state(state)
74
+ URI.encode_www_form_component(state.to_json).gsub('+', '%20')
75
+ end
76
+ end
77
+ end
@@ -0,0 +1,63 @@
1
+ module Pubnub
2
+ class State
3
+ include Pubnub::Event
4
+ include Pubnub::SingleEvent
5
+ include Pubnub::Formatter
6
+ include Pubnub::Validator
7
+
8
+ def initialize(options, app)
9
+ super
10
+
11
+ @uuid_looking_for = options[:uuid]
12
+ @uuid = app.uuid
13
+ end
14
+
15
+ def validate!
16
+ super
17
+
18
+ # check channel/channels
19
+ raise ArgumentError.new(:object => self, :message => 'State requires :channel argument') unless @channel
20
+ raise ArgumentError.new(:object => self, :message => 'Invalid channel format! Should be type of: String or Symbol') unless @channel.is_a?(String) or @channel.is_a?(Symbol)
21
+ end
22
+
23
+ private
24
+
25
+ def path(app)
26
+ '/' + [
27
+ 'v2',
28
+ 'presence',
29
+ 'sub_key',
30
+ @subscribe_key,
31
+ 'channel',
32
+ @channel,
33
+ 'uuid',
34
+ @uuid_looking_for
35
+ ].join('/')
36
+ end
37
+
38
+ def format_envelopes(response, app, error)
39
+
40
+ parsed_response = Parser.parse_json(response.body) if Parser.valid_json?(response.body)
41
+
42
+ envelopes = Array.new
43
+ envelopes << Envelope.new(
44
+ {
45
+ :parsed_response => parsed_response,
46
+ :channel => (parsed_response['channel'] if parsed_response),
47
+ :payload => (parsed_response['payload'] if parsed_response),
48
+ :service => (parsed_response['service'] if parsed_response),
49
+ :message => (parsed_response['message'] if parsed_response),
50
+ :uuid => (parsed_response['uuid'] if parsed_response),
51
+ :status => (parsed_response['status'] if parsed_response),
52
+ :status => (parsed_response['channel'] if parsed_response)
53
+ },
54
+ app
55
+ )
56
+
57
+ envelopes = add_common_data_to_envelopes(envelopes, response, app, error)
58
+
59
+ envelopes
60
+
61
+ end
62
+ end
63
+ end
@@ -10,11 +10,13 @@ module Pubnub
10
10
  super
11
11
  @event = 'subscribe'
12
12
  @allow_multiple_channels = true
13
+ @state = options[:state]
13
14
 
14
15
  end
15
16
 
16
17
  def fire(app)
17
18
  app.update_timetoken(0)
19
+ add_state(@state, app) if @state
18
20
  super
19
21
  end
20
22
 
@@ -30,5 +32,10 @@ module Pubnub
30
32
 
31
33
  private
32
34
 
35
+ def add_state(state, app)
36
+ app.env[:state] = {} unless app.env[:state]
37
+ app.env[:state][@origin] = {} unless app.env[:state][@origin]
38
+ app.env[:state][@origin][@channel] = state
39
+ end
33
40
  end
34
41
  end
@@ -0,0 +1,55 @@
1
+ module Pubnub
2
+ class WhereNow
3
+ include Pubnub::Event
4
+ include Pubnub::SingleEvent
5
+ include Pubnub::Formatter
6
+ include Pubnub::Validator
7
+
8
+ def initialize(options, app)
9
+ @uuid_looking_for = options[:uuid]
10
+ @uuid = app.uuid
11
+ @event = 'where_now'
12
+ super
13
+ end
14
+
15
+ def validate!
16
+ super
17
+
18
+ # check uuid
19
+ raise ArgumentError.new(:object => self, :message => 'where_now requires :uuid argument') unless @uuid_looking_for
20
+ end
21
+
22
+ private
23
+
24
+ def path(app)
25
+ '/' + [
26
+ 'v2',
27
+ 'presence',
28
+ 'sub-key',
29
+ @subscribe_key,
30
+ 'uuid',
31
+ @uuid_looking_for
32
+ ].join('/')
33
+ end
34
+
35
+ def format_envelopes(response, app, error)
36
+ parsed_response = Parser.parse_json(response.body) if Parser.valid_json?(response.body)
37
+
38
+ envelopes = Array.new
39
+ envelopes << Envelope.new(
40
+ {
41
+ :parsed_response => parsed_response,
42
+ :payload => (parsed_response['payload'] if parsed_response),
43
+ :service => (parsed_response['service'] if parsed_response),
44
+ :message => (parsed_response['message'] if parsed_response),
45
+ :status => (parsed_response['status'] if parsed_response)
46
+ },
47
+ app
48
+ )
49
+
50
+ envelopes = add_common_data_to_envelopes(envelopes, response, app, error)
51
+
52
+ envelopes
53
+ end
54
+ end
55
+ end
data/lib/pubnub/pam.rb CHANGED
@@ -2,6 +2,9 @@ module Pubnub
2
2
  module PAM
3
3
  def initialize(options, app)
4
4
  super
5
+ if options[:presence].present?
6
+ @channel += format_channels(options[:presence]).map { |c| c + '-pnpres' }
7
+ end
5
8
  @auth_key = options[:auth_key]
6
9
  end
7
10
 
@@ -11,18 +14,6 @@ module Pubnub
11
14
  Base64.urlsafe_encode64(OpenSSL::HMAC.digest(OpenSSL::Digest::Digest.new('sha256'), @secret_key.to_s, message)).strip
12
15
  end
13
16
 
14
- def payload(parsed_response)
15
- parsed_response['payload'] if parsed_response
16
- end
17
-
18
- def message(parsed_response)
19
- parsed_response['message'] if parsed_response
20
- end
21
-
22
- def channel(_parsed_response)
23
- @channel.first
24
- end
25
-
26
17
  def parameters(app, signature = false)
27
18
  params = super(app)
28
19
  params.merge!({ :timestamp => @timestamp })
@@ -48,9 +39,12 @@ module Pubnub
48
39
  envelopes = Array.new
49
40
  envelopes << Envelope.new(
50
41
  {
51
- :payload => payload(parsed_response),
52
- :message => message(parsed_response),
53
- :channel => channel(parsed_response)
42
+ :parsed_response => parsed_response,
43
+ :payload => (parsed_response['payload'] if parsed_response),
44
+ :message => (parsed_response['message'] if parsed_response),
45
+ :channel => (parsed_response['channel'] if parsed_response),
46
+ :service => (parsed_response['service'] if parsed_response),
47
+ :status => (parsed_response['status'] if parsed_response)
54
48
  },
55
49
  app
56
50
  )
@@ -61,4 +55,4 @@ module Pubnub
61
55
 
62
56
  end
63
57
  end
64
- end
58
+ end
@@ -1,3 +1,3 @@
1
1
  module Pubnub
2
- VERSION = '3.5.14'
3
- end
2
+ VERSION = '3.6.7'
3
+ end
data/pubnub.gemspec CHANGED
@@ -1,23 +1,25 @@
1
- # -*- encoding: utf-8 -*-
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'pubnub/version'
2
5
 
3
- Gem::Specification.new do |s|
4
- s.name = 'pubnub'
5
- s.version = '3.5.14'
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'pubnub'
8
+ spec.version = Pubnub::VERSION
9
+ spec.authors = ['PubNub']
10
+ spec.email = ['support@pubnub.com']
11
+ spec.summary = %q{PubNub Official Ruby gem.}
12
+ spec.description = %q{Ruby anywhere in the world in 250ms with PubNub!}
13
+ spec.homepage = 'http://github.com/pubnub/ruby'
14
+ spec.license = 'MIT'
6
15
 
7
- s.required_rubygems_version = Gem::Requirement.new('>= 0') if s.respond_to? :required_rubygems_version=
8
- s.authors = ['PubNub']
9
- s.date = '2014-10-14'
10
- s.description = 'Ruby anywhere in the world in 250ms with PubNub!'
11
- s.email = 'support@pubnub.com'
12
- s.files = `git ls-files`.split("\n")
13
- s.homepage = 'http://github.com/pubnub/ruby'
14
- s.licenses = ['MIT']
15
- s.require_paths = ['lib']
16
- s.rubygems_version = '1.7.2'
17
- s.summary = 'PubNub Official Ruby gem'
18
-
19
- s.add_dependency 'eventmachine'
20
- s.add_dependency 'net-http-persistent'
21
- s.add_dependency 'json'
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ['lib']
22
20
 
21
+ spec.add_dependency 'eventmachine', '~> 1.0'
22
+ spec.add_dependency 'json', '~> 1.8'
23
+ spec.add_dependency 'net-http-persistent', '~> 2.9'
24
+ spec.add_development_dependency 'bundler', '~> 1.6'
23
25
  end