meta_commit_contracts 0.2.0 → 0.3.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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c57115ded4310e85bbbdb239dc51c0cc1531a4f7
|
4
|
+
data.tar.gz: 499924a1becdd6831bd49109d88e2a8b4359e34a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 92551203b28319c79d725b10eede705461df39af610a350f512fe14db29f68662ada829d0ce376fa58f86d96fa8dc42a42c8c7c20a7d203940fa698b7d5a9623
|
7
|
+
data.tar.gz: 8a2bbb58f79cb9c16b342ec5cdaa0b367542e7023be64262dd5112318fca3548f247a8dacb5e47ef502028e31e804c5159af3bf4b116e87e53e9cd63cc0c046c
|
data/.travis.yml
ADDED
@@ -2,7 +2,6 @@ module MetaCommit::Contracts
|
|
2
2
|
# Structure which is returned by parser and can be traversed to collect children node information
|
3
3
|
# @attr [Class] parser_class class which was used to parse this ast
|
4
4
|
class Ast
|
5
|
-
|
6
5
|
attr_accessor :parser_class
|
7
6
|
|
8
7
|
# @return [Array<MetaCommit::Contracts::Ast>] children ast
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module MetaCommit::Contracts
|
2
|
+
# DTO that keeps data of context of change
|
3
|
+
# @attr [Symbol] type
|
4
|
+
# @attr [Numeric] line
|
5
|
+
# @attr [String] commit_id_old
|
6
|
+
# @attr [String] commit_id_new
|
7
|
+
# @attr [MetaCommit::Contracts::ContextualAst] old_contextual_ast
|
8
|
+
# @attr [MetaCommit::Contracts::ContextualAst] new_contextual_ast
|
9
|
+
# @attr [String] old_file_path
|
10
|
+
# @attr [String] new_file_path
|
11
|
+
class ChangeContext
|
12
|
+
attr_accessor :type,
|
13
|
+
:old_lineno, :new_lineno,
|
14
|
+
:commit_id_old, :commit_id_new,
|
15
|
+
:old_contextual_ast, :new_contextual_ast,
|
16
|
+
:old_file_path, :new_file_path
|
17
|
+
end
|
18
|
+
end
|
@@ -1,7 +1,10 @@
|
|
1
1
|
module MetaCommit::Contracts
|
2
2
|
# Diff contains data from changed element and is responsible for printing structured, user friendly message about change
|
3
|
+
# @attr [MetaCommit::Contracts::ChangeContext] change_context
|
3
4
|
class Diff
|
4
5
|
|
6
|
+
attr_writer :change_context
|
7
|
+
|
5
8
|
TYPE_ADDITION = :addition
|
6
9
|
TYPE_DELETION = :deletion
|
7
10
|
TYPE_REPLACE = :replace
|
@@ -14,13 +17,9 @@ module MetaCommit::Contracts
|
|
14
17
|
|
15
18
|
end
|
16
19
|
|
17
|
-
# @param [
|
18
|
-
# @param [String] old_file_name
|
19
|
-
# @param [String] new_file_name
|
20
|
-
# @param [] old_ast_path
|
21
|
-
# @param [] new_ast_path
|
20
|
+
# @param [MetaCommit::Contracts::ChangeContext] context
|
22
21
|
# @return [Boolean]
|
23
|
-
def supports_change(
|
22
|
+
def supports_change(context)
|
24
23
|
|
25
24
|
end
|
26
25
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: meta_commit_contracts
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stanislav Dobrovolskiy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-01-
|
11
|
+
date: 2018-01-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -61,6 +61,7 @@ extra_rdoc_files: []
|
|
61
61
|
files:
|
62
62
|
- ".gitignore"
|
63
63
|
- ".rspec"
|
64
|
+
- ".travis.yml"
|
64
65
|
- CODE_OF_CONDUCT.md
|
65
66
|
- Gemfile
|
66
67
|
- LICENSE.txt
|
@@ -70,6 +71,7 @@ files:
|
|
70
71
|
- bin/setup
|
71
72
|
- lib/meta_commit_contracts.rb
|
72
73
|
- lib/meta_commit_contracts/ast.rb
|
74
|
+
- lib/meta_commit_contracts/change_context.rb
|
73
75
|
- lib/meta_commit_contracts/contextual_ast.rb
|
74
76
|
- lib/meta_commit_contracts/diff.rb
|
75
77
|
- lib/meta_commit_contracts/errors.rb
|