fedux_org-stdlib 0.0.21 → 0.0.22
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.
@@ -42,8 +42,8 @@ module FeduxOrg
|
|
42
42
|
raise FeduxOrg::Stdlib::Models::Exceptions::MethodNeedsToBeImplemented, "Please defined the method \"suffix\" to make the library work."
|
43
43
|
end
|
44
44
|
|
45
|
-
def
|
46
|
-
raise FeduxOrg::Stdlib::Models::Exceptions::MethodNeedsToBeImplemented, "Please defined the method \"
|
45
|
+
def model_path
|
46
|
+
raise FeduxOrg::Stdlib::Models::Exceptions::MethodNeedsToBeImplemented, "Please defined the method \"model_path\" to make the library work."
|
47
47
|
end
|
48
48
|
|
49
49
|
def ignore
|
@@ -67,7 +67,7 @@ module FeduxOrg
|
|
67
67
|
end
|
68
68
|
|
69
69
|
def path_to_instances
|
70
|
-
return_path = ::File.expand_path("../../#{model_name.pluralize.underscore}",
|
70
|
+
return_path = ::File.expand_path("../../#{model_name.pluralize.underscore}", model_path )
|
71
71
|
|
72
72
|
FeduxOrg::Stdlib.logger.debug(self) { "Path to instances of model: #{return_path}" }
|
73
73
|
|
@@ -17,7 +17,7 @@ describe Models::ClassBasedModel do
|
|
17
17
|
class TestClassForFilesystem < FeduxOrg::Stdlib::Models::BaseModel
|
18
18
|
include FeduxOrg::Stdlib::Models::FilesystemBasedModel
|
19
19
|
include FeduxOrg::Stdlib::Models::ClassBasedModel
|
20
|
-
def self.
|
20
|
+
def self.model_path
|
21
21
|
File.join( examples_dir, 'models', 'class_based.rb' )
|
22
22
|
end
|
23
23
|
end
|
@@ -29,7 +29,7 @@ describe Models::ClassBasedModel do
|
|
29
29
|
class TestClassForFilesystem2 < FeduxOrg::Stdlib::Models::BaseModel
|
30
30
|
include FeduxOrg::Stdlib::Models::FilesystemBasedModel
|
31
31
|
include FeduxOrg::Stdlib::Models::ClassBasedModel
|
32
|
-
def self.
|
32
|
+
def self.model_path
|
33
33
|
File.join( examples_dir, 'models', 'forbidden.rb' )
|
34
34
|
end
|
35
35
|
|
@@ -301,12 +301,12 @@ describe Models::ClassBasedModel do
|
|
301
301
|
end
|
302
302
|
|
303
303
|
it "returns the name for the instance based on the path to the ruby file" do
|
304
|
-
expect( Test123::Models::TestClassForFilesystem.send(:name, Test123::Models::TestClassForFilesystem.send( :
|
304
|
+
expect( Test123::Models::TestClassForFilesystem.send(:name, Test123::Models::TestClassForFilesystem.send( :model_path ) ) ).to eq( :class_based )
|
305
305
|
end
|
306
306
|
|
307
307
|
it "check if the name for the instances is forbidden" do
|
308
308
|
expect {
|
309
|
-
Test123::Models::TestClassForFilesystem2.send(:name, Test123::Models::TestClassForFilesystem2.send( :
|
309
|
+
Test123::Models::TestClassForFilesystem2.send(:name, Test123::Models::TestClassForFilesystem2.send( :model_path ) )
|
310
310
|
}.to raise_error FeduxOrg::Stdlib::Models::Exceptions::UnauthorizedUseOfKeyword
|
311
311
|
end
|
312
312
|
|
@@ -323,7 +323,7 @@ describe Models::ClassBasedModel do
|
|
323
323
|
'Internal'
|
324
324
|
end
|
325
325
|
|
326
|
-
def self.
|
326
|
+
def self.model_path
|
327
327
|
'asdfasf'
|
328
328
|
end
|
329
329
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fedux_org-stdlib
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.22
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-07-
|
12
|
+
date: 2013-07-31 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|