tmin 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +4 -1
- data/config.ru.example +1 -1
- data/lib/tmin/server.rb +3 -3
- data/lib/tmin/url.rb +1 -3
- data/lib/tmin/version.rb +1 -1
- data/tmin-0.0.1.gem +0 -0
- data/tmin-0.0.2.gem +0 -0
- data/tmin-0.0.3.gem +0 -0
- metadata +6 -3
data/Gemfile.lock
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
tmin (0.0.
|
4
|
+
tmin (0.0.3)
|
5
5
|
dm-aggregates (~> 1.2.0)
|
6
6
|
dm-core (~> 1.2.0)
|
7
7
|
dm-migrations (~> 1.2.0)
|
8
8
|
dm-mysql-adapter (~> 1.2.0)
|
9
9
|
dm-transactions (~> 1.2.0)
|
10
|
+
escape_utils (~> 0.2.3)
|
10
11
|
haml (~> 3.0.18)
|
11
12
|
sinatra (~> 1.2.0)
|
12
13
|
|
@@ -39,6 +40,7 @@ GEM
|
|
39
40
|
data_objects (= 0.10.8)
|
40
41
|
do_sqlite3 (0.10.8)
|
41
42
|
data_objects (= 0.10.8)
|
43
|
+
escape_utils (0.2.4)
|
42
44
|
haml (3.0.25)
|
43
45
|
rack (1.4.1)
|
44
46
|
rack-test (0.5.7)
|
@@ -67,6 +69,7 @@ DEPENDENCIES
|
|
67
69
|
dm-mysql-adapter (~> 1.2.0)
|
68
70
|
dm-sqlite-adapter (~> 1.2.0)
|
69
71
|
dm-transactions (~> 1.2.0)
|
72
|
+
escape_utils (~> 0.2.3)
|
70
73
|
haml (~> 3.0.18)
|
71
74
|
rack-test (~> 0.5.4)
|
72
75
|
rspec (~> 2.5.0)
|
data/config.ru.example
CHANGED
data/lib/tmin/server.rb
CHANGED
@@ -158,7 +158,7 @@ module Firefly
|
|
158
158
|
@authenticated = has_valid_api_cookie?
|
159
159
|
@config = config
|
160
160
|
@highlight = nil
|
161
|
-
@title = "
|
161
|
+
@title = "tminus.it at http://#{@config[:hostname]}"
|
162
162
|
|
163
163
|
set :session_secret, @config[:session_secret]
|
164
164
|
end
|
@@ -273,8 +273,8 @@ module Firefly
|
|
273
273
|
status 404
|
274
274
|
"Sorry, that code is unknown."
|
275
275
|
else
|
276
|
-
@url.
|
277
|
-
|
276
|
+
@short_url = "http://#{config[:hostname]}/#{@url.code}"
|
277
|
+
haml :redirect
|
278
278
|
end
|
279
279
|
end
|
280
280
|
|
data/lib/tmin/url.rb
CHANGED
@@ -3,8 +3,6 @@ module Firefly
|
|
3
3
|
class Url
|
4
4
|
include DataMapper::Resource
|
5
5
|
|
6
|
-
VALID_URL_REGEX = / /ix
|
7
|
-
VALID_CODE_REGEX = / /i
|
8
6
|
|
9
7
|
property :id, Serial
|
10
8
|
property :url, String, :index => true, :length => 355
|
@@ -19,7 +17,7 @@ module Firefly
|
|
19
17
|
|
20
18
|
# Shorten a long_url and return a new FireFly::Url
|
21
19
|
def self.shorten(long_url, code = nil)
|
22
|
-
code = nil if code
|
20
|
+
code = nil if code !~ /\S/
|
23
21
|
|
24
22
|
|
25
23
|
|
data/lib/tmin/version.rb
CHANGED
data/tmin-0.0.1.gem
ADDED
Binary file
|
data/tmin-0.0.2.gem
ADDED
Binary file
|
data/tmin-0.0.3.gem
ADDED
Binary file
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tmin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 23
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 4
|
10
|
+
version: 0.0.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- drobs
|
@@ -253,6 +253,9 @@ files:
|
|
253
253
|
- spec/spec_helper.rb
|
254
254
|
- test/helper.rb
|
255
255
|
- test/test_tmin.rb
|
256
|
+
- tmin-0.0.1.gem
|
257
|
+
- tmin-0.0.2.gem
|
258
|
+
- tmin-0.0.3.gem
|
256
259
|
- tmin.gemspec
|
257
260
|
- views/error.haml
|
258
261
|
- views/index.haml
|