get_indent 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/get_indent.rb +10 -0
  3. metadata +3 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9a817ade2197ab997e6aa5ec833fdfed2239e2b3
4
- data.tar.gz: 8f99bc07d97ce1100187d989d309397d6b6776e3
3
+ metadata.gz: 4cfa2df5b7a1cdb05ffa665500fb829108f598b3
4
+ data.tar.gz: f3d6141abdcb672183ba8ec127d654eb053f94a2
5
5
  SHA512:
6
- metadata.gz: 2110c6de0b929face515625d7f62622c58deaf1a3876c9201d8a82e5a69624b69adb67d5e9795287afdf6db685aa7c5f01d635e5555ceaf1742b66a34e1446bf
7
- data.tar.gz: 731f331c6583f5ab991132905e058cd87d6532523e211be377209970f8797b8b6a4980b3a94b3a5bb3fb09534c607ea69da612405ae522b0344777be3c5c22b4
6
+ metadata.gz: d64e5c50965ab2ec6e8fd3853b28108b0026e61606be3371e4c190822b402f0ec719a13e1b55aec621eb15b0d1326ba754ca3dce672f39a9eacab9194acf4f34
7
+ data.tar.gz: e58e342abd7857b4d12c61918723eb7c8958e56c82894f138434a9035a1d3c22df64abcf8566676bfd9cc5538f4e859f95a19e489da5a957c6957e460560e9c7
data/lib/get_indent.rb ADDED
@@ -0,0 +1,10 @@
1
+ def __indent__
2
+ caller = caller_locations(1,1)[0]
3
+ line = IO.readlines(caller.absolute_path)[caller.lineno-1]
4
+
5
+ cnt = 0
6
+ line.each_char do |c|
7
+ return cnt / 2 if c != ' '
8
+ cnt += 1
9
+ end
10
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: get_indent
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - pjc0247
@@ -16,7 +16,8 @@ email:
16
16
  executables: []
17
17
  extensions: []
18
18
  extra_rdoc_files: []
19
- files: []
19
+ files:
20
+ - lib/get_indent.rb
20
21
  homepage: http://github.com/pjc0247/indent
21
22
  licenses: []
22
23
  metadata: {}