ruby-dagger 0.2.0 → 0.2.1

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: 4f9f8d4432457feb3dc6ba9ec83c29f75f2acf0844fd7c9b6ab123d3555f6d91
4
- data.tar.gz: 2bffbf05b225e888c28f36d3cb25c4277b616d35d6bcdec7bc40c5f7e266fd2e
3
+ metadata.gz: b4815548df0f3403101f979e8ac7be3af0cca871d6d800cd01186c958d2c112f
4
+ data.tar.gz: aeb7536387b287e3e7ea9be20c982d90efb022dc5d7487c435a814a8ed3f124f
5
5
  SHA512:
6
- metadata.gz: b1ec64aeaddec996a0235df76ebc797ab2ec0c04cef3aa1cc4482054a5d7248a4100d8e4420aeecbff6a3a589bf6664d96e75c3e974bc4cd7e14632f9cad49f8
7
- data.tar.gz: c30423f432e38dd25dbb525c2458b6508b746f4b53057b6ef27b8eca8fe4ca6ee996c2131e3cf1d8f8faa1633fb7f410c71d1366a27a1d13f795fefaf81090dc
6
+ metadata.gz: 59d586af2dd28e3a94412b7d160e95eb4de34bbac6864f58231fe82560b5201bbc73b38c57c4596685316f5b1ae66645edddb7a78e8cfea8323d88d3ea9ce047
7
+ data.tar.gz: c8c5e006cd4002ea99edd40e81767418333ec0681c9aea39510e41f8cc06a4a070e30d21ffb54e23d069f991fc7c1bcd3d9c493d17de4e45a25a876596e2d61b
@@ -8,8 +8,3 @@ Metrics/BlockLength:
8
8
  Style/BlockDelimiters:
9
9
  Exclude:
10
10
  - 'spec/*_spec.rb'
11
-
12
- # Rubocop 0.56 causes false positives
13
- # https://github.com/bbatsov/rubocop/issues/5887
14
- Lint/SplatKeywordArguments:
15
- Enabled: false
data/README.md CHANGED
@@ -1,4 +1,7 @@
1
- [![Gem Version](https://badge.fury.io/rb/ruby-dagger.svg)](https://badge.fury.io/rb/ruby-dagger) [![Maintainability](https://api.codeclimate.com/v1/badges/4038215eb129292a826d/maintainability)](https://codeclimate.com/github/notCalle/ruby-dagger/maintainability)
1
+ [![Gem Version](https://badge.fury.io/rb/ruby-dagger.svg)](https://badge.fury.io/rb/ruby-dagger)
2
+ [![Maintainability](https://api.codeclimate.com/v1/badges/4038215eb129292a826d/maintainability)](https://codeclimate.com/github/notCalle/ruby-dagger/maintainability)
3
+ [![codecov](https://codecov.io/gh/notCalle/ruby-dagger/branch/master/graph/badge.svg)](https://codecov.io/gh/notCalle/ruby-dagger)
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
  # Dagger
4
7
 
@@ -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 git-version-bump
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)
@@ -8,8 +8,8 @@ require 'dagger'
8
8
  # with your gem easier. You can also use a different console, if you like.
9
9
 
10
10
  # (If you use this, don't forget to add pry to your Gemfile!)
11
- # require 'pry'
12
- # Pry.start
11
+ require 'pry'
12
+ Pry.start
13
13
 
14
- require 'irb'
15
- IRB.start(__FILE__)
14
+ # require 'irb'
15
+ # IRB.start(__FILE__)
@@ -64,6 +64,7 @@ module Dagger
64
64
  # with_locked_key(key &->(locked_key)) => result
65
65
  def with_locked_key(key)
66
66
  raise %(deadlock detected: "#{key}") unless @locks.add?(key)
67
+
67
68
  yield(key)
68
69
  ensure
69
70
  @locks.delete(key)
@@ -76,6 +77,7 @@ module Dagger
76
77
  def cached_value(tree, key)
77
78
  result = process(key)
78
79
  return result unless result.nil?
80
+
79
81
  result = @fallback&.[](key)
80
82
  ensure
81
83
  tree[key] = result if cached? && !result.nil?
@@ -76,6 +76,7 @@ module Dagger
76
76
  hash = Hash.new do |_, key|
77
77
  result = @context.dictionary[key]
78
78
  next result unless result.nil?
79
+
79
80
  return nil
80
81
  end
81
82
 
@@ -38,6 +38,7 @@ module Dagger
38
38
  enumerable(regexps).each_with_object({}) do |regexp, matches|
39
39
  matchdata = ::Regexp.new(regexp).match(string)
40
40
  next if matchdata.nil?
41
+
41
42
  matches.merge!(matchdata.named_captures.transform_keys(&:to_sym))
42
43
  end
43
44
  end
@@ -50,6 +50,7 @@ module Dagger
50
50
  vertex = Vertex.new(path, cached: cached?)
51
51
  add_vertex(vertex)
52
52
  return true if parent.nil?
53
+
53
54
  parent = local_path(parent)
54
55
  defer_edge(parent, path)
55
56
  end
@@ -67,6 +68,7 @@ module Dagger
67
68
 
68
69
  result = path.delete_prefix(root_directory)
69
70
  return '/' if result.empty?
71
+
70
72
  result
71
73
  end
72
74
 
@@ -39,13 +39,15 @@ module Dagger
39
39
 
40
40
  def [](key)
41
41
  key = key.to_key_path
42
- @inherited[key.drop(1)] if key.prefix?('^')
42
+ return @inherited[key.drop(1)] if key.prefix?('^')
43
+
43
44
  @forest[key]
44
45
  end
45
46
 
46
47
  def fetch(key, *default, &block)
47
48
  key = key.to_key_path
48
- @inherited.fetch(key.drop(1), *default, &block) if key.prefix?('^')
49
+ return @inherited.fetch(key.drop(1), *default, &block) if key.prefix?('^')
50
+
49
51
  @forest.fetch(key, *default, &block)
50
52
  end
51
53
 
@@ -55,21 +57,25 @@ module Dagger
55
57
 
56
58
  def edge_added(edge)
57
59
  return unless edge.head?(self)
60
+
58
61
  @inherited << edge.tail.to_key_wood
59
62
  end
60
63
 
61
64
  def edge_removed(edge)
62
65
  return unless edge.head?(self)
66
+
63
67
  @inherited.reject! { |tree| tree.equal?(edge.tail.to_key_wood) }
64
68
  end
65
69
 
66
70
  def added_to_graph(graph)
67
71
  raise %(belongs another graph) if @graph&.!= graph
72
+
68
73
  @graph = graph
69
74
  end
70
75
 
71
76
  def removed_from_graph(graph)
72
77
  raise %(not part of graph) if @graph&.!= graph
78
+
73
79
  @graph = nil
74
80
  end
75
81
 
@@ -82,6 +88,7 @@ module Dagger
82
88
 
83
89
  flattened = forest.flatten
84
90
  return flattened unless cleanup
91
+
85
92
  flattened.to_h.delete_if { |key| key.to_s.start_with?('_') }
86
93
  flattened
87
94
  end
@@ -94,8 +101,8 @@ module Dagger
94
101
  flatten(cleanup: true).to_yaml
95
102
  end
96
103
 
97
- def to_json
98
- flatten(cleanup: true).to_json
104
+ def to_json(*args)
105
+ flatten(cleanup: true).to_json(*args)
99
106
  end
100
107
 
101
108
  private
@@ -5,6 +5,18 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
5
 
6
6
  require 'dagger/version'
7
7
 
8
+ dev_deps = {
9
+ 'bundler' => '~> 2.0',
10
+ 'codecov' => '~> 0.1',
11
+ 'git-version-bump' => '~> 0.15',
12
+ 'pry' => '~> 0.11',
13
+ 'rake' => '~> 10.0',
14
+ 'rspec' => '~> 3.0',
15
+ 'rubocop' => '~> 0.57',
16
+ 'ruby-prof' => '~> 0.17',
17
+ 'simplecov' => '~> 0.16'
18
+ }
19
+
8
20
  Gem::Specification.new do |spec|
9
21
  spec.name = 'ruby-dagger'
10
22
  spec.version = Dagger::VERSION
@@ -28,11 +40,5 @@ Gem::Specification.new do |spec|
28
40
  spec.add_dependency 'key_tree', '~> 0.6'
29
41
  spec.add_dependency 'tangle', '~> 0.10'
30
42
 
31
- spec.add_development_dependency 'bundler', '~> 1.16'
32
- spec.add_development_dependency 'git-version-bump', '~> 0.15'
33
- spec.add_development_dependency 'rake', '~> 10.0'
34
- spec.add_development_dependency 'rspec', '~> 3.0'
35
- spec.add_development_dependency 'rubocop', '~> 0.52'
36
- spec.add_development_dependency 'ruby-prof', '~> 0.17'
37
- spec.add_development_dependency 'simplecov', '~> 0.16'
43
+ dev_deps.each { |d| spec.add_development_dependency(*d) }
38
44
  end
@@ -0,0 +1,8 @@
1
+ {
2
+ "folders":
3
+ [
4
+ {
5
+ "path": "."
6
+ }
7
+ ]
8
+ }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-dagger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Calle Englund
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-06-03 00:00:00.000000000 Z
11
+ date: 2019-07-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: key_tree
@@ -44,14 +44,28 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '1.16'
47
+ version: '2.0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '1.16'
54
+ version: '2.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: codecov
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '0.1'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '0.1'
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: git-version-bump
57
71
  requirement: !ruby/object:Gem::Requirement
@@ -66,6 +80,20 @@ dependencies:
66
80
  - - "~>"
67
81
  - !ruby/object:Gem::Version
68
82
  version: '0.15'
83
+ - !ruby/object:Gem::Dependency
84
+ name: pry
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '0.11'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '0.11'
69
97
  - !ruby/object:Gem::Dependency
70
98
  name: rake
71
99
  requirement: !ruby/object:Gem::Requirement
@@ -100,14 +128,14 @@ dependencies:
100
128
  requirements:
101
129
  - - "~>"
102
130
  - !ruby/object:Gem::Version
103
- version: '0.52'
131
+ version: '0.57'
104
132
  type: :development
105
133
  prerelease: false
106
134
  version_requirements: !ruby/object:Gem::Requirement
107
135
  requirements:
108
136
  - - "~>"
109
137
  - !ruby/object:Gem::Version
110
- version: '0.52'
138
+ version: '0.57'
111
139
  - !ruby/object:Gem::Dependency
112
140
  name: ruby-prof
113
141
  requirement: !ruby/object:Gem::Requirement
@@ -152,6 +180,7 @@ files:
152
180
  - LICENSE.txt
153
181
  - README.md
154
182
  - Rakefile
183
+ - azure-pipelines.yml
155
184
  - bin/console
156
185
  - bin/setup
157
186
  - lib/dagger.rb
@@ -166,6 +195,7 @@ files:
166
195
  - lib/dagger/version.rb
167
196
  - lib/dagger/vertex.rb
168
197
  - ruby-dagger.gemspec
198
+ - ruby-dagger.sublime-project
169
199
  homepage: https://github.com/notcalle/ruby-dagger
170
200
  licenses:
171
201
  - MIT
@@ -185,8 +215,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
185
215
  - !ruby/object:Gem::Version
186
216
  version: '0'
187
217
  requirements: []
188
- rubyforge_project:
189
- rubygems_version: 2.7.6
218
+ rubygems_version: 3.0.3
190
219
  signing_key:
191
220
  specification_version: 4
192
221
  summary: Manage a DAG, stored in posix file structures