stringex 1.0.3 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/lucky_sneaks/acts_as_url.rb +2 -1
- data/lib/lucky_sneaks/unidecoder.rb +1 -1
- data/lib/lucky_sneaks/unidecoder_data/x00.yml +2 -2
- data/lib/lucky_sneaks/unidecoder_data/x20.yml +2 -2
- data/lib/lucky_sneaks/unidecoder_data/x30.yml +1 -1
- data/lib/lucky_sneaks/unidecoder_data/x32.yml +1 -1
- data/lib/lucky_sneaks/unidecoder_data/xfe.yml +1 -1
- data/stringex.gemspec +5 -2
- data/test/acts_as_url_test.rb +1 -1
- metadata +2 -2
@@ -35,7 +35,8 @@ module LuckySneaks
|
|
35
35
|
if options[:sync_url]
|
36
36
|
before_validation :ensure_unique_url
|
37
37
|
else
|
38
|
-
|
38
|
+
# defined?(ActiveSupport::Callbacks) ? before_validation(:ensure_unique_url, :on => :create) :
|
39
|
+
before_validation_on_create(:ensure_unique_url)
|
39
40
|
end
|
40
41
|
|
41
42
|
self.attribute_to_urlify = attribute
|
@@ -13,8 +13,8 @@ module LuckySneaks
|
|
13
13
|
# You're probably better off just using the added String#to_ascii
|
14
14
|
def decode(string)
|
15
15
|
string.gsub(/[^\x00-\x7f]/u) do |codepoint|
|
16
|
-
unpacked = codepoint.unpack("U")[0]
|
17
16
|
begin
|
17
|
+
unpacked = codepoint.unpack("U")[0]
|
18
18
|
CODEPOINTS[code_group(unpacked)][grouped_point(unpacked)]
|
19
19
|
rescue
|
20
20
|
# Hopefully this won't come up much
|
data/stringex.gemspec
CHANGED
@@ -1,12 +1,15 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run `rake gemspec`
|
1
4
|
# -*- encoding: utf-8 -*-
|
2
5
|
|
3
6
|
Gem::Specification.new do |s|
|
4
7
|
s.name = %q{stringex}
|
5
|
-
s.version = "1.0
|
8
|
+
s.version = "1.1.0"
|
6
9
|
|
7
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
11
|
s.authors = ["Russell Norris"]
|
9
|
-
s.date = %q{2009-
|
12
|
+
s.date = %q{2009-10-12}
|
10
13
|
s.description = %q{Some [hopefully] useful extensions to Ruby’s String class. Stringex is made up of three libraries: ActsAsUrl [permalink solution with better character translation], Unidecoder [Unicode to Ascii transliteration], and StringExtensions [miscellaneous helper methods for the String class].}
|
11
14
|
s.email = %q{rsl@luckysneaks.com}
|
12
15
|
s.extra_rdoc_files = [
|
data/test/acts_as_url_test.rb
CHANGED
@@ -13,7 +13,7 @@ end
|
|
13
13
|
|
14
14
|
require File.join(File.dirname(__FILE__), '../init')
|
15
15
|
|
16
|
-
ActiveRecord::Base.establish_connection(:adapter => "sqlite3", :
|
16
|
+
ActiveRecord::Base.establish_connection(:adapter => "sqlite3", :database => "acts_as_url.sqlite3")
|
17
17
|
|
18
18
|
ActiveRecord::Migration.verbose = false
|
19
19
|
ActiveRecord::Schema.define(:version => 1) do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stringex
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Russell Norris
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-10-12 00:00:00 -04:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|