treedent 1.0.0 → 1.1.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
- SHA1:
3
- metadata.gz: 4c91cc4f4bd56c3fdd07cc036caeca834c7fff5c
4
- data.tar.gz: c960c0c65cd6ece8ba22179c6538d24db912ec10
2
+ SHA256:
3
+ metadata.gz: 1878bf058724bab25716e71029c7e41ea98c3a8b6f1ecffd3c0920ca75b6dc73
4
+ data.tar.gz: c9b193181785038f20d9ce58a10b540eec4c6ad1512f789dddedb2c3040b7097
5
5
  SHA512:
6
- metadata.gz: 2dc9bc4fb346b5ec81d7a5ba1ef28c7690758ad6376d06761bb13dfbcc29d584746d93f59d75b55917c0a130d0629c24b752f6dd148143c3015b8d940751de74
7
- data.tar.gz: 9b347be2e2c4a8c26d5539394c3d051fd8c3dedea9fe9cb4eca4f00f142c96c41f6f87e697fa4a55403b205fe2bf676520d326421709c978a589654f22559c24
6
+ metadata.gz: 32890632bdf5fda43ac195fb1abdc94a767852acf9fc593c7418250d8e2018c2017533bddf9fa693ae25879b39fd123315739ceb07eebb70c429fa7cd3873a27
7
+ data.tar.gz: e999e84cb744934fac7af3929381e3769977d62af29c4d325ade8190c0e2d8b4b57acc26626a0b1301bc3e3197c7601e02af389f4732e01f232b4a84aef61ad2
@@ -1,5 +1,7 @@
1
1
  sudo: false
2
2
  language: ruby
3
3
  rvm:
4
- - 2.4.0
5
- before_install: gem install bundler -v 1.14.6
4
+ - 2.5.7
5
+ - 2.6.5
6
+ - 2.7.0
7
+ before_install: gem install bundler -v 2.1
File without changes
data/README.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Treedent
2
2
 
3
+ [![Gem Version](https://badge.fury.io/rb/treedent.svg)](https://badge.fury.io/rb/treedent)
4
+ [![Build Status](https://travis-ci.org/Aupajo/treedent.svg?branch=master)](https://travis-ci.org/Aupajo/treedent)
5
+ [![Code Climate](https://codeclimate.com/github/Aupajo/treedent.png)](https://codeclimate.com/github/Aupajo/treedent)
6
+
7
+
3
8
  A command-line tool for generating `tree`-like formatted output from indented plain text.
4
9
 
5
10
  ## Installation
@@ -2,13 +2,14 @@ require 'strscan'
2
2
 
3
3
  module Treedent
4
4
  class IndentedLine < Struct.new(:indentation, :content)
5
- WHITESPACE_PATTERN = /[ \t]*/
5
+ WHITESPACE_PATTERN = /[ \t]*/.freeze
6
6
 
7
7
  def self.from(line_string)
8
8
  scanner = StringScanner.new(line_string)
9
- indentation = scanner.scan(WHITESPACE_PATTERN)&.length || 0
9
+ scan = scanner.scan(WHITESPACE_PATTERN)
10
+ indentation = (scan && scan.length) || 0
10
11
  content = scanner.rest
11
- self.new(indentation, content)
12
+ new(indentation, content)
12
13
  end
13
14
  end
14
15
  end
@@ -32,18 +32,18 @@ module Treedent
32
32
  end
33
33
 
34
34
  def ancestors(&block)
35
- return enum_for(:ancestors) unless block_given?
36
35
  traverse_relationship(:parent, &block)
37
36
  end
38
37
 
39
38
  def successors(&block)
40
- return enum_for(:successors) unless block_given?
41
39
  traverse_relationship(:successor, &block)
42
40
  end
43
41
 
44
42
  private
45
43
 
46
44
  def traverse_relationship(relation, &block)
45
+ return enum_for(:traverse_relationship, relation) unless block_given?
46
+
47
47
  node = self
48
48
  yield node while node = node.public_send(relation)
49
49
  end
@@ -1,3 +1,3 @@
1
1
  module Treedent
2
- VERSION = "1.0.0"
2
+ VERSION = "1.1.0"
3
3
  end
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
20
20
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
21
21
  spec.require_paths = ["lib"]
22
22
 
23
- spec.add_development_dependency "bundler", "~> 1.14"
24
- spec.add_development_dependency "rake", "~> 10.0"
23
+ spec.add_development_dependency "bundler", "~> 2.1"
24
+ spec.add_development_dependency "rake", "~> 13.0"
25
25
  spec.add_development_dependency "minitest", "~> 5.0"
26
26
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: treedent
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
  - Pete Nicholls
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-04-25 00:00:00.000000000 Z
11
+ date: 2020-03-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.14'
19
+ version: '2.1'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.14'
26
+ version: '2.1'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '10.0'
33
+ version: '13.0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '10.0'
40
+ version: '13.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: minitest
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -62,6 +62,7 @@ extra_rdoc_files: []
62
62
  files:
63
63
  - ".gitignore"
64
64
  - ".travis.yml"
65
+ - CHANGELOG.md
65
66
  - CODE_OF_CONDUCT.md
66
67
  - Gemfile
67
68
  - LICENSE.txt
@@ -99,8 +100,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
99
100
  - !ruby/object:Gem::Version
100
101
  version: '0'
101
102
  requirements: []
102
- rubyforge_project:
103
- rubygems_version: 2.6.8
103
+ rubygems_version: 3.1.2
104
104
  signing_key:
105
105
  specification_version: 4
106
106
  summary: A command-line tool for formatting indented text like `tree`.