coiasira 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,25 +1,29 @@
1
- module Rails
2
- class Initializer
3
- def self.alias_method_chain(target, feature)
4
- # Strip out punctuation on predicates or bang methods since
5
- # e.g. target?_without_feature is not a valid method name.
6
- aliased_target, punctuation = target.to_s.sub(/([?!=])$/, ''), $1
7
- yield(aliased_target, punctuation) if block_given?
1
+ module Coiasira::AliasMethodChainCoreExt
2
+ def alias_method_chain(target, feature)
3
+ # Strip out punctuation on predicates or bang methods since
4
+ # e.g. target?_without_feature is not a valid method name.
5
+ aliased_target, punctuation = target.to_s.sub(/([?!=])$/, ''), $1
6
+ yield(aliased_target, punctuation) if block_given?
8
7
 
9
- with_method, without_method = "#{aliased_target}_with_#{feature}#{punctuation}", "#{aliased_target}_without_#{feature}#{punctuation}"
8
+ with_method, without_method = "#{aliased_target}_with_#{feature}#{punctuation}", "#{aliased_target}_without_#{feature}#{punctuation}"
10
9
 
11
- alias_method without_method, target
12
- alias_method target, with_method
10
+ alias_method without_method, target
11
+ alias_method target, with_method
13
12
 
14
- case
15
- when public_method_defined?(without_method)
16
- public target
17
- when protected_method_defined?(without_method)
18
- protected target
19
- when private_method_defined?(without_method)
20
- private target
21
- end
13
+ case
14
+ when public_method_defined?(without_method)
15
+ public target
16
+ when protected_method_defined?(without_method)
17
+ protected target
18
+ when private_method_defined?(without_method)
19
+ private target
22
20
  end
21
+ end
22
+ end
23
+
24
+ module Rails
25
+ class Initializer
26
+ extend Coiasira::AliasMethodChainCoreExt
23
27
 
24
28
  def initialize_coiasira
25
29
  return unless configuration.frameworks.include?(:coiasira)
@@ -36,26 +40,7 @@ module Rails
36
40
  end
37
41
 
38
42
  class Configuration
39
- def self.alias_method_chain(target, feature)
40
- # Strip out punctuation on predicates or bang methods since
41
- # e.g. target?_without_feature is not a valid method name.
42
- aliased_target, punctuation = target.to_s.sub(/([?!=])$/, ''), $1
43
- yield(aliased_target, punctuation) if block_given?
44
-
45
- with_method, without_method = "#{aliased_target}_with_#{feature}#{punctuation}", "#{aliased_target}_without_#{feature}#{punctuation}"
46
-
47
- alias_method without_method, target
48
- alias_method target, with_method
49
-
50
- case
51
- when public_method_defined?(without_method)
52
- public target
53
- when protected_method_defined?(without_method)
54
- protected target
55
- when private_method_defined?(without_method)
56
- private target
57
- end
58
- end
43
+ extend Coiasira::AliasMethodChainCoreExt
59
44
 
60
45
  attr_accessor :coiasira
61
46
 
@@ -75,13 +60,13 @@ module Rails
75
60
  end
76
61
  alias_method_chain :default_frameworks, :coiasira
77
62
 
78
- def default_load_paths_with_coiasira
79
- paths = default_load_paths_without_coiasira
63
+ def default_autoload_paths_with_coiasira
64
+ paths = default_autoload_paths_without_coiasira
80
65
 
81
66
  # Add the app's job directory
82
67
  paths.concat(Dir["#{root_path}/app/jobs/"])
83
68
  end
84
- alias_method_chain :default_load_paths, :coiasira
69
+ alias_method_chain :default_autoload_paths, :coiasira
85
70
 
86
71
  def default_job_paths
87
72
  [File.join(root_path, 'app', 'jobs')]
@@ -1,3 +1,3 @@
1
1
  module Coiasira #:nodoc:
2
- VERSION = '0.1.0'
2
+ VERSION = '0.1.1'
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coiasira
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 0
10
- version: 0.1.0
9
+ - 1
10
+ version: 0.1.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Brian Olsen