workato-connector-builder 0.0.1.pre → 0.0.2.pre

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: 23aae47128ed80aee07d7f2e12e811c2632b6b1f30137a24774b4f571415f7eb
4
- data.tar.gz: 7d0fd63fc1d1d3274ea6036ea2d4569f59856196b51e0050eaf75ddf740e7711
3
+ metadata.gz: da4d5d3c95d265014f7035a8fbd759176752951085f57f40340693ca88fa0e9c
4
+ data.tar.gz: d502762b950f72047a5fdde9f95d60a92fddcabdec0c5edcb2c57e307c9afe3c
5
5
  SHA512:
6
- metadata.gz: e13f417404ee807284ef4deb3eb5ba02884f3378701b934f85113896629ff440f0fcb4f0e143adf58d8c002ac40c29f106b305b2fda434e8a8659bad8992155f
7
- data.tar.gz: d04fe57dcaa85de89dff3961e1fa5ad41b88f3cbb81efb2fa2ec451169bde49fb04a0544c15cfd62508fb9c48d6a4ed0900c3bf29d90b65781fa864e1353f333
6
+ metadata.gz: 972df2b68f5ed84ada3941075ddad7ab56bf1ada4cb7360af7343d1188e76d30c182be4d8967516401e82a4919807c3c9dacb3c0aaacb29a590b9f3fa8926b28
7
+ data.tar.gz: 9ec5eb59d24f1a2573ee0fed0be99ce8c746f68721b2797fde5746002107d6f86c5e0f6cb44a574a9dbe910f4145591536268194781296e26fba8ee0afe4a976
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2021 Steven Laroche
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -1,5 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
  # frozen_string_literal: true
3
3
 
4
+ $LOAD_PATH.unshift(File.expand_path('../../lib', __FILE__))
4
5
  require 'workato_connector_builder/cli/cli'
6
+
5
7
  WorkatoConnectorBuilder::CLI::CLI.start
data/lib/test.rb CHANGED
@@ -1,5 +1,4 @@
1
1
  require 'parser/current'
2
- require 'unparser'
3
2
 
4
3
  # Emitter
5
4
  #
@@ -41,7 +41,7 @@ module WorkatoConnectorBuilder
41
41
  if f.start_with?('.')
42
42
  next
43
43
  elsif File.directory?(absolute_path)
44
- asts.merge! self.walk(path)
44
+ asts.concat self.walk(path)
45
45
  elsif f.end_with?('.rb') and !f.start_with?('.')
46
46
  ps = RuboCop::AST::ProcessedSource.from_file(path, 2.4)
47
47
  comments = ps.ast_with_comments
@@ -54,4 +54,4 @@ module WorkatoConnectorBuilder
54
54
  asts
55
55
  end
56
56
  end
57
- end
57
+ end
@@ -4,9 +4,8 @@ require_relative '../constants'
4
4
  require_relative '../validator'
5
5
  require_relative '../fix_newlines_rewriter'
6
6
 
7
- require 'parser/ruby24'
7
+ require 'parser/ruby27'
8
8
  require 'rubocop-ast'
9
- require 'unparser'
10
9
 
11
10
  module WorkatoConnectorBuilder
12
11
  module CLI
@@ -60,7 +59,7 @@ module WorkatoConnectorBuilder
60
59
 
61
60
  def create_parser
62
61
  builder = RuboCop::AST::Builder.new
63
- Parser::Ruby24.new builder
62
+ Parser::Ruby27.new builder
64
63
  end
65
64
 
66
65
  def create_buffer(file_name, source)
@@ -69,10 +68,9 @@ module WorkatoConnectorBuilder
69
68
 
70
69
  def process(ast_generator, hash_combiner)
71
70
  asts = ast_generator.get_asts
72
- require 'pry-byebug'
73
71
 
74
72
  first_node = asts.first
75
- tree_rewriter = FixNewlinesRewriter.new
73
+ tree_rewriter = WorkatoConnectorBuilder::FixNewlinesRewriter.new
76
74
 
77
75
  asts.drop(1).each do |node|
78
76
  combined = hash_combiner.combine(first_node[:ast], node[:ast])
@@ -1,29 +1,31 @@
1
1
  require 'parser'
2
- require 'byebug'
3
2
 
4
- class FixNewlinesRewriter < Parser::TreeRewriter
3
+ module WorkatoConnectorBuilder
4
+ class FixNewlinesRewriter < Parser::TreeRewriter
5
5
 
6
- def on_pair(node)
7
- range = node.source_range
8
- add_trailing_comma(range, range.source.length)
9
- super
10
- end
6
+ def on_pair(node)
7
+ range = node.source_range
8
+ add_trailing_comma(range, range.source.length)
9
+ super
10
+ end
11
+
12
+ private
11
13
 
12
- private
13
- def add_trailing_comma(range, source_length)
14
- unless has_trailing_comma?(range, source_length)
15
- insert_after range.end, ','
14
+ def add_trailing_comma(range, source_length)
15
+ unless has_trailing_comma?(range, source_length)
16
+ insert_after range.end, ','
17
+ end
16
18
  end
17
- end
18
19
 
19
- def remove_trailing_comma(range, source_length)
20
- if has_trailing_comma?(range, source_length)
21
- remove range.adjust(begin_pos: source_length, end_pos: 1)
20
+ def remove_trailing_comma(range, source_length)
21
+ if has_trailing_comma?(range, source_length)
22
+ remove range.adjust(begin_pos: source_length, end_pos: 1)
23
+ end
22
24
  end
23
- end
24
25
 
25
- def has_trailing_comma?(range, source_length)
26
- next_char_range = range.adjust(begin_pos: source_length, end_pos: 1)
27
- next_char_range.is?(',')
26
+ def has_trailing_comma?(range, source_length)
27
+ next_char_range = range.adjust(begin_pos: source_length, end_pos: 1)
28
+ next_char_range.is?(',')
29
+ end
28
30
  end
29
31
  end
@@ -5,7 +5,6 @@ module WorkatoConnectorBuilder
5
5
  end
6
6
 
7
7
  def combine(first, second)
8
- require 'pry-byebug'
9
8
  if !first.hash_type? or !second.hash_type?
10
9
  return
11
10
  end
@@ -1,5 +1,4 @@
1
1
  module WorkatoConnectorBuilder
2
- require 'pry-byebug'
3
2
  class Validator
4
3
  def initialize(shell)
5
4
  @shell = shell
@@ -107,7 +106,6 @@ module WorkatoConnectorBuilder
107
106
 
108
107
  kept_invalid_pairs.sort! { |a, b| a.key <=> b.key }
109
108
 
110
- byebug
111
109
  hash_node.updated(:hash, kept_pairs.concat(kept_invalid_pairs))
112
110
  end
113
111
 
@@ -7,13 +7,14 @@ Gem::Specification.new do |spec|
7
7
  spec.description = 'A tool for building Workato Connectors from multiple hash files'
8
8
  spec.summary = spec.description
9
9
  spec.authors = [ 'Steven Laroche', ]
10
- spec.version = '0.0.1.pre'
10
+ spec.version = '0.0.2.pre'
11
11
  spec.license = 'MIT'
12
12
 
13
- spec.files = Dir['bin/*', 'lib/**/*.rb', 'workato-connector-builder.gemspec', 'LICENSE.txt']
13
+ spec.files = Dir['bin/*', 'lib/**/*.rb', 'workato-connector-builder.gemspec', 'LICENSE']
14
14
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
15
+ spec.bindir = 'bin'
15
16
  spec.require_paths = [ 'lib' ]
16
- spec.metadata = { 'issue_tracker' => 'https://www.github.com/johndoe/missing/issues' }
17
+ spec.metadata = { 'issue_tracker' => 'https://www.github.com/splaroche/workato-connector-builder/issues' }
17
18
 
18
19
 
19
20
  spec.required_ruby_version= '>= 2.0.0'
@@ -21,7 +22,6 @@ Gem::Specification.new do |spec|
21
22
  spec.add_runtime_dependency 'rubocop-ast', '~> 1.12'
22
23
  spec.add_runtime_dependency 'thor', '~> 1.1'
23
24
 
24
- spec.add_development_dependency 'pry-byebug', '~> 3.9'
25
25
  spec.add_development_dependency 'rbs', '~> 1.6'
26
26
  spec.add_development_dependency 'rspec', '~> 3.10'
27
- end
27
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: workato-connector-builder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1.pre
4
+ version: 0.0.2.pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steven Laroche
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-10-17 00:00:00.000000000 Z
11
+ date: 2021-10-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop-ast
@@ -38,20 +38,6 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '1.1'
41
- - !ruby/object:Gem::Dependency
42
- name: pry-byebug
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - "~>"
46
- - !ruby/object:Gem::Version
47
- version: '3.9'
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - "~>"
53
- - !ruby/object:Gem::Version
54
- version: '3.9'
55
41
  - !ruby/object:Gem::Dependency
56
42
  name: rbs
57
43
  requirement: !ruby/object:Gem::Requirement
@@ -87,14 +73,12 @@ executables:
87
73
  extensions: []
88
74
  extra_rdoc_files: []
89
75
  files:
76
+ - LICENSE
90
77
  - bin/workato-connector-builder
91
- - lib/output.rb
92
78
  - lib/test.rb
93
- - lib/workato_connector_builder.rb
94
79
  - lib/workato_connector_builder/ast_generator.rb
95
80
  - lib/workato_connector_builder/cli/build_command.rb
96
81
  - lib/workato_connector_builder/cli/cli.rb
97
- - lib/workato_connector_builder/cli/config_store.rb
98
82
  - lib/workato_connector_builder/constants.rb
99
83
  - lib/workato_connector_builder/fix_newlines_rewriter.rb
100
84
  - lib/workato_connector_builder/hash_combiner.rb
@@ -104,7 +88,7 @@ homepage:
104
88
  licenses:
105
89
  - MIT
106
90
  metadata:
107
- issue_tracker: https://www.github.com/johndoe/missing/issues
91
+ issue_tracker: https://www.github.com/splaroche/workato-connector-builder/issues
108
92
  post_install_message:
109
93
  rdoc_options: []
110
94
  require_paths:
data/lib/output.rb DELETED
@@ -1,14 +0,0 @@
1
- {
2
- :test => 1,
3
- :collision => 2,
4
- 'dup' => {
5
- a: 1,
6
- b: 2
7
- },
8
- :otherfield => 2,
9
- dup: {
10
- # some comment
11
- a: 2,
12
- c: 3 # another_comment
13
- },
14
- }
@@ -1,17 +0,0 @@
1
- module WorkatoConnectorBuilder
2
- module CLI
3
- class ConfigStore
4
- def initialize
5
-
6
- end
7
-
8
- def load_config path
9
-
10
- end
11
-
12
- def load_from_args args
13
-
14
- end
15
- end
16
- end
17
- end
@@ -1,4 +0,0 @@
1
- module WorkatoConnectorBuilder
2
- require_relative 'workato_connector_builder/hash_combiner'
3
- require_relative 'workato_connector_builder/ast_generator'
4
- end