with_refinements 0.1.0 → 0.2.0

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
  SHA256:
3
- metadata.gz: 8ed88208774c583de9ae5d936001beff3a33fb2971ea783d8d58d9faef30927e
4
- data.tar.gz: bfa465a864d428f0e4e9801c4f5c10cf2fbd10c83f21fd9ce2d85ea72f2af63d
3
+ metadata.gz: f18d8995a03d3979fc50076101c166bf181866148f3fe3a1b9dd0e32f7fed994
4
+ data.tar.gz: b93e256827989dc0e67a08fba85f12a6da6bc7a16aa1c27709f66eea0b9eec66
5
5
  SHA512:
6
- metadata.gz: b7c41fc6093490ea293711b46db1f64f920d2b16ba65c1a46e84cae86935cf664b150559773f40d44f4fa41c20144924cea072156a0b820497f6090b9e4a4557
7
- data.tar.gz: b6716ca59c01bd095530b489b872d69da79094ec4355be0248171475ae1b84848fc96ce8a3476ac468f527eeaef35ab04f56eafcdeabb7ce65a94c45e3ecb383
6
+ metadata.gz: 7fef70554e305fa8e3d18a2931b91b88b4952c011c97e8cd28674295e9205ef4929bf22c9a77cba7c0d42d4eace8a02767d0568726f14d4a6ce0cd6f5df154e5
7
+ data.tar.gz: f8e736658cde638e74292de53274b23372422f16f9122becf410239f474fcabdb51261b6bccf6eae1adc6f5d9ee55edf2bb342baee65c3cc4769cd575a083508
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- with_refinements (0.1.0)
4
+ with_refinements (0.2.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -29,8 +29,8 @@ module Greeting
29
29
  end
30
30
  end
31
31
 
32
- # the refinement are activated inside the block
33
- with_refienements(Greeting) do
32
+ # the refinements are activated inside the block
33
+ with_refinements(Greeting) do
34
34
  hello
35
35
  end
36
36
 
@@ -11,7 +11,11 @@ module WithRefinements
11
11
  loc = iseq[4].yield_self {|h| h[:code_range] || h[:code_location] }
12
12
  path = iseq[7]
13
13
  File.readlines(path)[loc[0]-1..loc[2]-1].tap {|ls|
14
- ls[0], ls[-1] = ls[0][loc[1]..-1], ls[-1][0..loc[3]]
14
+ if loc[0] == loc[2]
15
+ ls[0] = ls[0][loc[1]...loc[3]]
16
+ else
17
+ ls[0], ls[-1] = ls[0][loc[1]..-1], ls[-1][0..loc[3]]
18
+ end
15
19
  }.join
16
20
  end
17
21
  end
@@ -1,3 +1,3 @@
1
1
  module WithRefinements
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: with_refinements
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Seiei Miyagi
@@ -34,7 +34,7 @@ cert_chain:
34
34
  OKwDKKYe2ogJ/XrOjTltlugSNvq/NgD53wc4TA0F5KofdIZSJELTCUyyZMPztwI4
35
35
  OawPtyIyOegL6pM8fc7IfzLzjkdO3Bis1qFZcg==
36
36
  -----END CERTIFICATE-----
37
- date: 2018-06-01 00:00:00.000000000 Z
37
+ date: 2018-07-31 00:00:00.000000000 Z
38
38
  dependencies:
39
39
  - !ruby/object:Gem::Dependency
40
40
  name: bundler
metadata.gz.sig CHANGED
Binary file