skinny_controllers 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ab06e95b7202701fab9189c65efc971ca5422b71
4
- data.tar.gz: 8696ce2bc5873152f14f1743b7d5ec349c7f31ad
3
+ metadata.gz: 8015a9b181b4dcca8b0059d34235fe6305caa669
4
+ data.tar.gz: ba2e8bf418b39c90f886afd38c4af998ee141e29
5
5
  SHA512:
6
- metadata.gz: 022423564d78053df74fa1ea751a121d02eb45f8349c347ed906daacdf3d5e89751bc9cd462817aedcfd093d400cb415da0994e437f1502fdcd037100401d231
7
- data.tar.gz: 830c2b021accec0eca75ee25dadf9e7d423a9d29ff282c7b6da6c1a6f336005e832bc734c437f9fa48840e927943e004cc38748c918e18c0f4626a75f5cd90ae
6
+ metadata.gz: adf2864939a3076b97c2ea74e144d6be9939d8e02f9b9c241374741d46ea58ca6e0f34d9c3e814a9842974aa16d6b14742499e9063e39eb69ddf3a69b652cadb
7
+ data.tar.gz: 0ed96a8334b93b66c54c90efe4350fbf0896e56ca757313b429860da3ff76e40105e8b714613f5cc55465d688b38e323c27f335550979aeebf16907e3b333540
@@ -6,7 +6,10 @@ module SkinnyControllers
6
6
  # @example ObjectsController => Objects
7
7
  # @return [String] the resource name
8
8
  def resource_name(controller_name)
9
- controller_name.gsub('Controller', '')
9
+ name = controller_name.gsub('Controller', '')
10
+ # remove the namespace if one exists
11
+ name.slice! namespace
12
+ name
10
13
  end
11
14
 
12
15
  # @example <ObjectsContreller> => Object
@@ -14,10 +17,7 @@ module SkinnyControllers
14
17
  def model_name(controller)
15
18
  resource_name = Controller.resource_name(controller)
16
19
  # Convert Resources to Resource
17
- object_name = resource_name.singularize
18
- # remove the namespace if one exists
19
- object_name.slice! namespace
20
- object_name
20
+ resource_name.singularize
21
21
  end
22
22
 
23
23
  # TODO: add option to configure this per controller
@@ -37,7 +37,6 @@ module SkinnyControllers
37
37
  # @return [Class] namespace for the default operation class
38
38
  def default_operation_namespace_for(model_name)
39
39
  desired_namespace = namespace_from_model(model_name)
40
-
41
40
  parent_namespace = SkinnyControllers.operations_namespace
42
41
  namespace = "#{parent_namespace}::#{desired_namespace}".safe_constantize
43
42
  namespace || Object.const_set(desired_namespace, Module.new)
@@ -1,3 +1,3 @@
1
1
  module SkinnyControllers
2
- VERSION = '0.3.1'
2
+ VERSION = '0.3.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: skinny_controllers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - L. Preston Sego III
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-18 00:00:00.000000000 Z
11
+ date: 2015-11-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -224,5 +224,5 @@ rubyforge_project:
224
224
  rubygems_version: 2.4.8
225
225
  signing_key:
226
226
  specification_version: 4
227
- summary: SkinnyControllers-0.3.1
227
+ summary: SkinnyControllers-0.3.2
228
228
  test_files: []