Skip to content

Commit 4866622

Browse files
committed
Add a gem rake task + migrate #convert_key for AS test suite compat
1 parent f353bbb commit 4866622

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

Diff for: Rakefile

+6-1
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,9 @@ desc "run benchmarks"
6565
task :bench do
6666
ruby "bench/bench.rb"
6767
end
68-
task :bench => :build
68+
task :bench => :build
69+
70+
desc "build gem"
71+
task :gem do
72+
sh "gem build hwia.gemspec"
73+
end

Diff for: lib/hwia_rails.rb

+7-2
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,15 @@ class Hash
66
end
77

88
class StrHash
9-
alias convert_key convert
109
def stringify_keys!; self end
1110
def symbolize_keys!; self end
12-
def to_options!; self end
11+
def to_options!; self end
12+
13+
protected
14+
# AS test suite compat only
15+
def convert_key(key)
16+
key.kind_of?(Symbol) ? key.to_s : key
17+
end
1318
end
1419

1520
begin

0 commit comments

Comments
 (0)