transistor-client 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/transistor.rb +17 -0
- data/lib/transistor/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7aabe33dbc42a7c94055e637aac2306c21b1f6a4
|
4
|
+
data.tar.gz: 19f0caac9cf3de78160ed830a262b8f345944329
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 375e387cc76a8a324cca15abf507d8f8d59b707b262570f8b401e09f3a25a0f67eeec4ee0e5cc3c7d7b97142792e81ec1ae78aad6e1ac174da143d6ed6520885
|
7
|
+
data.tar.gz: c5e17673e8925633762f5bd5af62956a10473319832e7b606e9002df774aaf1f1227b7f49f325b6de7a2a435ae152d8237ce4cb6f547cc9c4eae4b4ecb975842
|
data/lib/transistor.rb
CHANGED
@@ -12,6 +12,7 @@ module Transistor
|
|
12
12
|
def initialize
|
13
13
|
@host = 'api.transistor.fm'
|
14
14
|
@secure = true
|
15
|
+
@tracking_url = 'track.transistor.fm/:entry_id.:format/:url'
|
15
16
|
end
|
16
17
|
|
17
18
|
def base_url
|
@@ -33,6 +34,22 @@ module Transistor
|
|
33
34
|
def user_agent
|
34
35
|
"Transistor Ruby Client, Version #{Transistor::Version}"
|
35
36
|
end
|
37
|
+
|
38
|
+
def protocol
|
39
|
+
if self.secure
|
40
|
+
'https'
|
41
|
+
else
|
42
|
+
'http'
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
def tracking_url(entry_id, format, url)
|
47
|
+
full_url = @tracking_url
|
48
|
+
.gsub(':entry_id', entry_id.to_s)
|
49
|
+
.gsub(':format', format.to_s)
|
50
|
+
.gsub(':url', url)
|
51
|
+
[self.protocol, '://', full_url].join()
|
52
|
+
end
|
36
53
|
end
|
37
54
|
|
38
55
|
def self.setup
|
data/lib/transistor/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: transistor-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nicholas Young
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-01-
|
11
|
+
date: 2014-01-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|