SampleGemTwo 1.0.0 → 1.1.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 798b22051b5439bc14e904ca15100297855790de5461ae3bd97e2ae7958a918e
4
- data.tar.gz: 442b81c27f3b6b1e976232c9b5d5913ca8e6912472844bf6a5793fb9472967fb
3
+ metadata.gz: d48c25c70be4ecf7e9259027311472836ae15ac5bcab901bd72f978d88b6a1dd
4
+ data.tar.gz: 22425037d5f13fed041314f7289db8a5ccd4c3e09bdd840b516ac06ff66708ad
5
5
  SHA512:
6
- metadata.gz: 6873343e324dfc5277b006f7f627f20da3e752c6c47634fd86be117047595b274f6a154ba7ba58deb5c4cbfb74e2283aac99bb844120838f1b605a4009adb49a
7
- data.tar.gz: cf090942b22a71fee223f94bd383f5c666a1c99a1db0626b25aa4ef709d8a6db697daef3876119ac288619cd124876b0b57eec7188848551cd7970da5011afa6
6
+ metadata.gz: 8d41074dd3a6a65bf1e836bb2d5e8bc53bb0bafbe001bf39cc321d00d3dda24495a79080d556c8bdb01ecef4e7fa58d1a233363c6b3ffd96d58019107c66b66f
7
+ data.tar.gz: '0187340295bc06bf0c7de18b9a27fb8202be3a6d7a2a898fb9d635eb0301440c5ae8bc344b9ddf2ef0c3ad722895acd9875e8c67f2dbecb1b3ab5eff8eb29f72'
@@ -1,3 +1,3 @@
1
1
  module SampleGemTwo
2
- VERSION = "1.0.0"
2
+ VERSION = "1.1.0"
3
3
  end
data/lib/SampleGemTwo.rb CHANGED
@@ -1,3 +1,5 @@
1
+
2
+ =begin
1
3
  require "SampleGemTwo/version"
2
4
  require 'SampleGemOne'
3
5
 
@@ -12,8 +14,65 @@ module SampleGemTwo
12
14
  puts " nw method new printer"
13
15
  ggk
14
16
  end
17
+ alias_method :printerold,:printer
15
18
  alias_method :printer,:newprinter
16
19
  end
17
20
 
18
21
 
19
22
  end
23
+
24
+ =end
25
+
26
+
27
+
28
+
29
+
30
+
31
+
32
+
33
+
34
+
35
+
36
+
37
+
38
+ require "SampleGemTwo/version"
39
+ require 'SampleGemOne'
40
+
41
+ module SampleGemTwo
42
+ include SampleGemOne
43
+
44
+ def SampleGemTwo.alias_method_chain(target, feature)
45
+ # Strip out punctuation on predicates or bang methods since
46
+ # e.g. target?_without_feature is not a valid method name.
47
+ aliased_target, punctuation = target.to_s.sub(/([?!=])$/, ''), $1
48
+ yield(aliased_target, punctuation) if block_given?
49
+
50
+ with_method, without_method = "#{aliased_target}_with_#{feature}#{punctuation}", "#{aliased_target}_without_#{feature}#{punctuation}"
51
+
52
+ alias_method without_method, target
53
+ alias_method target, with_method
54
+
55
+ case
56
+ when public_method_defined?(without_method)
57
+ public target
58
+ when protected_method_defined?(without_method)
59
+ protected target
60
+ when private_method_defined?(without_method)
61
+ private target
62
+ end
63
+ end
64
+
65
+ class B
66
+
67
+ end
68
+
69
+ class SampleGemOne::A
70
+ def printer_with_feature
71
+ puts " nw method new printer"
72
+
73
+ end
74
+ SampleGemTwo.alias_method_chain :printer,:feature
75
+ end
76
+
77
+
78
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: SampleGemTwo
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - siddu