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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2a3eda1d60ddcef7be0e422a0428006a5c6d2c74c8028266148c4dbedecf7468
4
- data.tar.gz: 71585f42ee54d37a4b8930916d24701f9fa9937c0264e3d64e6be241250d7c1e
3
+ metadata.gz: 44b570bf8668b1c4dd731b8d124d1b39849aaf72800326b89016a5e36cc58d90
4
+ data.tar.gz: 9585a78adbf3da20005103c402408a686decaee0190461b35400e9e1598453a1
5
5
  SHA512:
6
- metadata.gz: 2235c072dba4555b92c7a82c06f6c6112106168da68fc6a20a539698b4575d5f0246b15421bfe8e1f39d7a02654f716d41cbf3b174a0e924c122178c536c827a
7
- data.tar.gz: 7524dfb584c87f4501d14b282c4f053e2a30a1cca45ada618cb22fd760b5d683dc4773898b6813d9644a53e2dcdd1b77c364c6dacea7600505e712d1e4fbf981
6
+ metadata.gz: c310bee83a0a060f63fd8c77e3bbd9d5ad0bb68f6f8a364b20e321853409f6359310947d1579873ae1b5b715b80995e9027d8f4433864b1d34b48d77763d4e17
7
+ data.tar.gz: 4fed72d373c5bf07e8a37f191843221d28b11969aca678ffb1cd044e7b842168c14f6de029732f4abfb1b76724e8f5afbcd27c8c7a1fad78c63735b6905348da
data/.rubocop.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  AllCops:
2
- TargetRubyVersion: 2.4.4
2
+ TargetRubyVersion: 2.5.0
3
3
 
4
4
  Style/RegexpLiteral:
5
5
  EnforcedStyle: slashes
data/.tool-versions ADDED
@@ -0,0 +1 @@
1
+ ruby 3.3.3
data/.travis.yml CHANGED
@@ -1,8 +1,7 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.5.1
4
- - 2.4.4
5
- - 2.3.4
3
+ - 2.7.1
4
+ - 2.5.8
6
5
  before_install:
7
6
  - gem update --system
8
7
  - gem install bundler
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.1.8...HEAD
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
@@ -3,3 +3,7 @@
3
3
  source 'https://rubygems.org'
4
4
 
5
5
  gemspec
6
+
7
+ group :development, :test do
8
+ gem 'pry'
9
+ end
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', '~> 12.3'
31
+ spec.add_development_dependency 'rake', '~> 13.0'
30
32
  spec.add_development_dependency 'rspec', '~> 3.0'
31
- spec.add_development_dependency 'rubocop', '~> 0.66.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'
@@ -17,6 +17,10 @@ module Imagen
17
17
  ruby24
18
18
  ruby25
19
19
  ruby26
20
+ ruby30
21
+ ruby31
22
+ ruby32
23
+ ruby33
20
24
  current
21
25
  ].freeze
22
26
 
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 => err
72
- warn "#{path}: #{err} #{err.message}"
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
- begin
80
- Imagen::Visitor.traverse(Imagen::AST::Parser.parse_file(path), self)
81
- rescue Parser::SyntaxError => err
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Imagen
4
- VERSION = '0.1.8'
4
+ VERSION = '0.2.0'
5
5
  end
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.1.8
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: 2019-03-19 00:00:00.000000000 Z
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: '12.3'
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: '12.3'
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.66.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.66.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: '0'
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
- rubyforge_project:
195
- rubygems_version: 2.7.6
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