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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fd19ca5b07bdb3a6002473d0f18e5b074db1ca86
4
- data.tar.gz: 81a8a25f1cb0fadfeb701a2ef5f4dd29e760af56
3
+ metadata.gz: 7aabe33dbc42a7c94055e637aac2306c21b1f6a4
4
+ data.tar.gz: 19f0caac9cf3de78160ed830a262b8f345944329
5
5
  SHA512:
6
- metadata.gz: 01f12e7b45bd306156213b7b3cc8a8d38914418821368690b16b7c1826469487447bae8f37412114a8f2d34eabcbb4f45820c308aa17a1df82b376c009604cb1
7
- data.tar.gz: 78fd3eff81637c3152f92f39d065109a8d4ba996c7ec95f5126eb0cf0f50d6d04ed2614556db601ef5d677128d5a189d2a427e8e9e1b667b4f92ad74fe5c6690
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
@@ -1,3 +1,3 @@
1
1
  module Transistor
2
- Version = '0.0.1'
2
+ Version = '0.0.2'
3
3
  end
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.1
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-09 00:00:00.000000000 Z
11
+ date: 2014-01-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler