ki 0.4.3 → 0.4.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/ki/helpers.rb +1 -1
- data/lib/ki/version.rb +1 -1
- data/spec/lib/ki/base_request_spec.rb +5 -1
- data/spec/util_spec.rb +2 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0ddd8001c049b74417c89f5da05f779e705b311c
|
4
|
+
data.tar.gz: a5b2026b178aba8c7c4eac298051faa4182e55ae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 328c8df2c4df3ac20938130cd48bf27ea04036f108f1e6eecc03b0affeb77cc2d108fa1d950ea9b0fc0d0a42c4ac33976334af971838f2e81fd01f084ba38b5d
|
7
|
+
data.tar.gz: dbca108a4cd6bd95c417b954158b6267eb6104326880718132012cee449a127660d551cb678b50613176f7475da51459cf5910d9489ff23cc3b1a840c361b63a
|
data/Gemfile.lock
CHANGED
data/lib/ki/helpers.rb
CHANGED
@@ -12,7 +12,7 @@ class String
|
|
12
12
|
chain = self.split "::"
|
13
13
|
klass = Kernel
|
14
14
|
chain.each do |klass_string|
|
15
|
-
klass = klass.const_get klass_string.capitalize
|
15
|
+
klass = klass.const_get klass_string.split('_').map{|w| w.capitalize}.join('')
|
16
16
|
end
|
17
17
|
klass.is_a?(Class) ? klass : nil
|
18
18
|
rescue NameError
|
data/lib/ki/version.rb
CHANGED
@@ -11,6 +11,8 @@ describe Ki::BaseRequest do
|
|
11
11
|
it 'coverts path to class' do
|
12
12
|
class Foo < Ki::Model; end
|
13
13
|
class Bar < Ki::Model; end
|
14
|
+
class FooBar < Ki::Model; end
|
15
|
+
|
14
16
|
req.new({'PATH_INFO' => ''}).to_ki_model_class.should == nil
|
15
17
|
req.new({'PATH_INFO' => '/'}).to_ki_model_class.should == nil
|
16
18
|
req.new({'PATH_INFO' => 'foo'}).to_ki_model_class.should == Foo
|
@@ -19,7 +21,9 @@ describe Ki::BaseRequest do
|
|
19
21
|
req.new({'PATH_INFO' => '/bar.json'}).to_ki_model_class.should == Bar
|
20
22
|
req.new({'PATH_INFO' => '/Foo/bar.json'}).to_ki_model_class.should == nil
|
21
23
|
req.new({'PATH_INFO' => '/Foo/bar'}).to_ki_model_class.should == nil
|
22
|
-
req.new({'PATH_INFO' => '/Foo_bar'}).to_ki_model_class.should ==
|
24
|
+
req.new({'PATH_INFO' => '/Foo_bar'}).to_ki_model_class.should == FooBar
|
25
|
+
req.new({'PATH_INFO' => '/foo_bar'}).to_ki_model_class.should == FooBar
|
26
|
+
req.new({'PATH_INFO' => '/foo_bar.json'}).to_ki_model_class.should == FooBar
|
23
27
|
end
|
24
28
|
|
25
29
|
it 'converts verb to action' do
|
data/spec/util_spec.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ki
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cristian Mircea Messel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|