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: 8e8556cfaf1595d2eb72719992509260d352faeb
4
- data.tar.gz: 52c2b2371600e9c2bb965738eafd44e3fbc80f38
3
+ metadata.gz: c57115ded4310e85bbbdb239dc51c0cc1531a4f7
4
+ data.tar.gz: 499924a1becdd6831bd49109d88e2a8b4359e34a
5
5
  SHA512:
6
- metadata.gz: b2ca07e9c000e0cd93770f5626af5d04d5d815a3a08890bf06c13263bd05c1c961d953316cefb086505e737bc6c483317206f5f4867a7b3e481ce50baf8c21ae
7
- data.tar.gz: 2ab210d21f3e5fff0f19eefa27cc117932071bb1898c4efa580e7433d00102c22783ef315c0c4cfbec63f96a23dc7ff4ca23287017d9a2f943786c606d3e2a0c
6
+ metadata.gz: 92551203b28319c79d725b10eede705461df39af610a350f512fe14db29f68662ada829d0ce376fa58f86d96fa8dc42a42c8c7c20a7d203940fa698b7d5a9623
7
+ data.tar.gz: 8a2bbb58f79cb9c16b342ec5cdaa0b367542e7023be64262dd5112318fca3548f247a8dacb5e47ef502028e31e804c5159af3bf4b116e87e53e9cd63cc0c046c
data/.travis.yml ADDED
@@ -0,0 +1,7 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.2.3
4
+ before_install:
5
+ - gem install bundler -v 1.10.6
6
+ script:
7
+ - rake spec
@@ -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 [Symbol] type
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(type, old_file_name, new_file_name, old_ast_path, new_ast_path)
22
+ def supports_change(context)
24
23
 
25
24
  end
26
25
 
@@ -1,5 +1,5 @@
1
1
  module MetaCommit
2
2
  module Contracts
3
- VERSION = "0.2.0"
3
+ VERSION = "0.3.0"
4
4
  end
5
5
  end
@@ -5,6 +5,7 @@ end
5
5
 
6
6
  require "meta_commit_contracts/version"
7
7
  require "meta_commit_contracts/ast"
8
+ require "meta_commit_contracts/change_context"
8
9
  require "meta_commit_contracts/contextual_ast"
9
10
  require "meta_commit_contracts/diff"
10
11
  require "meta_commit_contracts/errors"
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.2.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-05 00:00:00.000000000 Z
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