pili 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +57 -33
  3. data/lib/pili/version.rb +1 -1
  4. data/lib/pili.rb +1 -1
  5. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1493919dcc89f8b6bb9168d6a1c9d85705274015
4
- data.tar.gz: d438490de6ce1e2bdb4943633c7d360bf3e7e037
3
+ metadata.gz: bdaa7674765c108d9c5188d267b4bc6c52a6ed82
4
+ data.tar.gz: fed41e06d022b17ac10951ec91a9ff293d3b2d66
5
5
  SHA512:
6
- metadata.gz: 5a0be7f785b1b5250557cd773008bb2612fc041fdb4bd7a5cb96ca0dc24d9a96abb2c7f8bb883b3dcb984361297c6a0226ccad980149cbe106f2d2078b4d6d56
7
- data.tar.gz: 8fc2c7a27ed24045fbcf499ec20b2dd826f5e7403bbe09132a379f614c61cea9414fd4982c700badf64819a4ec9c248b01b49974806e20311ba7773ab2017d55
6
+ metadata.gz: afaf9fe81e1fe2670820ca592b6ff7a917b972b7a1d7abda20cc58a7b810cb5389ea43709984217c589010a41740f4ca634b100c95762fc01f4417118a9c56d6
7
+ data.tar.gz: dfea20eb80debda99461065a384f983aa8f5db98df1999200fe8fe6017b3a3c14b76be3e47dbfc36630e2cab605fa99e47740152c06ddf5169ee308c68caa3f2
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # pili-ruby
2
2
  =========
3
3
 
4
- pili-io Ruby SDK
4
+ Pili SDK for Ruby.
5
5
 
6
6
  ## Installation
7
7
 
@@ -21,10 +21,13 @@ Or install it yourself as:
21
21
 
22
22
  ### Initialize
23
23
 
24
- require 'pili'
24
+ ```ruby
25
+ require 'pili'
26
+
27
+ Pili.setup! access_key: '<YOUR_APP_ACCESS_KEY>',
28
+ secret_key: '<YOUR_APP_SECRET_KEY>'
29
+ ```
25
30
 
26
- Pili.setup! access_key: '<YOUR_APP_ACCESS_KEY>',
27
- secret_key: '<YOUR_APP_SECRET_KEY>'
28
31
  #### with rails:
29
32
 
30
33
  You'll need to configure it in config/initializes/pili.rb
@@ -32,62 +35,83 @@ You'll need to configure it in config/initializes/pili.rb
32
35
 
33
36
  ### Create Stream
34
37
 
35
- Pili.create_stream(hub_name)
36
-
37
- # with options
38
- stream_options = {
39
- title: "test_name", # optional, default is auto-generated
40
- publish_key: "test_key", # optional, a secret key for signing the <publishToken>
41
- publish_security: "dynamic" # optional, can be "dynamic" or "static", default is "dynamic"
42
- }
38
+ ```ruby
39
+ Pili.create_stream(hub_name)
40
+
41
+ stream_options = {
42
+ title: "test_name", # optional, default is auto-generated
43
+ publish_key: "test_key", # optional, a secret key for signing the <publishToken>
44
+ publish_security: "dynamic" # optional, can be "dynamic" or "static", default is "dynamic"
45
+ }
43
46
 
44
- Pili.create_stream(hub_name, stream_options)
47
+ Pili.create_stream(hub_name, stream_options) # with options
48
+ ```
45
49
 
46
50
  ### Get Stream
47
51
 
48
- Pili.create_stream(stream_id)
52
+ ```ruby
53
+ Pili.get_stream(stream_id)
54
+ ```
49
55
 
50
56
  ### Update Stream
51
57
 
52
- Pili.update_stream(stream_id, publish_key: publish_key, publish_security: publish_security)
58
+ ```ruby
59
+ Pili.update_stream(stream_id, publish_key: publish_key, publish_security: publish_security)
60
+ ```
53
61
 
54
62
  ### Get Stream List
55
63
 
56
- Pili.stream_list(hub)
57
-
58
- # marker, limit: integer, optional
59
- Pili.stream_list(hub, marker: marker, limit: limit)
64
+ ```ruby
65
+ Pili.stream_list(hub)
66
+
67
+ Pili.stream_list(hub, marker: marker, limit: limit) # marker, limit: integer, optional
68
+ ```
60
69
 
61
70
  ### Delete Stream
62
71
 
63
- Pili.delete_stream(stream_id)
72
+ ```ruby
73
+ Pili.delete_stream(stream_id)
74
+ ```
64
75
 
65
76
  ### Get Stream Segments
66
- Pili.get_stream_segments(stream_id)
67
-
68
- # start, end: integer, optional
69
- Pili.get_stream_segments(stream_id, start: timestamp, end: timestamp)
77
+
78
+ ```ruby
79
+ Pili.get_stream_segments(stream_id)
80
+ ```
81
+
82
+ ```ruby
83
+ # start, end: integer, optional
84
+ Pili.get_stream_segments(stream_id, start: timestamp, end: timestamp)
85
+ ```
70
86
 
71
87
  ### Get Stream Publish URL
72
88
 
73
- Pili.get_stream_publish_url(stream_id, publish_key, publish_security)
74
- Pili.get_stream_publish_url(stream_id, publish_key, publish_security, timestamp)
89
+ ```ruby
90
+ Pili.get_stream_publish_url(stream_id, publish_key, publish_security)
91
+ Pili.get_stream_publish_url(stream_id, publish_key, publish_security, timestamp)
92
+ ```
75
93
 
76
94
  ### Get Stream RTMP Live URL
77
95
 
78
- Pili.get_stream_rtmp_live_url(stream_id)
79
- Pili.get_stream_rtmp_live_url(stream_id, preset)
96
+ ```ruby
97
+ Pili.get_stream_rtmp_live_url(stream_id)
98
+ Pili.get_stream_rtmp_live_url(stream_id, preset)
99
+ ```
80
100
 
81
101
  ### Get Stream HLS Live URL
82
102
 
83
- Pili.get_stream_hls_live_url(stream_id)
84
- Pili.get_stream_hls_live_url(stream_id, preset)
103
+ ```ruby
104
+ Pili.get_stream_hls_live_url(stream_id)
105
+ Pili.get_stream_hls_live_url(stream_id, preset)
106
+ ```
85
107
 
86
108
  ### Get Stream HLS Playback URL
87
109
 
88
- Pili.get_stream_hls_playback_url(stream_id, start_second, end_second)
89
- Pili.get_stream_hls_playback_url(stream_id, start_second, end_second, preset)
90
-
110
+ ```ruby
111
+ Pili.get_stream_hls_playback_url(stream_id, start_second, end_second)
112
+ Pili.get_stream_hls_playback_url(stream_id, start_second, end_second, preset)
113
+ ```
114
+
91
115
 
92
116
  ## Contributing
93
117
 
data/lib/pili/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Pili
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
data/lib/pili.rb CHANGED
@@ -19,7 +19,7 @@ module Pili
19
19
  def stream_list(hub, options = {})
20
20
  url = Config.api_base_url + "/streams?hub=#{hub}"
21
21
 
22
- url += "&marker=#{options[:marker]}" if options[:marker].is_a?(Fixnum)
22
+ url += "&marker=#{options[:marker]}" unless Utils.blank?(options[:marker])
23
23
  url += "&limit=#{options[:limit]}" if options[:limit].is_a?(Fixnum)
24
24
 
25
25
  response = HTTP.api_get(url)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pili
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miclle
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-28 00:00:00.000000000 Z
11
+ date: 2015-04-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler