tangle 0.10.1 → 0.10.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +31 -0
- data/Gemfile +2 -8
- data/README.md +7 -2
- data/azure-pipelines.yml +22 -0
- data/bin/setup +0 -1
- data/lib/tangle/base_graph.rb +6 -0
- data/lib/tangle/base_graph_protected.rb +6 -0
- data/lib/tangle/currify.rb +9 -0
- data/lib/tangle/undirected/graph.rb +2 -2
- data/lib/tangle/version.rb +7 -5
- data/ruby-tangle.sublime-project +8 -0
- data/tangle.gemspec +12 -8
- metadata +22 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3e6a0584872a8ae1df5d34e930cf39a4c83fd2b9b030f1b36e4485a7399f8823
|
4
|
+
data.tar.gz: e29307f7ab2226d172912f4241c9bff7c406a000344f65b5a145bb40415544ea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 031fbb0a746400aa40fd5aa410547729bbadc368098209d6fdcc1dc70b7b47381147a6eaedbb4f0a14d19645183aac34cfef383bcaabb5b9645d51ce905f1e85
|
7
|
+
data.tar.gz: 5e54ebabd5abce32799e571901a59ccfa2422cb678de6687ffaf9cdeb901e01994ea30ffdeac9da23d19bb2fc763d0833205086ba6eda55dba280183539cda52
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
# Changelog
|
2
|
+
All notable changes to this project will be documented in this file.
|
3
|
+
|
4
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
5
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
6
|
+
|
7
|
+
## [Unreleased]
|
8
|
+
|
9
|
+
|
10
|
+
## [0.10.2] - 2019-07-05
|
11
|
+
|
12
|
+
### Changed
|
13
|
+
|
14
|
+
- `Currify::currify`now raises a `CurrifyError` < `ArgumentError` when the
|
15
|
+
method takes no arguments, instead of the curried method failing when called
|
16
|
+
|
17
|
+
- Development dependency on `bundler` is updated to `~> 2.0`.
|
18
|
+
|
19
|
+
### Fixed
|
20
|
+
|
21
|
+
- `Graph#connected_subgraph` and `Graph#disconnected_subgraph` called an invalid
|
22
|
+
method to determine connectedness of candidate vertices
|
23
|
+
|
24
|
+
|
25
|
+
## [Older]
|
26
|
+
These releases have no change logs.
|
27
|
+
|
28
|
+
|
29
|
+
[Unreleased]: https://github.com/notCalle/ruby-tangle/compare/v0.3.0..HEAD
|
30
|
+
[0.10.2]: https://github.com/notCalle/ruby-tangle/compare/v0.10.1..v0.10.2
|
31
|
+
[Older]: https://github.com/notCalle/ruby-tangle/releases/tag/v0.10.1
|
data/Gemfile
CHANGED
@@ -4,11 +4,5 @@ source 'https://rubygems.org'
|
|
4
4
|
|
5
5
|
git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
rescue LoadError
|
10
|
-
gem 'git-version-bump', '~> 0.15'
|
11
|
-
else
|
12
|
-
# Specify your gem's dependencies in tangle.gemspec
|
13
|
-
gemspec
|
14
|
-
end
|
7
|
+
# Specify your gem's dependencies in tangle.gemspec
|
8
|
+
gemspec
|
data/README.md
CHANGED
@@ -1,4 +1,7 @@
|
|
1
|
-
[![Gem Version](https://badge.fury.io/rb/tangle.svg)](https://badge.fury.io/rb/tangle)
|
1
|
+
[![Gem Version](https://badge.fury.io/rb/tangle.svg)](https://badge.fury.io/rb/tangle)
|
2
|
+
[![Maintainability](https://api.codeclimate.com/v1/badges/0d92a4d05b6bb5c06dce/maintainability)](https://codeclimate.com/github/notCalle/ruby-tangle/maintainability)
|
3
|
+
[![codecov](https://codecov.io/gh/notCalle/ruby-tangle/branch/master/graph/badge.svg)](https://codecov.io/gh/notCalle/ruby-tangle)
|
4
|
+
[![Build Status](https://dev.azure.com/notCalle/GitHub%20CI/_apis/build/status/notCalle.ruby-tangle)](https://dev.azure.com/notCalle/GitHub%20CI/_build/latest?definitionId=2)
|
2
5
|
|
3
6
|
# Tangle
|
4
7
|
|
@@ -12,10 +15,12 @@ Tangle aims to untangle your graphs, by providing a set of classes for managing
|
|
12
15
|
* ~~Tree~~
|
13
16
|
|
14
17
|
**Feature mixins**:
|
15
|
-
*
|
18
|
+
* Filesystem directory graph
|
16
19
|
* ~~Coloring~~
|
17
20
|
* ~~GraphViz~~
|
18
21
|
|
22
|
+
See the [changelog](CHANGELOG.md) for recent changes.
|
23
|
+
|
19
24
|
## Installation
|
20
25
|
|
21
26
|
Add this line to your application's Gemfile:
|
data/azure-pipelines.yml
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
# Ruby
|
2
|
+
# Package your Ruby project.
|
3
|
+
# Add steps that install rails, analyze code, save build artifacts, deploy, and more:
|
4
|
+
# https://docs.microsoft.com/azure/devops/pipelines/languages/ruby
|
5
|
+
|
6
|
+
pool:
|
7
|
+
vmImage: 'Ubuntu 16.04'
|
8
|
+
|
9
|
+
steps:
|
10
|
+
- task: UseRubyVersion@0
|
11
|
+
inputs:
|
12
|
+
versionSpec: '>= 2.5'
|
13
|
+
|
14
|
+
- script: |
|
15
|
+
gem install bundler
|
16
|
+
bin/setup
|
17
|
+
displayName: 'bundle install'
|
18
|
+
|
19
|
+
- script: bundle exec rake
|
20
|
+
displayName: 'bundle exec rake'
|
21
|
+
env:
|
22
|
+
CODECOV_TOKEN: $(codecov.token)
|
data/bin/setup
CHANGED
data/lib/tangle/base_graph.rb
CHANGED
@@ -7,6 +7,12 @@ module Tangle
|
|
7
7
|
module BaseGraphProtected
|
8
8
|
protected
|
9
9
|
|
10
|
+
def copy_vertices_and_edges(from)
|
11
|
+
@vertices = from.instance_variable_get(:@vertices).dup
|
12
|
+
@vertices_by_name = from.instance_variable_get(:@vertices_by_name).dup
|
13
|
+
@edges = from.instance_variable_get(:@edges).dup
|
14
|
+
end
|
15
|
+
|
10
16
|
def select_vertices!(selected = nil)
|
11
17
|
vertices.each do |vertex|
|
12
18
|
delete_vertex(vertex) if block_given? && !yield(vertex)
|
data/lib/tangle/currify.rb
CHANGED
@@ -1,6 +1,13 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module Tangle
|
4
|
+
# Raised for zero arity of a currified method, subclass of ArgumentError
|
5
|
+
class CurrifyError < ArgumentError
|
6
|
+
def initialize(msg = 'method accepts no arguments', *)
|
7
|
+
super
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
4
11
|
# Currification of instance methods, for adding callbacks to other objects
|
5
12
|
module Currify
|
6
13
|
def self.included(base)
|
@@ -28,6 +35,8 @@ module Tangle
|
|
28
35
|
# class X
|
29
36
|
# currify :tag, :method
|
30
37
|
def currify(tag, method)
|
38
|
+
raise CurrifyError if instance_method(method).arity.zero?
|
39
|
+
|
31
40
|
@currified_methods ||= {}
|
32
41
|
@currified_methods[tag] ||= []
|
33
42
|
@currified_methods[tag] << method
|
@@ -25,7 +25,7 @@ module Tangle
|
|
25
25
|
# connected_subgraph(vertex) => Graph
|
26
26
|
#
|
27
27
|
def connected_subgraph(vertex)
|
28
|
-
subgraph { |other|
|
28
|
+
subgraph { |other| connected?(vertex, other) }
|
29
29
|
end
|
30
30
|
alias component connected_subgraph
|
31
31
|
alias connected_component connected_subgraph
|
@@ -34,7 +34,7 @@ module Tangle
|
|
34
34
|
# left after removing the connected subgraph.
|
35
35
|
#
|
36
36
|
def disconnected_subgraph(vertex)
|
37
|
-
subgraph { |other| !
|
37
|
+
subgraph { |other| !connected?(vertex, other) }
|
38
38
|
end
|
39
39
|
|
40
40
|
# A graph is connected if all vertices are connected to all vertices
|
data/lib/tangle/version.rb
CHANGED
@@ -1,8 +1,10 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
3
|
+
module Tangle # rubocop:disable Style/Documentation
|
4
|
+
begin
|
5
|
+
require 'git-version-bump'
|
6
|
+
VERSION = GVB.version.freeze
|
7
|
+
rescue LoadError
|
8
|
+
VERSION = '0.0.0.UNDEF'
|
9
|
+
end
|
8
10
|
end
|
data/tangle.gemspec
CHANGED
@@ -4,10 +4,20 @@ lib = File.expand_path('lib', __dir__)
|
|
4
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
5
|
require 'tangle/version'
|
6
6
|
|
7
|
+
dev_deps = {
|
8
|
+
'bundler' => '~> 2.0',
|
9
|
+
'codecov' => '~> 0.1',
|
10
|
+
'fasterer' => '~> 0.4',
|
11
|
+
'pry' => '~> 0.11',
|
12
|
+
'rake' => '~> 10.0',
|
13
|
+
'rspec' => '~> 3.0',
|
14
|
+
'rubocop' => '~> 0.57',
|
15
|
+
'simplecov' => '~> 0.16'
|
16
|
+
}
|
17
|
+
|
7
18
|
Gem::Specification.new do |spec|
|
8
19
|
spec.name = 'tangle'
|
9
20
|
spec.version = Tangle::VERSION
|
10
|
-
spec.date = Tangle::DATE
|
11
21
|
spec.authors = ['Calle Englund']
|
12
22
|
spec.email = ['calle@discord.bofh.se']
|
13
23
|
|
@@ -27,11 +37,5 @@ Gem::Specification.new do |spec|
|
|
27
37
|
|
28
38
|
spec.add_dependency 'git-version-bump', '~> 0.15'
|
29
39
|
|
30
|
-
|
31
|
-
spec.add_development_dependency 'fasterer', '~> 0.4'
|
32
|
-
spec.add_development_dependency 'pry', '~> 0.11'
|
33
|
-
spec.add_development_dependency 'rake', '~> 10.0'
|
34
|
-
spec.add_development_dependency 'rspec', '~> 3.0'
|
35
|
-
spec.add_development_dependency 'rubocop', '~> 0.57'
|
36
|
-
spec.add_development_dependency 'simplecov', '~> 0.16'
|
40
|
+
dev_deps.each { |d| spec.add_development_dependency(*d) }
|
37
41
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tangle
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.10.
|
4
|
+
version: 0.10.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Calle Englund
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-07-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: git-version-bump
|
@@ -30,14 +30,28 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '2.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: '
|
40
|
+
version: '2.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: codecov
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0.1'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0.1'
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: fasterer
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -133,11 +147,13 @@ files:
|
|
133
147
|
- ".rspec"
|
134
148
|
- ".rubocop.yml"
|
135
149
|
- ".travis.yml"
|
150
|
+
- CHANGELOG.md
|
136
151
|
- CODE_OF_CONDUCT.md
|
137
152
|
- Gemfile
|
138
153
|
- LICENSE.txt
|
139
154
|
- README.md
|
140
155
|
- Rakefile
|
156
|
+
- azure-pipelines.yml
|
141
157
|
- bin/console
|
142
158
|
- bin/setup
|
143
159
|
- lib/tangle.rb
|
@@ -157,6 +173,7 @@ files:
|
|
157
173
|
- lib/tangle/undirected/graph.rb
|
158
174
|
- lib/tangle/undirected/simple/graph.rb
|
159
175
|
- lib/tangle/version.rb
|
176
|
+
- ruby-tangle.sublime-project
|
160
177
|
- tangle.gemspec
|
161
178
|
homepage: https://github.com/notcalle/ruby-tangle
|
162
179
|
licenses:
|
@@ -177,8 +194,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
177
194
|
- !ruby/object:Gem::Version
|
178
195
|
version: '0'
|
179
196
|
requirements: []
|
180
|
-
|
181
|
-
rubygems_version: 2.7.6
|
197
|
+
rubygems_version: 3.0.3
|
182
198
|
signing_key:
|
183
199
|
specification_version: 4
|
184
200
|
summary: Tangle implements graphs of things
|