pronto-flow 0.8.2 → 0.9.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: 43a98d9323d5fad4588a3f824cdffc769af7d7ca
4
- data.tar.gz: eb79982e5f36586cebacf8d02fda5342d228c1d8
3
+ metadata.gz: 770b2efce1612e260245a048f5129181d71ac6e9
4
+ data.tar.gz: 2292d758c97961ea54e7e64adc67801701b30efc
5
5
  SHA512:
6
- metadata.gz: b539db7bff0a2e7dd78e97ae9ad4682e17aceee5bf3cbaaeb337912ec283dc9c9bca5b23a143a9db38db47418b8d9da4f3f4815bbac04a062189f6a6e0aa3b55
7
- data.tar.gz: f8dc82643ccf728e3b7f4728cf37a2bc8fcd57f68b3fa8c417a5d9e65b552d09a159d840e780c1882104a2f6a36158327103f2943d2f9d62e4bac60c4dfd4b82
6
+ metadata.gz: ded2b52b2535c8d8a9888c0aac6d2ba59c1b56bf60e3ef60495e56f1695eaeffe4ae677f5a43a8440c98178e0d2b268c196618280cc3570b0851f7dac345368e
7
+ data.tar.gz: 08b74f5d0558d6784c84334fdad7304bae283ad1d4fa38e07d550a7f184c8eb1068cd311593e5b882695d0f6c054ee66bc724561908584c170683f9caa94900d
data/README.md CHANGED
@@ -27,10 +27,12 @@ Following options are available:
27
27
  | Option | Meaning | Default |
28
28
  | -------------------- | -------------------------------------- | ----------------------------------------- |
29
29
  | flow_executable | flow executable to call. | `flow` (calls `flow` in `PATH`) |
30
+ | cli_options | Options to pass to the CLI. | `--json` |
30
31
 
31
32
  Example configuration to call custom flow executable:
32
33
 
33
34
  ```yaml
34
35
  # .pronto_flow.yml
35
36
  flow_executable: '/my/custom/node/path/.bin/flow'
37
+ cli_options: '--show-all-errors'
36
38
  ```
@@ -4,14 +4,23 @@ require 'shellwords'
4
4
  module Pronto
5
5
  class Flow < Runner
6
6
  CONFIG_FILE = '.pronto_flow.yml'.freeze
7
- CONFIG_KEYS = %w(flow_executable).freeze
7
+ CONFIG_KEYS = %w(flow_executable cli_options).freeze
8
8
 
9
- attr_writer :flow_executable
9
+ attr_writer :flow_executable, :cli_options
10
+
11
+ def initialize(patches, commit = nil)
12
+ super(patches, commit)
13
+ read_config
14
+ end
10
15
 
11
16
  def flow_executable
12
17
  @flow_executable || 'flow'.freeze
13
18
  end
14
19
 
20
+ def cli_options
21
+ "#{@cli_options} --json".strip
22
+ end
23
+
15
24
  def files
16
25
  return [] if @patches.nil?
17
26
 
@@ -36,7 +45,7 @@ module Pronto
36
45
  end
37
46
 
38
47
  def read_config
39
- config_file = File.join(repo_path, CONFIG_FILE)
48
+ config_file = File.join(git_repo_path, CONFIG_FILE)
40
49
  return unless File.exist?(config_file)
41
50
  config = YAML.load_file(config_file)
42
51
 
@@ -48,7 +57,6 @@ module Pronto
48
57
 
49
58
  def run
50
59
  if files.any?
51
- read_config
52
60
  messages(run_flow)
53
61
  else
54
62
  []
@@ -56,7 +64,7 @@ module Pronto
56
64
  end
57
65
 
58
66
  def run_flow
59
- Dir.chdir(repo_path) do
67
+ Dir.chdir(git_repo_path) do
60
68
  return JSON.parse(`#{flow_executable} --json`)
61
69
  end
62
70
  end
@@ -69,7 +77,7 @@ module Pronto
69
77
  see_file_paths = data.map do |item|
70
78
  next if item[:path].nil? || item[:path].empty?
71
79
 
72
- file_path = item[:path].sub(repo_path.to_s + File::SEPARATOR, "")
80
+ file_path = item[:path].sub(git_repo_path.to_s , "")
73
81
 
74
82
  next if file_path == first_line_error_in_patch.patch.delta.new_file[:path]
75
83
 
@@ -103,5 +111,9 @@ module Pronto
103
111
  Message.new(path, first_line_error_in_patch, level, description, nil, self.class)
104
112
  end
105
113
  end
114
+
115
+ def git_repo_path
116
+ @git_repo_path ||= Rugged::Repository.discover(File.expand_path(Dir.pwd)).workdir
117
+ end
106
118
  end
107
119
  end
@@ -1,5 +1,5 @@
1
1
  module Pronto
2
2
  module FlowVersion
3
- VERSION = '0.8.2'.freeze
3
+ VERSION = '0.9.0'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pronto-flow
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.2
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Jalbert
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-04-18 00:00:00.000000000 Z
11
+ date: 2017-04-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pronto
@@ -16,28 +16,48 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.8.2
19
+ version: 0.9.0
20
20
  type: :runtime
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: 0.8.2
26
+ version: 0.9.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: rugged
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '0.24'
34
+ - - ">="
35
+ - !ruby/object:Gem::Version
36
+ version: 0.23.0
37
+ type: :runtime
38
+ prerelease: false
39
+ version_requirements: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - "~>"
42
+ - !ruby/object:Gem::Version
43
+ version: '0.24'
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: 0.23.0
27
47
  - !ruby/object:Gem::Dependency
28
48
  name: rake
29
49
  requirement: !ruby/object:Gem::Requirement
30
50
  requirements:
31
51
  - - "~>"
32
52
  - !ruby/object:Gem::Version
33
- version: '11.0'
53
+ version: '12.0'
34
54
  type: :development
35
55
  prerelease: false
36
56
  version_requirements: !ruby/object:Gem::Requirement
37
57
  requirements:
38
58
  - - "~>"
39
59
  - !ruby/object:Gem::Version
40
- version: '11.0'
60
+ version: '12.0'
41
61
  - !ruby/object:Gem::Dependency
42
62
  name: rspec
43
63
  requirement: !ruby/object:Gem::Requirement