smartname 0.1.7 → 0.1.8
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/Gemfile.lock +6 -6
- data/VERSION +1 -1
- data/lib/smart_name.rb +4 -5
- metadata +4 -4
data/Gemfile.lock
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
GEM
|
2
2
|
remote: http://rubygems.org/
|
3
3
|
specs:
|
4
|
-
activesupport (3.2.
|
5
|
-
i18n (
|
4
|
+
activesupport (3.2.13)
|
5
|
+
i18n (= 0.6.1)
|
6
6
|
multi_json (~> 1.0)
|
7
7
|
diff-lcs (1.1.3)
|
8
8
|
git (1.2.5)
|
@@ -13,10 +13,10 @@ GEM
|
|
13
13
|
git (>= 1.2.5)
|
14
14
|
rake
|
15
15
|
rdoc
|
16
|
-
json (1.7.
|
17
|
-
multi_json (1.
|
18
|
-
rake (10.0.
|
19
|
-
rdoc (3.12)
|
16
|
+
json (1.7.7)
|
17
|
+
multi_json (1.7.2)
|
18
|
+
rake (10.0.4)
|
19
|
+
rdoc (3.12.2)
|
20
20
|
json (~> 1.4)
|
21
21
|
rspec (2.8.0)
|
22
22
|
rspec-core (~> 2.8.0)
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.8
|
data/lib/smart_name.rb
CHANGED
@@ -11,17 +11,16 @@ class Object
|
|
11
11
|
end
|
12
12
|
|
13
13
|
class SmartName < Object
|
14
|
-
|
15
|
-
OK4KEY_RE
|
14
|
+
RUBYENCODING = RUBY_VERSION =~ /^(2|1\.9)/
|
15
|
+
OK4KEY_RE = RUBYENCODING ? '\p{Word}\*' : '\w\*'
|
16
16
|
|
17
17
|
include ActiveSupport::Configurable
|
18
18
|
|
19
|
-
config_accessor :joint, :
|
19
|
+
config_accessor :joint, :name_attribute, :banned_array,
|
20
20
|
:var_re, :uninflect, :params, :codes, :lookup, :session
|
21
21
|
|
22
22
|
# Wagny defaults:
|
23
23
|
SmartName.joint = '+'
|
24
|
-
SmartName.formal_joint = " <span class=\"wiki-joint\">#{SmartName.joint}</span> " #let's get rid of this
|
25
24
|
SmartName.banned_array = [ '/', '~', '|' ]
|
26
25
|
SmartName.name_attribute = :cardname
|
27
26
|
SmartName.var_re = /\{([^\}]*\})\}/
|
@@ -57,7 +56,7 @@ class SmartName < Object
|
|
57
56
|
|
58
57
|
def initialize str
|
59
58
|
@s = str.to_s.strip
|
60
|
-
@s = @s.encode('UTF-8') if
|
59
|
+
@s = @s.encode('UTF-8') if RUBYENCODING
|
61
60
|
@key = if @s.index(SmartName.joint)
|
62
61
|
@parts = @s.split(/\s*#{JOINT_RE}\s*/)
|
63
62
|
@parts << '' if @s[-1,1] == SmartName.joint
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: smartname
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2013-05-02 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activesupport
|
@@ -143,7 +143,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
143
143
|
version: '0'
|
144
144
|
segments:
|
145
145
|
- 0
|
146
|
-
hash:
|
146
|
+
hash: -2297301681558297744
|
147
147
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
148
148
|
none: false
|
149
149
|
requirements:
|
@@ -152,7 +152,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
152
152
|
version: '0'
|
153
153
|
requirements: []
|
154
154
|
rubyforge_project:
|
155
|
-
rubygems_version: 1.8.
|
155
|
+
rubygems_version: 1.8.25
|
156
156
|
signing_key:
|
157
157
|
specification_version: 3
|
158
158
|
summary: Wagn names without all the wagn
|