imagen 0.1.8 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +1 -1
- data/.tool-versions +1 -0
- data/.travis.yml +2 -3
- data/CHANGELOG.md +10 -1
- data/Gemfile +4 -0
- data/README.md +0 -1
- data/imagen_rb.gemspec +4 -2
- data/lib/imagen/ast/parser.rb +4 -0
- data/lib/imagen/clone.rb +1 -3
- data/lib/imagen/node.rb +14 -7
- data/lib/imagen/version.rb +1 -1
- metadata +13 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 44b570bf8668b1c4dd731b8d124d1b39849aaf72800326b89016a5e36cc58d90
|
4
|
+
data.tar.gz: 9585a78adbf3da20005103c402408a686decaee0190461b35400e9e1598453a1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c310bee83a0a060f63fd8c77e3bbd9d5ad0bb68f6f8a364b20e321853409f6359310947d1579873ae1b5b715b80995e9027d8f4433864b1d34b48d77763d4e17
|
7
|
+
data.tar.gz: 4fed72d373c5bf07e8a37f191843221d28b11969aca678ffb1cd044e7b842168c14f6de029732f4abfb1b76724e8f5afbcd27c8c7a1fad78c63735b6905348da
|
data/.rubocop.yml
CHANGED
data/.tool-versions
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
ruby 3.3.3
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,14 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|
6
6
|
|
7
7
|
## [Unreleased]
|
8
8
|
|
9
|
+
## [0.2.0]
|
10
|
+
### Added
|
11
|
+
- Add `Node#empty_def?` to return if the node is an empty definition
|
12
|
+
|
13
|
+
### Changed
|
14
|
+
- Min requirement for Ruby 2.5.0
|
15
|
+
- Dependency updates
|
16
|
+
|
9
17
|
## [0.1.8]
|
10
18
|
### Changed
|
11
19
|
- Dependency updates
|
@@ -35,7 +43,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|
35
43
|
### Added
|
36
44
|
- First release of `imagen` 🎉
|
37
45
|
|
38
|
-
[Unreleased]: https://github.com/grodowski/imagen_rb/compare/v0.
|
46
|
+
[Unreleased]: https://github.com/grodowski/imagen_rb/compare/v0.2.0...HEAD
|
47
|
+
[0.2.0]: https://github.com/grodowski/imagen_rb/compare/v0.1.8...v0.2.0
|
39
48
|
[0.1.8]: https://github.com/grodowski/imagen_rb/compare/v0.1.5...v0.1.8
|
40
49
|
[0.1.5]: https://github.com/grodowski/imagen_rb/compare/v0.1.4...v0.1.5
|
41
50
|
[0.1.4]: https://github.com/grodowski/imagen_rb/compare/v0.1.3...v0.1.4
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
# imagen-rb
|
2
2
|
|
3
3
|
[![Build Status](https://travis-ci.org/grodowski/imagen_rb.svg?branch=master)](https://travis-ci.org/grodowski/imagen_rb)
|
4
|
-
[![codebeat badge](https://codebeat.co/badges/f75bdccf-829b-4139-bcd7-dc68f2c5986b)](https://codebeat.co/projects/github-com-grodowski-imagen-rb-master)
|
5
4
|
|
6
5
|
*Representación mental que se tiene de algo.*
|
7
6
|
*Mental representation of something.*
|
data/imagen_rb.gemspec
CHANGED
@@ -23,12 +23,14 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
24
24
|
spec.require_paths = ['lib']
|
25
25
|
|
26
|
+
spec.required_ruby_version = '>= 2.5.0'
|
27
|
+
|
26
28
|
spec.add_dependency 'parser', '>= 2.5', '!= 2.5.1.1'
|
27
29
|
|
28
30
|
spec.add_development_dependency 'bundler', '~> 2.0'
|
29
|
-
spec.add_development_dependency 'rake', '~>
|
31
|
+
spec.add_development_dependency 'rake', '~> 13.0'
|
30
32
|
spec.add_development_dependency 'rspec', '~> 3.0'
|
31
|
-
spec.add_development_dependency 'rubocop', '~> 0.
|
33
|
+
spec.add_development_dependency 'rubocop', '~> 1.0.0'
|
32
34
|
spec.add_development_dependency 'pry'
|
33
35
|
spec.add_development_dependency 'simplecov'
|
34
36
|
spec.add_development_dependency 'simplecov-lcov'
|
data/lib/imagen/ast/parser.rb
CHANGED
data/lib/imagen/clone.rb
CHANGED
@@ -15,9 +15,7 @@ module Imagen
|
|
15
15
|
attr_reader :repo_url, :dir
|
16
16
|
|
17
17
|
def initialize(repo_url, dirname)
|
18
|
-
unless repo_url.match?(/^https:\/\//)
|
19
|
-
raise ArgumentError, 'repo_url must start with https://'
|
20
|
-
end
|
18
|
+
raise ArgumentError, 'repo_url must start with https://' unless repo_url.match?(/^https:\/\//)
|
21
19
|
|
22
20
|
@repo_url = repo_url
|
23
21
|
@dir = dirname
|
data/lib/imagen/node.rb
CHANGED
@@ -23,6 +23,10 @@ module Imagen
|
|
23
23
|
tap { @ast_node = ast_node }
|
24
24
|
end
|
25
25
|
|
26
|
+
def empty_def?
|
27
|
+
ast_node.children.last.nil?
|
28
|
+
end
|
29
|
+
|
26
30
|
def file_path
|
27
31
|
ast_node.location.name.source_buffer.name
|
28
32
|
end
|
@@ -68,23 +72,26 @@ module Imagen
|
|
68
72
|
|
69
73
|
def build_from_file(path)
|
70
74
|
Imagen::Visitor.traverse(Imagen::AST::Parser.parse_file(path), self)
|
71
|
-
rescue Parser::SyntaxError =>
|
72
|
-
warn "#{path}: #{
|
75
|
+
rescue Parser::SyntaxError => e
|
76
|
+
warn "#{path}: #{e} #{e.message}"
|
73
77
|
self
|
74
78
|
end
|
75
79
|
|
76
80
|
def build_from_dir(dir)
|
77
81
|
@dir = dir
|
78
82
|
list_files.each do |path|
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
warn "#{path}: #{err} #{err.message}"
|
83
|
-
end
|
83
|
+
Imagen::Visitor.traverse(Imagen::AST::Parser.parse_file(path), self)
|
84
|
+
rescue Parser::SyntaxError => e
|
85
|
+
warn "#{path}: #{e} #{e.message}"
|
84
86
|
end
|
85
87
|
self
|
86
88
|
end
|
87
89
|
|
90
|
+
def build_from_ast(ast_node)
|
91
|
+
Imagen::Visitor.traverse(ast_node, self)
|
92
|
+
self
|
93
|
+
end
|
94
|
+
|
88
95
|
def human_name
|
89
96
|
'root'
|
90
97
|
end
|
data/lib/imagen/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: imagen
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Grodowski
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-08-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parser
|
@@ -50,14 +50,14 @@ dependencies:
|
|
50
50
|
requirements:
|
51
51
|
- - "~>"
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: '
|
53
|
+
version: '13.0'
|
54
54
|
type: :development
|
55
55
|
prerelease: false
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
57
|
requirements:
|
58
58
|
- - "~>"
|
59
59
|
- !ruby/object:Gem::Version
|
60
|
-
version: '
|
60
|
+
version: '13.0'
|
61
61
|
- !ruby/object:Gem::Dependency
|
62
62
|
name: rspec
|
63
63
|
requirement: !ruby/object:Gem::Requirement
|
@@ -78,14 +78,14 @@ dependencies:
|
|
78
78
|
requirements:
|
79
79
|
- - "~>"
|
80
80
|
- !ruby/object:Gem::Version
|
81
|
-
version: 0.
|
81
|
+
version: 1.0.0
|
82
82
|
type: :development
|
83
83
|
prerelease: false
|
84
84
|
version_requirements: !ruby/object:Gem::Requirement
|
85
85
|
requirements:
|
86
86
|
- - "~>"
|
87
87
|
- !ruby/object:Gem::Version
|
88
|
-
version: 0.
|
88
|
+
version: 1.0.0
|
89
89
|
- !ruby/object:Gem::Dependency
|
90
90
|
name: pry
|
91
91
|
requirement: !ruby/object:Gem::Requirement
|
@@ -142,7 +142,7 @@ dependencies:
|
|
142
142
|
- - ">="
|
143
143
|
- !ruby/object:Gem::Version
|
144
144
|
version: '0'
|
145
|
-
description:
|
145
|
+
description:
|
146
146
|
email:
|
147
147
|
- jgrodowski@gmail.com
|
148
148
|
executables: []
|
@@ -153,6 +153,7 @@ files:
|
|
153
153
|
- ".gitignore"
|
154
154
|
- ".rspec"
|
155
155
|
- ".rubocop.yml"
|
156
|
+
- ".tool-versions"
|
156
157
|
- ".travis.yml"
|
157
158
|
- CHANGELOG.md
|
158
159
|
- Dockerfile
|
@@ -176,7 +177,7 @@ homepage: https://github.com/grodowski/imagen_rb
|
|
176
177
|
licenses:
|
177
178
|
- MIT
|
178
179
|
metadata: {}
|
179
|
-
post_install_message:
|
180
|
+
post_install_message:
|
180
181
|
rdoc_options: []
|
181
182
|
require_paths:
|
182
183
|
- lib
|
@@ -184,16 +185,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
184
185
|
requirements:
|
185
186
|
- - ">="
|
186
187
|
- !ruby/object:Gem::Version
|
187
|
-
version:
|
188
|
+
version: 2.5.0
|
188
189
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
189
190
|
requirements:
|
190
191
|
- - ">="
|
191
192
|
- !ruby/object:Gem::Version
|
192
193
|
version: '0'
|
193
194
|
requirements: []
|
194
|
-
|
195
|
-
|
196
|
-
signing_key:
|
195
|
+
rubygems_version: 3.5.11
|
196
|
+
signing_key:
|
197
197
|
specification_version: 4
|
198
198
|
summary: Codebase as structure of locatable classes and methods based on the Ruby
|
199
199
|
AST
|