murlsh 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.htaccess +5 -0
- data/COPYING +27 -0
- data/README.textile +2 -2
- data/Rakefile +133 -66
- data/VERSION +1 -1
- data/config.ru +9 -8
- data/config.yaml +3 -2
- data/lib/murlsh/auth.rb +6 -8
- data/lib/murlsh/config_server.rb +4 -6
- data/lib/murlsh/dispatch.rb +5 -7
- data/lib/murlsh/doc.rb +1 -1
- data/lib/murlsh/etag_add_encoding.rb +1 -3
- data/lib/murlsh/failproof.rb +0 -1
- data/lib/murlsh/far_future_expires.rb +2 -4
- data/lib/murlsh/head_from_get.rb +2 -2
- data/lib/murlsh/image_list.rb +32 -0
- data/lib/murlsh/img_store.rb +47 -9
- data/lib/murlsh/markup.rb +53 -20
- data/lib/murlsh/must_revalidate.rb +2 -4
- data/lib/murlsh/plugin.rb +1 -1
- data/lib/murlsh/sqlite3_adapter.rb +2 -4
- data/lib/murlsh/time_ago.rb +6 -8
- data/lib/murlsh/uri.rb +1 -3
- data/lib/murlsh/uri_ask.rb +23 -25
- data/lib/murlsh/url.rb +4 -6
- data/lib/murlsh/url_body.rb +19 -21
- data/lib/murlsh/url_server.rb +8 -10
- data/lib/murlsh/yaml_ordered_hash.rb +2 -4
- data/lib/murlsh.rb +21 -4
- data/murlsh.gemspec +95 -90
- data/plugins/add_post_50_update_feed.rb +22 -10
- data/plugins/add_post_50_update_podcast.rb +3 -5
- data/plugins/add_post_50_update_rss.rb +4 -6
- data/plugins/add_post_60_notify_hubs.rb +3 -5
- data/plugins/add_pre_40_convert_mobile.rb +4 -10
- data/plugins/add_pre_50_lookup_content_type_title.rb +4 -6
- data/plugins/add_pre_60_flickr.rb +3 -14
- data/plugins/add_pre_60_github_title.rb +4 -6
- data/plugins/add_pre_60_google_code_title.rb +4 -6
- data/plugins/add_pre_60_imgur.rb +4 -16
- data/plugins/add_pre_60_s3_image.rb +7 -6
- data/plugins/add_pre_60_twitter.rb +3 -14
- data/plugins/add_pre_60_vimeo.rb +7 -6
- data/plugins/add_pre_60_youtube.rb +8 -7
- data/plugins/add_pre_65_html_thumb.rb +41 -0
- data/plugins/add_pre_65_img_thumb.rb +39 -0
- data/plugins/html_parse_50_hpricot.rb +2 -4
- data/plugins/url_display_add_45_audio.rb +28 -0
- data/plugins/url_display_add_50_hostrec.rb +15 -18
- data/plugins/url_display_add_55_content_type.rb +6 -8
- data/plugins/url_display_add_60_via.rb +12 -19
- data/plugins/url_display_add_65_time.rb +4 -6
- data/public/css/screen.css +2 -3
- data/public/img/thumb/.gitignore +3 -0
- data/public/js/jquery-1.4.4.min.js +167 -0
- data/public/js/js.js +6 -5
- data/public/js/{twitter-text-1.0.3.js → twitter-text-1.0.4.js} +3 -1
- data/spec/auth_spec.rb +4 -6
- data/spec/dispatch_spec.rb +3 -5
- data/spec/doc_spec.rb +2 -4
- data/spec/img_store_spec.rb +46 -20
- data/spec/markup_spec.rb +22 -24
- data/spec/uri_ask_spec.rb +5 -7
- data/spec/uri_spec.rb +2 -4
- data/spec/url_spec.rb +5 -9
- data/spec/yaml_ordered_hash_spec.rb +1 -3
- metadata +85 -53
- data/.gitignore +0 -6
- data/plugins/add_pre_60_imageshack.rb +0 -31
- data/plugins/url_display_add_45_mp3.rb +0 -30
- data/public/img/thumb/README +0 -0
- data/public/js/jquery-1.4.3.min.js +0 -166
- data/public/swf/player_mp3_mini.swf +0 -0
data/spec/markup_spec.rb
CHANGED
@@ -1,6 +1,4 @@
|
|
1
|
-
|
2
|
-
murlsh
|
3
|
-
}.each { |m| require m }
|
1
|
+
require 'murlsh'
|
4
2
|
|
5
3
|
class MarkupMixer < Builder::XmlMarkup
|
6
4
|
include Murlsh::Markup
|
@@ -9,40 +7,40 @@ end
|
|
9
7
|
describe MarkupMixer do
|
10
8
|
|
11
9
|
before do
|
12
|
-
@m = MarkupMixer.new
|
10
|
+
@m = MarkupMixer.new
|
13
11
|
end
|
14
12
|
|
15
13
|
it 'should correctly render a single javascript tag' do
|
16
|
-
@m.javascript
|
14
|
+
@m.javascript 'test.js'
|
17
15
|
@m.target!.should ==
|
18
16
|
'<script type="text/javascript" src="test.js"></script>'
|
19
17
|
end
|
20
18
|
|
21
19
|
it 'should correctly render a list of javascript tags' do
|
22
|
-
@m.javascript
|
20
|
+
@m.javascript ['test1.js', 'test2.js']
|
23
21
|
@m.target!.should ==
|
24
22
|
'<script type="text/javascript" src="test1.js"></script><script type="text/javascript" src="test2.js"></script>'
|
25
23
|
end
|
26
24
|
|
27
25
|
it 'should correctly render a single javascript tag with a prefix' do
|
28
|
-
@m.javascript
|
26
|
+
@m.javascript 'test.js', :prefix => 'http://static.com/js/'
|
29
27
|
@m.target!.should ==
|
30
28
|
'<script type="text/javascript" src="http://static.com/js/test.js"></script>'
|
31
29
|
end
|
32
30
|
|
33
31
|
it 'should correctly render a list of javascripts tag with a prefix' do
|
34
|
-
@m.javascript
|
32
|
+
@m.javascript ['test1.js', 'test2.js'], :prefix => 'js/'
|
35
33
|
@m.target!.should ==
|
36
34
|
'<script type="text/javascript" src="js/test1.js"></script><script type="text/javascript" src="js/test2.js"></script>'
|
37
35
|
end
|
38
36
|
|
39
37
|
it 'should correctly render a murlsh_img tag' do
|
40
|
-
@m.murlsh_img
|
38
|
+
@m.murlsh_img :src => 'foo.png', :prefix => 'http://static.com/img/'
|
41
39
|
@m.target!.should == '<img src="http://static.com/img/foo.png"/>'
|
42
40
|
end
|
43
41
|
|
44
42
|
it 'should correctly render a murlsh_img tag with a single size value' do
|
45
|
-
@m.murlsh_img
|
43
|
+
@m.murlsh_img :src => 'foo.png', :size => 32
|
46
44
|
[
|
47
45
|
/height="32"/,
|
48
46
|
/src="foo\.png"/,
|
@@ -51,7 +49,7 @@ describe MarkupMixer do
|
|
51
49
|
end
|
52
50
|
|
53
51
|
it 'should correctly render a murlsh_img tag with two size values' do
|
54
|
-
@m.murlsh_img
|
52
|
+
@m.murlsh_img :src => 'foo.png', :size => [100, 200]
|
55
53
|
[
|
56
54
|
/height="200"/,
|
57
55
|
/src="foo\.png"/,
|
@@ -60,7 +58,7 @@ describe MarkupMixer do
|
|
60
58
|
end
|
61
59
|
|
62
60
|
it 'should correctly render a murlsh_img tag with text' do
|
63
|
-
@m.murlsh_img
|
61
|
+
@m.murlsh_img :src => 'foo.png', :text => 'test'
|
64
62
|
[
|
65
63
|
/alt="test"/,
|
66
64
|
/src="foo\.png"/,
|
@@ -69,63 +67,63 @@ describe MarkupMixer do
|
|
69
67
|
end
|
70
68
|
|
71
69
|
it 'should correctly render a murlsh_img tag with an href' do
|
72
|
-
@m.murlsh_img
|
70
|
+
@m.murlsh_img :href => '/test/', :src => 'foo.png'
|
73
71
|
@m.target!.should == '<a href="/test/"><img src="foo.png"/></a>'
|
74
72
|
end
|
75
73
|
|
76
74
|
it 'should correctly render meta tags' do
|
77
|
-
@m.metas
|
75
|
+
@m.metas :a => '1', :b => '2', :c => '3'
|
78
76
|
[
|
79
77
|
'<meta (name="a" content="1"|content="1" name="a")/>',
|
80
78
|
'<meta (name="b" content="2"|content="2" name="b")/>',
|
81
79
|
'<meta (name="c" content="3"|content="3" name="c")/>',
|
82
|
-
].each { |r| @m.target!.should match
|
80
|
+
].each { |r| @m.target!.should match(/#{r}/) }
|
83
81
|
end
|
84
82
|
|
85
83
|
it 'should correctly render a gravatar tag' do
|
86
|
-
@m.gravatar
|
84
|
+
@m.gravatar 'xxx'
|
87
85
|
@m.target!.should == '<img src="http://www.gravatar.com/avatar/xxx"/>'
|
88
86
|
end
|
89
87
|
|
90
88
|
it 'should correctly render a gravatar tag with a valid default' do
|
91
|
-
@m.gravatar
|
89
|
+
@m.gravatar 'xxx', 'd' => 'identicon'
|
92
90
|
@m.target!.should ==
|
93
91
|
'<img src="http://www.gravatar.com/avatar/xxx?d=identicon"/>'
|
94
92
|
end
|
95
93
|
|
96
94
|
it 'should not pass the default parameter to gravatar if the default is invalid' do
|
97
|
-
@m.gravatar
|
95
|
+
@m.gravatar 'xxx', 'd' => 'bad'
|
98
96
|
@m.target!.should == '<img src="http://www.gravatar.com/avatar/xxx"/>'
|
99
97
|
end
|
100
98
|
|
101
99
|
it 'should correctly render a gravatar tag with a valid rating' do
|
102
|
-
@m.gravatar
|
100
|
+
@m.gravatar 'xxx', 'r' => 'x'
|
103
101
|
@m.target!.should == '<img src="http://www.gravatar.com/avatar/xxx?r=x"/>'
|
104
102
|
end
|
105
103
|
|
106
104
|
it 'should not pass the rating parameter to gravatar if the rating is invalid' do
|
107
|
-
@m.gravatar
|
105
|
+
@m.gravatar 'xxx', 'r' => 'foo'
|
108
106
|
@m.target!.should == '<img src="http://www.gravatar.com/avatar/xxx"/>'
|
109
107
|
end
|
110
108
|
|
111
109
|
it 'should correctly render a gravatar tag with a valid size' do
|
112
|
-
@m.gravatar
|
110
|
+
@m.gravatar 'xxx', 's' => 100
|
113
111
|
@m.target!.should ==
|
114
112
|
'<img src="http://www.gravatar.com/avatar/xxx?s=100"/>'
|
115
113
|
end
|
116
114
|
|
117
115
|
it 'should not pass the size parameter to gravatar if the size is invalid' do
|
118
|
-
@m.gravatar
|
116
|
+
@m.gravatar 'xxx', 's' => 1000
|
119
117
|
@m.target!.should == '<img src="http://www.gravatar.com/avatar/xxx"/>'
|
120
118
|
end
|
121
119
|
|
122
120
|
it 'should return an empty string for a gravatar with size 0' do
|
123
|
-
@m.gravatar
|
121
|
+
@m.gravatar 'xxx', 's' => 0
|
124
122
|
@m.target!.should be_empty
|
125
123
|
end
|
126
124
|
|
127
125
|
it 'should correctly render a gravatar tag with an href' do
|
128
|
-
@m.gravatar
|
126
|
+
@m.gravatar 'xxx', :href => '/test/'
|
129
127
|
@m.target!.should ==
|
130
128
|
'<a href="/test/"><img src="http://www.gravatar.com/avatar/xxx"/></a>'
|
131
129
|
end
|
data/spec/uri_ask_spec.rb
CHANGED
@@ -1,8 +1,6 @@
|
|
1
|
-
|
2
|
-
uri
|
1
|
+
require 'uri'
|
3
2
|
|
4
|
-
murlsh
|
5
|
-
}.each { |m| require m }
|
3
|
+
require 'murlsh'
|
6
4
|
|
7
5
|
Dir['plugins/*.rb'].each { |p| load p }
|
8
6
|
|
@@ -32,17 +30,17 @@ describe Murlsh::UriAsk do
|
|
32
30
|
end
|
33
31
|
|
34
32
|
it 'should return text/html for the content type of a valid URI that is text/html' do
|
35
|
-
content_type('http://www.google.com/').should match
|
33
|
+
content_type('http://www.google.com/').should match(/^text\/html/)
|
36
34
|
end
|
37
35
|
|
38
36
|
it 'should return text/html for the content type of a valid https URI that is text/html' do
|
39
37
|
content_type('https://msp.f-secure.com/web-test/common/test.html'
|
40
|
-
).should match
|
38
|
+
).should match(/^text\/html/)
|
41
39
|
end
|
42
40
|
|
43
41
|
it 'should return text/html for the content type of a URI that returns HTTP 203' do
|
44
42
|
content_type('http://www.youtube.com/watch?v=Vxq9yj2pVWk'
|
45
|
-
).should match
|
43
|
+
).should match(/^text\/html/)
|
46
44
|
end
|
47
45
|
|
48
46
|
it 'should return an empty string for the content type of an invalid URI when given failproof option true' do
|
data/spec/uri_spec.rb
CHANGED
@@ -1,6 +1,4 @@
|
|
1
|
-
|
2
|
-
murlsh
|
3
|
-
}.each { |m| require m }
|
1
|
+
require 'murlsh'
|
4
2
|
|
5
3
|
describe URI do
|
6
4
|
|
@@ -8,7 +6,7 @@ describe URI do
|
|
8
6
|
URI('http://foo.com/').domain.should == 'foo.com'
|
9
7
|
end
|
10
8
|
|
11
|
-
it 'should have its domain set nil if it is
|
9
|
+
it 'should have its domain set nil if it is not a valid HTTP URI' do
|
12
10
|
URI('foo').domain.should be_nil
|
13
11
|
URI('http://foo.com.').domain.should be_nil
|
14
12
|
end
|
data/spec/url_spec.rb
CHANGED
@@ -1,12 +1,8 @@
|
|
1
|
-
|
1
|
+
require 'tempfile'
|
2
2
|
|
3
|
-
|
4
|
-
tempfile
|
3
|
+
require 'sqlite3'
|
5
4
|
|
6
|
-
|
7
|
-
|
8
|
-
murlsh
|
9
|
-
}.each { |m| require m }
|
5
|
+
require 'murlsh'
|
10
6
|
|
11
7
|
describe Murlsh::Url do
|
12
8
|
|
@@ -25,8 +21,8 @@ describe Murlsh::Url do
|
|
25
21
|
via TEXT);
|
26
22
|
")
|
27
23
|
|
28
|
-
ActiveRecord::Base.establish_connection
|
29
|
-
:database => @db_file.path
|
24
|
+
ActiveRecord::Base.establish_connection :adapter => 'sqlite3',
|
25
|
+
:database => @db_file.path
|
30
26
|
|
31
27
|
@url = Murlsh::Url.new
|
32
28
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: murlsh
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 19
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 1
|
8
|
+
- 1
|
8
9
|
- 0
|
9
|
-
|
10
|
-
version: 1.0.0
|
10
|
+
version: 1.1.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Matthew M. Boedicker
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-11-
|
18
|
+
date: 2010-11-21 00:00:00 -05:00
|
19
19
|
default_executable: murlsh
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -83,67 +83,67 @@ dependencies:
|
|
83
83
|
type: :runtime
|
84
84
|
version_requirements: *id004
|
85
85
|
- !ruby/object:Gem::Dependency
|
86
|
-
name:
|
86
|
+
name: hpricot
|
87
87
|
prerelease: false
|
88
88
|
requirement: &id005 !ruby/object:Gem::Requirement
|
89
89
|
none: false
|
90
90
|
requirements:
|
91
91
|
- - ">="
|
92
92
|
- !ruby/object:Gem::Version
|
93
|
-
hash:
|
93
|
+
hash: 61
|
94
94
|
segments:
|
95
|
-
- 2
|
96
|
-
- 5
|
97
95
|
- 0
|
98
|
-
|
96
|
+
- 8
|
97
|
+
- 1
|
98
|
+
version: 0.8.1
|
99
99
|
type: :runtime
|
100
100
|
version_requirements: *id005
|
101
101
|
- !ruby/object:Gem::Dependency
|
102
|
-
name:
|
102
|
+
name: htmlentities
|
103
103
|
prerelease: false
|
104
104
|
requirement: &id006 !ruby/object:Gem::Requirement
|
105
105
|
none: false
|
106
106
|
requirements:
|
107
107
|
- - ">="
|
108
108
|
- !ruby/object:Gem::Version
|
109
|
-
hash:
|
109
|
+
hash: 55
|
110
110
|
segments:
|
111
|
+
- 4
|
112
|
+
- 2
|
111
113
|
- 0
|
112
|
-
|
113
|
-
- 1
|
114
|
-
version: 0.8.1
|
114
|
+
version: 4.2.0
|
115
115
|
type: :runtime
|
116
116
|
version_requirements: *id006
|
117
117
|
- !ruby/object:Gem::Dependency
|
118
|
-
name:
|
118
|
+
name: json
|
119
119
|
prerelease: false
|
120
120
|
requirement: &id007 !ruby/object:Gem::Requirement
|
121
121
|
none: false
|
122
122
|
requirements:
|
123
123
|
- - ">="
|
124
124
|
- !ruby/object:Gem::Version
|
125
|
-
hash:
|
125
|
+
hash: 25
|
126
126
|
segments:
|
127
|
-
-
|
127
|
+
- 1
|
128
128
|
- 2
|
129
|
-
-
|
130
|
-
version:
|
129
|
+
- 3
|
130
|
+
version: 1.2.3
|
131
131
|
type: :runtime
|
132
132
|
version_requirements: *id007
|
133
133
|
- !ruby/object:Gem::Dependency
|
134
|
-
name:
|
134
|
+
name: plumnailer
|
135
135
|
prerelease: false
|
136
136
|
requirement: &id008 !ruby/object:Gem::Requirement
|
137
137
|
none: false
|
138
138
|
requirements:
|
139
139
|
- - ">="
|
140
140
|
- !ruby/object:Gem::Version
|
141
|
-
hash:
|
141
|
+
hash: 27
|
142
142
|
segments:
|
143
|
+
- 0
|
143
144
|
- 1
|
144
|
-
-
|
145
|
-
|
146
|
-
version: 1.2.3
|
145
|
+
- 0
|
146
|
+
version: 0.1.0
|
147
147
|
type: :runtime
|
148
148
|
version_requirements: *id008
|
149
149
|
- !ruby/object:Gem::Dependency
|
@@ -227,9 +227,25 @@ dependencies:
|
|
227
227
|
type: :runtime
|
228
228
|
version_requirements: *id013
|
229
229
|
- !ruby/object:Gem::Dependency
|
230
|
-
name:
|
230
|
+
name: rmagick
|
231
231
|
prerelease: false
|
232
232
|
requirement: &id014 !ruby/object:Gem::Requirement
|
233
|
+
none: false
|
234
|
+
requirements:
|
235
|
+
- - ">="
|
236
|
+
- !ruby/object:Gem::Version
|
237
|
+
hash: 55
|
238
|
+
segments:
|
239
|
+
- 1
|
240
|
+
- 15
|
241
|
+
- 14
|
242
|
+
version: 1.15.14
|
243
|
+
type: :runtime
|
244
|
+
version_requirements: *id014
|
245
|
+
- !ruby/object:Gem::Dependency
|
246
|
+
name: sqlite3-ruby
|
247
|
+
prerelease: false
|
248
|
+
requirement: &id015 !ruby/object:Gem::Requirement
|
233
249
|
none: false
|
234
250
|
requirements:
|
235
251
|
- - ">="
|
@@ -241,27 +257,27 @@ dependencies:
|
|
241
257
|
- 1
|
242
258
|
version: 1.2.1
|
243
259
|
type: :runtime
|
244
|
-
version_requirements: *
|
260
|
+
version_requirements: *id015
|
245
261
|
- !ruby/object:Gem::Dependency
|
246
262
|
name: tinyatom
|
247
263
|
prerelease: false
|
248
|
-
requirement: &
|
264
|
+
requirement: &id016 !ruby/object:Gem::Requirement
|
249
265
|
none: false
|
250
266
|
requirements:
|
251
267
|
- - ">="
|
252
268
|
- !ruby/object:Gem::Version
|
253
|
-
hash:
|
269
|
+
hash: 21
|
254
270
|
segments:
|
255
271
|
- 0
|
256
|
-
-
|
257
|
-
-
|
258
|
-
version: 0.
|
272
|
+
- 3
|
273
|
+
- 3
|
274
|
+
version: 0.3.3
|
259
275
|
type: :runtime
|
260
|
-
version_requirements: *
|
276
|
+
version_requirements: *id016
|
261
277
|
- !ruby/object:Gem::Dependency
|
262
278
|
name: twitter
|
263
279
|
prerelease: false
|
264
|
-
requirement: &
|
280
|
+
requirement: &id017 !ruby/object:Gem::Requirement
|
265
281
|
none: false
|
266
282
|
requirements:
|
267
283
|
- - ">="
|
@@ -273,11 +289,11 @@ dependencies:
|
|
273
289
|
- 12
|
274
290
|
version: 0.9.12
|
275
291
|
type: :runtime
|
276
|
-
version_requirements: *
|
292
|
+
version_requirements: *id017
|
277
293
|
- !ruby/object:Gem::Dependency
|
278
294
|
name: vimeo
|
279
295
|
prerelease: false
|
280
|
-
requirement: &
|
296
|
+
requirement: &id018 !ruby/object:Gem::Requirement
|
281
297
|
none: false
|
282
298
|
requirements:
|
283
299
|
- - ">="
|
@@ -289,11 +305,27 @@ dependencies:
|
|
289
305
|
- 2
|
290
306
|
version: 1.2.2
|
291
307
|
type: :runtime
|
292
|
-
version_requirements: *
|
308
|
+
version_requirements: *id018
|
309
|
+
- !ruby/object:Gem::Dependency
|
310
|
+
name: flog
|
311
|
+
prerelease: false
|
312
|
+
requirement: &id019 !ruby/object:Gem::Requirement
|
313
|
+
none: false
|
314
|
+
requirements:
|
315
|
+
- - ">="
|
316
|
+
- !ruby/object:Gem::Version
|
317
|
+
hash: 27
|
318
|
+
segments:
|
319
|
+
- 2
|
320
|
+
- 5
|
321
|
+
- 0
|
322
|
+
version: 2.5.0
|
323
|
+
type: :development
|
324
|
+
version_requirements: *id019
|
293
325
|
- !ruby/object:Gem::Dependency
|
294
326
|
name: rspec
|
295
327
|
prerelease: false
|
296
|
-
requirement: &
|
328
|
+
requirement: &id020 !ruby/object:Gem::Requirement
|
297
329
|
none: false
|
298
330
|
requirements:
|
299
331
|
- - ~>
|
@@ -303,8 +335,8 @@ dependencies:
|
|
303
335
|
- 1
|
304
336
|
- 3
|
305
337
|
version: "1.3"
|
306
|
-
type: :
|
307
|
-
version_requirements: *
|
338
|
+
type: :development
|
339
|
+
version_requirements: *id020
|
308
340
|
description: url sharing site framework with easy adding, title lookup, atom feed, thumbnails and embedding
|
309
341
|
email: matthewm@boedicker.org
|
310
342
|
executables:
|
@@ -314,7 +346,6 @@ extensions: []
|
|
314
346
|
extra_rdoc_files:
|
315
347
|
- README.textile
|
316
348
|
files:
|
317
|
-
- .gitignore
|
318
349
|
- .htaccess
|
319
350
|
- COPYING
|
320
351
|
- README.textile
|
@@ -332,6 +363,7 @@ files:
|
|
332
363
|
- lib/murlsh/failproof.rb
|
333
364
|
- lib/murlsh/far_future_expires.rb
|
334
365
|
- lib/murlsh/head_from_get.rb
|
366
|
+
- lib/murlsh/image_list.rb
|
335
367
|
- lib/murlsh/img_store.rb
|
336
368
|
- lib/murlsh/markup.rb
|
337
369
|
- lib/murlsh/must_revalidate.rb
|
@@ -355,27 +387,27 @@ files:
|
|
355
387
|
- plugins/add_pre_60_flickr.rb
|
356
388
|
- plugins/add_pre_60_github_title.rb
|
357
389
|
- plugins/add_pre_60_google_code_title.rb
|
358
|
-
- plugins/add_pre_60_imageshack.rb
|
359
390
|
- plugins/add_pre_60_imgur.rb
|
360
391
|
- plugins/add_pre_60_s3_image.rb
|
361
392
|
- plugins/add_pre_60_twitter.rb
|
362
393
|
- plugins/add_pre_60_vimeo.rb
|
363
394
|
- plugins/add_pre_60_youtube.rb
|
395
|
+
- plugins/add_pre_65_html_thumb.rb
|
396
|
+
- plugins/add_pre_65_img_thumb.rb
|
364
397
|
- plugins/html_parse_50_hpricot.rb
|
365
|
-
- plugins/
|
398
|
+
- plugins/url_display_add_45_audio.rb
|
366
399
|
- plugins/url_display_add_50_hostrec.rb
|
367
400
|
- plugins/url_display_add_55_content_type.rb
|
368
401
|
- plugins/url_display_add_60_via.rb
|
369
402
|
- plugins/url_display_add_65_time.rb
|
370
403
|
- public/css/jquery.jgrowl.css
|
371
404
|
- public/css/screen.css
|
372
|
-
- public/img/thumb
|
405
|
+
- public/img/thumb/.gitignore
|
373
406
|
- public/js/comments.json
|
374
|
-
- public/js/jquery-1.4.
|
407
|
+
- public/js/jquery-1.4.4.min.js
|
375
408
|
- public/js/jquery.jgrowl_compressed.js
|
376
409
|
- public/js/js.js
|
377
|
-
- public/js/twitter-text-1.0.
|
378
|
-
- public/swf/player_mp3_mini.swf
|
410
|
+
- public/js/twitter-text-1.0.4.js
|
379
411
|
- spec/auth_spec.rb
|
380
412
|
- spec/dispatch_spec.rb
|
381
413
|
- spec/doc_spec.rb
|
@@ -390,8 +422,8 @@ homepage: http://github.com/mmb/murlsh
|
|
390
422
|
licenses: []
|
391
423
|
|
392
424
|
post_install_message:
|
393
|
-
rdoc_options:
|
394
|
-
|
425
|
+
rdoc_options: []
|
426
|
+
|
395
427
|
require_paths:
|
396
428
|
- lib
|
397
429
|
required_ruby_version: !ruby/object:Gem::Requirement
|
@@ -421,11 +453,11 @@ specification_version: 3
|
|
421
453
|
summary: url sharing site framework
|
422
454
|
test_files:
|
423
455
|
- spec/auth_spec.rb
|
424
|
-
- spec/yaml_ordered_hash_spec.rb
|
425
|
-
- spec/uri_ask_spec.rb
|
426
|
-
- spec/img_store_spec.rb
|
427
456
|
- spec/dispatch_spec.rb
|
457
|
+
- spec/doc_spec.rb
|
458
|
+
- spec/img_store_spec.rb
|
428
459
|
- spec/markup_spec.rb
|
429
|
-
- spec/
|
460
|
+
- spec/uri_ask_spec.rb
|
430
461
|
- spec/uri_spec.rb
|
431
|
-
- spec/
|
462
|
+
- spec/url_spec.rb
|
463
|
+
- spec/yaml_ordered_hash_spec.rb
|
data/.gitignore
DELETED
@@ -1,31 +0,0 @@
|
|
1
|
-
%w{
|
2
|
-
cgi
|
3
|
-
|
4
|
-
murlsh
|
5
|
-
}.each { |m| require m }
|
6
|
-
|
7
|
-
module Murlsh
|
8
|
-
|
9
|
-
# Set the thumbnail of imageshack images.
|
10
|
-
class AddPre60Imageshack < Plugin
|
11
|
-
|
12
|
-
@hook = 'add_pre'
|
13
|
-
|
14
|
-
ImageshackRe =
|
15
|
-
%r{^(http://img\d+\.imageshack\.us/img\d+/\d+/)(\w+)\.(jpe?g|gif|png)$}i
|
16
|
-
StorageDir = File.join(File.dirname(__FILE__), '..', 'public', 'img',
|
17
|
-
'thumb')
|
18
|
-
|
19
|
-
def self.run(url, config)
|
20
|
-
if match = ImageshackRe.match(url.url)
|
21
|
-
thumb_storage = Murlsh::ImgStore.new(StorageDir,
|
22
|
-
:user_agent => config['user_agent'])
|
23
|
-
stored_filename = thumb_storage.store(
|
24
|
-
"#{match[1]}#{match[2]}.th.#{match[3]}")
|
25
|
-
url.thumbnail_url = "img/thumb/#{CGI.escape(stored_filename)}"
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
end
|
30
|
-
|
31
|
-
end
|
@@ -1,30 +0,0 @@
|
|
1
|
-
%w{
|
2
|
-
murlsh
|
3
|
-
}.each { |m| require m }
|
4
|
-
|
5
|
-
module Murlsh
|
6
|
-
|
7
|
-
# Add Flash mp3 player to mp3 urls.
|
8
|
-
class UrlDisplayAdd45Mp3 < Plugin
|
9
|
-
|
10
|
-
@hook = 'url_display_add'
|
11
|
-
|
12
|
-
def self.run(markup, url, config)
|
13
|
-
if url.content_type == 'audio/mpeg'
|
14
|
-
swf = 'swf/player_mp3_mini.swf'
|
15
|
-
|
16
|
-
markup.object(
|
17
|
-
:type => 'application/x-shockwave-flash',
|
18
|
-
:data => swf,
|
19
|
-
:width => 200,
|
20
|
-
:height => 20) {
|
21
|
-
markup.param(:name => 'bgcolor', :value => '#000000')
|
22
|
-
markup.param(:name => 'FlashVars', :value => "mp3=#{url.url}")
|
23
|
-
markup.param(:name => 'movie', :value => swf)
|
24
|
-
}
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
end
|
29
|
-
|
30
|
-
end
|
data/public/img/thumb/README
DELETED
File without changes
|