radiospieler 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.1
1
+ 0.3.2
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "radiospieler"
8
- s.version = "0.3.1"
8
+ s.version = "0.3.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["radiospiel"]
@@ -36,7 +36,6 @@ Gem::Specification.new do |s|
36
36
  "lib/core-extensions/tls.rb",
37
37
  "lib/core-extensions/uids.rb",
38
38
  "lib/core-extensions/uri_ext.rb",
39
- "lib/extensions/bitly.rb",
40
39
  "lib/extensions/http.rb",
41
40
  "lib/radiospieler.rb",
42
41
  "lib/radiospieler/radiospieler.rb",
@@ -48,13 +47,10 @@ Gem::Specification.new do |s|
48
47
  "script/watchr",
49
48
  "test/app_test.rb",
50
49
  "test/array_ext_test.rb",
51
- "test/bitlify_test.rb",
52
50
  "test/cache_test.rb",
53
51
  "test/cgi_ext_test.rb",
54
52
  "test/config.yml",
55
53
  "test/config_test.rb",
56
- "test/fixtures-vcr/bitly_limit_exceeded.yml",
57
- "test/fixtures-vcr/bitly_ok.yml",
58
54
  "test/fixtures-vcr/http_test.yml",
59
55
  "test/hash_ext_test.rb",
60
56
  "test/http_test.rb",
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: radiospieler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-04-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: pg
16
- requirement: &70359227563120 !ruby/object:Gem::Requirement
16
+ requirement: &70327946287000 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70359227563120
24
+ version_requirements: *70327946287000
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: sqlite3
27
- requirement: &70359227562000 !ruby/object:Gem::Requirement
27
+ requirement: &70327946286280 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70359227562000
35
+ version_requirements: *70327946286280
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: redis
38
- requirement: &70359227560880 !ruby/object:Gem::Requirement
38
+ requirement: &70327946285400 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *70359227560880
46
+ version_requirements: *70327946285400
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: micro_sql
49
- requirement: &70359227559640 !ruby/object:Gem::Requirement
49
+ requirement: &70327946281920 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *70359227559640
57
+ version_requirements: *70327946281920
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: simple_cache
60
- requirement: &70359227558760 !ruby/object:Gem::Requirement
60
+ requirement: &70327946281360 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: '0'
66
66
  type: :runtime
67
67
  prerelease: false
68
- version_requirements: *70359227558760
68
+ version_requirements: *70327946281360
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: htmlentities
71
- requirement: &70359227541000 !ruby/object:Gem::Requirement
71
+ requirement: &70327946280680 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: '0'
77
77
  type: :runtime
78
78
  prerelease: false
79
- version_requirements: *70359227541000
79
+ version_requirements: *70327946280680
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: bundler
82
- requirement: &70359227540160 !ruby/object:Gem::Requirement
82
+ requirement: &70327946279780 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ! '>='
@@ -87,10 +87,10 @@ dependencies:
87
87
  version: '0'
88
88
  type: :development
89
89
  prerelease: false
90
- version_requirements: *70359227540160
90
+ version_requirements: *70327946279780
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: jeweler
93
- requirement: &70359227539520 !ruby/object:Gem::Requirement
93
+ requirement: &70327946278700 !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
96
96
  - - ! '>='
@@ -98,10 +98,10 @@ dependencies:
98
98
  version: '0'
99
99
  type: :development
100
100
  prerelease: false
101
- version_requirements: *70359227539520
101
+ version_requirements: *70327946278700
102
102
  - !ruby/object:Gem::Dependency
103
103
  name: vcr
104
- requirement: &70359227538720 !ruby/object:Gem::Requirement
104
+ requirement: &70327946277760 !ruby/object:Gem::Requirement
105
105
  none: false
106
106
  requirements:
107
107
  - - ! '>='
@@ -109,10 +109,10 @@ dependencies:
109
109
  version: '0'
110
110
  type: :development
111
111
  prerelease: false
112
- version_requirements: *70359227538720
112
+ version_requirements: *70327946277760
113
113
  - !ruby/object:Gem::Dependency
114
114
  name: webmock
115
- requirement: &70359227537260 !ruby/object:Gem::Requirement
115
+ requirement: &70327946276400 !ruby/object:Gem::Requirement
116
116
  none: false
117
117
  requirements:
118
118
  - - ! '>='
@@ -120,10 +120,10 @@ dependencies:
120
120
  version: '0'
121
121
  type: :development
122
122
  prerelease: false
123
- version_requirements: *70359227537260
123
+ version_requirements: *70327946276400
124
124
  - !ruby/object:Gem::Dependency
125
125
  name: psych
126
- requirement: &70359227535340 !ruby/object:Gem::Requirement
126
+ requirement: &70327946274760 !ruby/object:Gem::Requirement
127
127
  none: false
128
128
  requirements:
129
129
  - - ! '>='
@@ -131,10 +131,10 @@ dependencies:
131
131
  version: '0'
132
132
  type: :development
133
133
  prerelease: false
134
- version_requirements: *70359227535340
134
+ version_requirements: *70327946274760
135
135
  - !ruby/object:Gem::Dependency
136
136
  name: simplecov
137
- requirement: &70359227534760 !ruby/object:Gem::Requirement
137
+ requirement: &70327946273540 !ruby/object:Gem::Requirement
138
138
  none: false
139
139
  requirements:
140
140
  - - ! '>='
@@ -142,10 +142,10 @@ dependencies:
142
142
  version: '0'
143
143
  type: :development
144
144
  prerelease: false
145
- version_requirements: *70359227534760
145
+ version_requirements: *70327946273540
146
146
  - !ruby/object:Gem::Dependency
147
147
  name: ruby-debug19
148
- requirement: &70359227533920 !ruby/object:Gem::Requirement
148
+ requirement: &70327946272560 !ruby/object:Gem::Requirement
149
149
  none: false
150
150
  requirements:
151
151
  - - ! '>='
@@ -153,7 +153,7 @@ dependencies:
153
153
  version: '0'
154
154
  type: :development
155
155
  prerelease: false
156
- version_requirements: *70359227533920
156
+ version_requirements: *70327946272560
157
157
  description: Some basics that your application could benefit from.
158
158
  email: eno@open-lab.org
159
159
  executables: []
@@ -181,7 +181,6 @@ files:
181
181
  - lib/core-extensions/tls.rb
182
182
  - lib/core-extensions/uids.rb
183
183
  - lib/core-extensions/uri_ext.rb
184
- - lib/extensions/bitly.rb
185
184
  - lib/extensions/http.rb
186
185
  - lib/radiospieler.rb
187
186
  - lib/radiospieler/radiospieler.rb
@@ -193,13 +192,10 @@ files:
193
192
  - script/watchr
194
193
  - test/app_test.rb
195
194
  - test/array_ext_test.rb
196
- - test/bitlify_test.rb
197
195
  - test/cache_test.rb
198
196
  - test/cgi_ext_test.rb
199
197
  - test/config.yml
200
198
  - test/config_test.rb
201
- - test/fixtures-vcr/bitly_limit_exceeded.yml
202
- - test/fixtures-vcr/bitly_ok.yml
203
199
  - test/fixtures-vcr/http_test.yml
204
200
  - test/hash_ext_test.rb
205
201
  - test/http_test.rb
@@ -222,7 +218,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
222
218
  version: '0'
223
219
  segments:
224
220
  - 0
225
- hash: -3145811610061597683
221
+ hash: 1150779308148770786
226
222
  required_rubygems_version: !ruby/object:Gem::Requirement
227
223
  none: false
228
224
  requirements:
@@ -1,34 +0,0 @@
1
- require "cgi"
2
-
3
- module Bitly
4
- TIME_TO_LIVE = 365 * 24 * 3600
5
-
6
- def self.url_base
7
- return @url_base unless @url_base.nil?
8
-
9
- user, key = (App.config[:bitly] || {}).values_at "user", "key"
10
-
11
- @url_base = unless user && key
12
- App.logger.warn "Missing or invalid bitly configuration: #{App.config[:bitly]}"
13
- false
14
- else
15
- "https://api-ssl.bitly.com/v3/shorten?login=#{user}&apiKey=#{key}"
16
- end
17
- end
18
-
19
- def self.shorten(url)
20
- return url if !self.url_base || !url || url.index("/bit.ly/")
21
-
22
- bitly_url = "#{self.url_base}&longUrl=#{CGI.escape(url)}"
23
- parsed = JSON.parse Http.get(bitly_url, TIME_TO_LIVE)
24
-
25
- if parsed["status_code"] == 200
26
- bitlified = parsed["data"]["url"]
27
- App.logger.debug "bitlify: #{url} => #{bitlified}"
28
- bitlified
29
- else
30
- App.logger.error "#{url}: bitly error: #{parsed["status_txt"] }"
31
- url
32
- end
33
- end
34
- end
@@ -1,28 +0,0 @@
1
- # encoding: utf-8
2
-
3
- require_relative './test_helper'
4
- require 'vcr'
5
-
6
- VCR.configure do |c|
7
- c.cassette_library_dir = "#{File.dirname(__FILE__)}/fixtures-vcr"
8
- c.hook_into :webmock
9
- end
10
-
11
- class BitlifyTest < Test::Unit::TestCase
12
- def test_limit_exceeded
13
- VCR.use_cassette('bitly_limit_exceeded') do
14
- assert_equal("http://radiospiel.org/foo", Bitly.shorten("http://radiospiel.org/foo"))
15
- end
16
- end
17
-
18
- def test_ok
19
- VCR.use_cassette('bitly_ok') do
20
- assert_equal("http://bit.ly/HV7woD", Bitly.shorten("http://radiospiel.org/a=1&b=2"))
21
- end
22
- end
23
-
24
- def test_url_base
25
- expected = "https://api-ssl.bitly.com/v3/shorten?login=bitlyapidemo&apiKey=R_0da49e0a9118ff35f52f629d2d71bf07"
26
- assert_equal expected, Bitly.url_base
27
- end
28
- end
@@ -1,43 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: get
5
- uri: https://api-ssl.bitly.com/v3/shorten?apiKey=R_0da49e0a9118ff35f52f629d2d71bf07&login=bitlyapidemo&longUrl=http://radiospiel.org/foo
6
- body:
7
- encoding: US-ASCII
8
- string: ''
9
- headers:
10
- Accept:
11
- - ! '*/*'
12
- User-Agent:
13
- - Ruby
14
- response:
15
- status:
16
- code: 200
17
- message: OK
18
- headers:
19
- !binary "U2VydmVy":
20
- - !binary |-
21
- bmdpbng=
22
- !binary "RGF0ZQ==":
23
- - !binary |-
24
- V2VkLCAwNCBBcHIgMjAxMiAxNTo0OTo0NiBHTVQ=
25
- Content-Type:
26
- - !binary |-
27
- YXBwbGljYXRpb24vanNvbjsgY2hhcnNldD11dGYtOA==
28
- !binary "Q29ubmVjdGlvbg==":
29
- - !binary |-
30
- a2VlcC1hbGl2ZQ==
31
- Mime-Version:
32
- - !binary |-
33
- MS4w
34
- Content-Length:
35
- - !binary |-
36
- NzI=
37
- body:
38
- encoding: US-ASCII
39
- string: ! '{ "data": [ ], "status_code": 403, "status_txt": "RATE_LIMIT_EXCEEDED"
40
- }'
41
- http_version:
42
- recorded_at: Wed, 04 Apr 2012 15:49:46 GMT
43
- recorded_with: VCR 2.0.1
@@ -1,46 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: get
5
- uri: https://api-ssl.bitly.com/v3/shorten?apiKey=R_0da49e0a9118ff35f52f629d2d71bf07&login=bitlyapidemo&longUrl=http://radiospiel.org/a=1%26b=2
6
- body:
7
- encoding: US-ASCII
8
- string: ''
9
- headers:
10
- Accept:
11
- - ! '*/*'
12
- User-Agent:
13
- - Ruby
14
- response:
15
- status:
16
- code: 200
17
- message: OK
18
- headers:
19
- !binary "U2VydmVy":
20
- - !binary |-
21
- bmdpbng=
22
- !binary "RGF0ZQ==":
23
- - !binary |-
24
- V2VkLCAwNCBBcHIgMjAxMiAxNTo0NToyOSBHTVQ=
25
- Content-Type:
26
- - !binary |-
27
- YXBwbGljYXRpb24vanNvbjsgY2hhcnNldD11dGYtOA==
28
- !binary "Q29ubmVjdGlvbg==":
29
- - !binary |-
30
- a2VlcC1hbGl2ZQ==
31
- Mime-Version:
32
- - !binary |-
33
- MS4w
34
- Content-Length:
35
- - !binary |-
36
- MTk1
37
- body:
38
- encoding: US-ASCII
39
- string: ! '{ "status_code": 200, "status_txt": "OK", "data": { "long_url": "http:\/\/radiospiel.org\/a=1&b=2",
40
- "url": "http:\/\/bit.ly\/HV7woD", "hash": "HV7woD", "global_hash": "HV7woE",
41
- "new_hash": 1 } }
42
-
43
- '
44
- http_version:
45
- recorded_at: Wed, 04 Apr 2012 15:45:29 GMT
46
- recorded_with: VCR 2.0.1