murlsh 0.6.1 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +3 -0
- data/README.textile +25 -2
- data/Rakefile +37 -5
- data/VERSION +1 -1
- data/bin/murlsh +3 -3
- data/config.ru +10 -4
- data/config.yaml +14 -10
- data/lib/murlsh/atom_feed.rb +5 -4
- data/lib/murlsh/auth.rb +6 -7
- data/lib/murlsh/dispatch.rb +25 -23
- data/lib/murlsh/doc.rb +14 -6
- data/lib/murlsh/etag_add_encoding.rb +27 -0
- data/lib/murlsh/flickr_server.rb +54 -0
- data/lib/murlsh/markup.rb +18 -1
- data/lib/murlsh/plugin.rb +2 -0
- data/lib/murlsh/sqlite3_adapter.rb +3 -1
- data/lib/murlsh/time_ago.rb +27 -0
- data/lib/murlsh/uri.rb +3 -1
- data/lib/murlsh/uri_ask.rb +13 -10
- data/lib/murlsh/url.rb +11 -4
- data/lib/murlsh/url_body.rb +21 -31
- data/lib/murlsh/url_server.rb +1 -2
- data/lib/murlsh/yaml_ordered_hash.rb +22 -0
- data/lib/murlsh.rb +4 -18
- data/murlsh.gemspec +22 -5
- data/plugins/add_post_50_update_feed.rb +4 -2
- data/plugins/add_post_50_update_rss.rb +37 -0
- data/plugins/add_post_60_notify_hubs.rb +3 -2
- data/plugins/add_pre_50_lookup_content_type_title.rb +3 -1
- data/plugins/time_50_ago.rb +16 -0
- data/plugins/via_50_domain.rb +36 -0
- data/public/css/screen.css +5 -6
- data/public/js/js.js +142 -94
- data/spec/atom_feed_spec.rb +21 -20
- data/spec/auth_spec.rb +8 -6
- data/spec/dispatch_spec.rb +26 -0
- data/spec/doc_spec.rb +27 -0
- data/spec/markup_spec.rb +3 -1
- data/spec/uri_ask_spec.rb +5 -3
- data/spec/uri_spec.rb +3 -1
- data/spec/url_spec.rb +52 -0
- data/spec/xhtml_response_spec.rb +3 -1
- data/spec/yaml_ordered_hash_spec.rb +28 -0
- metadata +37 -9
- data/lib/murlsh/time.rb +0 -20
data/spec/xhtml_response_spec.rb
CHANGED
@@ -0,0 +1,28 @@
|
|
1
|
+
$:.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
2
|
+
|
3
|
+
%w{
|
4
|
+
murlsh
|
5
|
+
}.each { |m| require m }
|
6
|
+
|
7
|
+
describe Murlsh::YamlOrderedHash do
|
8
|
+
|
9
|
+
it 'should generate yaml with hash keys in sorted order' do
|
10
|
+
h = {
|
11
|
+
'd' => 4,
|
12
|
+
'a' => 1,
|
13
|
+
'c' => 3,
|
14
|
+
'b' => 2,
|
15
|
+
}
|
16
|
+
|
17
|
+
h.extend(Murlsh::YamlOrderedHash)
|
18
|
+
|
19
|
+
h.to_yaml.should == <<EOS
|
20
|
+
---
|
21
|
+
a: 1
|
22
|
+
b: 2
|
23
|
+
c: 3
|
24
|
+
d: 4
|
25
|
+
EOS
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
metadata
CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
|
|
4
4
|
prerelease: false
|
5
5
|
segments:
|
6
6
|
- 0
|
7
|
-
-
|
8
|
-
-
|
9
|
-
version: 0.
|
7
|
+
- 7
|
8
|
+
- 0
|
9
|
+
version: 0.7.0
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Matthew M. Boedicker
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-
|
17
|
+
date: 2010-04-10 00:00:00 -04:00
|
18
18
|
default_executable: murlsh
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -88,9 +88,23 @@ dependencies:
|
|
88
88
|
type: :runtime
|
89
89
|
version_requirements: *id005
|
90
90
|
- !ruby/object:Gem::Dependency
|
91
|
-
name:
|
91
|
+
name: json
|
92
92
|
prerelease: false
|
93
93
|
requirement: &id006 !ruby/object:Gem::Requirement
|
94
|
+
requirements:
|
95
|
+
- - ">="
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
segments:
|
98
|
+
- 1
|
99
|
+
- 2
|
100
|
+
- 3
|
101
|
+
version: 1.2.3
|
102
|
+
type: :runtime
|
103
|
+
version_requirements: *id006
|
104
|
+
- !ruby/object:Gem::Dependency
|
105
|
+
name: rack
|
106
|
+
prerelease: false
|
107
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
94
108
|
requirements:
|
95
109
|
- - ">="
|
96
110
|
- !ruby/object:Gem::Version
|
@@ -100,11 +114,11 @@ dependencies:
|
|
100
114
|
- 0
|
101
115
|
version: 1.0.0
|
102
116
|
type: :runtime
|
103
|
-
version_requirements: *
|
117
|
+
version_requirements: *id007
|
104
118
|
- !ruby/object:Gem::Dependency
|
105
119
|
name: sqlite3-ruby
|
106
120
|
prerelease: false
|
107
|
-
requirement: &
|
121
|
+
requirement: &id008 !ruby/object:Gem::Requirement
|
108
122
|
requirements:
|
109
123
|
- - ">="
|
110
124
|
- !ruby/object:Gem::Version
|
@@ -114,7 +128,7 @@ dependencies:
|
|
114
128
|
- 1
|
115
129
|
version: 1.2.1
|
116
130
|
type: :runtime
|
117
|
-
version_requirements: *
|
131
|
+
version_requirements: *id008
|
118
132
|
description: url sharing site framework with easy adding, title lookup, atom feed, thumbnails and embedding
|
119
133
|
email: matthewm@boedicker.org
|
120
134
|
executables:
|
@@ -138,24 +152,30 @@ files:
|
|
138
152
|
- lib/murlsh/auth.rb
|
139
153
|
- lib/murlsh/dispatch.rb
|
140
154
|
- lib/murlsh/doc.rb
|
155
|
+
- lib/murlsh/etag_add_encoding.rb
|
141
156
|
- lib/murlsh/failproof.rb
|
157
|
+
- lib/murlsh/flickr_server.rb
|
142
158
|
- lib/murlsh/markup.rb
|
143
159
|
- lib/murlsh/openlock.rb
|
144
160
|
- lib/murlsh/plugin.rb
|
145
161
|
- lib/murlsh/sqlite3_adapter.rb
|
146
|
-
- lib/murlsh/
|
162
|
+
- lib/murlsh/time_ago.rb
|
147
163
|
- lib/murlsh/uri.rb
|
148
164
|
- lib/murlsh/uri_ask.rb
|
149
165
|
- lib/murlsh/url.rb
|
150
166
|
- lib/murlsh/url_body.rb
|
151
167
|
- lib/murlsh/url_server.rb
|
152
168
|
- lib/murlsh/xhtml_response.rb
|
169
|
+
- lib/murlsh/yaml_ordered_hash.rb
|
153
170
|
- murlsh.gemspec
|
154
171
|
- plugins/add_post_50_update_feed.rb
|
172
|
+
- plugins/add_post_50_update_rss.rb
|
155
173
|
- plugins/add_post_60_notify_hubs.rb
|
156
174
|
- plugins/add_pre_50_lookup_content_type_title.rb
|
157
175
|
- plugins/hostrec_50_redundant.rb
|
158
176
|
- plugins/hostrec_60_skip.rb
|
177
|
+
- plugins/time_50_ago.rb
|
178
|
+
- plugins/via_50_domain.rb
|
159
179
|
- public/css/jquery.jgrowl.css
|
160
180
|
- public/css/screen.css
|
161
181
|
- public/js/jquery-1.4.2.min.js
|
@@ -165,10 +185,14 @@ files:
|
|
165
185
|
- public/swf/player_mp3_mini.swf
|
166
186
|
- spec/atom_feed_spec.rb
|
167
187
|
- spec/auth_spec.rb
|
188
|
+
- spec/dispatch_spec.rb
|
189
|
+
- spec/doc_spec.rb
|
168
190
|
- spec/markup_spec.rb
|
169
191
|
- spec/uri_ask_spec.rb
|
170
192
|
- spec/uri_spec.rb
|
193
|
+
- spec/url_spec.rb
|
171
194
|
- spec/xhtml_response_spec.rb
|
195
|
+
- spec/yaml_ordered_hash_spec.rb
|
172
196
|
has_rdoc: true
|
173
197
|
homepage: http://github.com/mmb/murlsh
|
174
198
|
licenses: []
|
@@ -203,6 +227,10 @@ test_files:
|
|
203
227
|
- spec/xhtml_response_spec.rb
|
204
228
|
- spec/atom_feed_spec.rb
|
205
229
|
- spec/auth_spec.rb
|
230
|
+
- spec/yaml_ordered_hash_spec.rb
|
206
231
|
- spec/uri_ask_spec.rb
|
232
|
+
- spec/dispatch_spec.rb
|
207
233
|
- spec/markup_spec.rb
|
234
|
+
- spec/url_spec.rb
|
208
235
|
- spec/uri_spec.rb
|
236
|
+
- spec/doc_spec.rb
|
data/lib/murlsh/time.rb
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
require 'time'
|
2
|
-
|
3
|
-
class Time
|
4
|
-
|
5
|
-
# Return a string of the approximate amount of time that has passed since
|
6
|
-
# this time.
|
7
|
-
def fuzzy
|
8
|
-
days_ago = (Time.now.to_i - to_i) / 86400
|
9
|
-
|
10
|
-
case days_ago
|
11
|
-
when 0 then 'today'
|
12
|
-
when 1 then 'yesterday'
|
13
|
-
when (2..4) then "#{days_ago} days ago"
|
14
|
-
when (5..7) then strftime('%a %e %b')
|
15
|
-
when (8..180) then strftime('%e %b').strip
|
16
|
-
else strftime('%e %b %Y').strip
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
end
|