syntax_tree-array_brackets 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 310c9fa6ba5f710b1cfd410e930e2c55c67a89c02310099b542f1970c11f47ca
4
- data.tar.gz: 18d763015004da43943e609760b85e0d8c4265a974662e3743c7f40ffd21ba21
3
+ metadata.gz: 32271cf4a40462dee6524c5ef80b617bba879a4b7701034b0384fb8071bfae50
4
+ data.tar.gz: a75742fcac0040125896a54fd74f7c7cebff711038d9d5702dcaa0faa192fdac
5
5
  SHA512:
6
- metadata.gz: 2b5e483494a5df437e5dfb3c919224b662d128d0a46fb00448b029e02dc8646cb8ce1191fe00381e8636e96733960d94ac02b1a1b33838da015f4bffad44be3b
7
- data.tar.gz: 13ec518da27b95ac23f5d1c9ffef9c2d0a08379451d447145689518d21cbce9e813a3d506cbefde8bc05c294a203691303c6477d264a6c6ed0e482adb97df865
6
+ metadata.gz: 2b1c534d7bb082f76e7ac4ed240ca9038b1a5cae42ea7a8d73e970382c65ba2ce9d57e88f383d9900878a9d60b837599f58776ba23e28b7390970a9ad5d6e59d
7
+ data.tar.gz: 4f08569970a94ea6089d481086da9ef077b54a96f3b0aa9bcbec82630751308eef6fb65981154e7388487cae5637caec4458c4abd9ba4eb8b9745d29e2459ce8
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- syntax_tree-array_brackets (0.1.0)
4
+ syntax_tree-array_brackets (0.1.1)
5
5
  syntax_tree (>= 2.0.1)
6
6
 
7
7
  GEM
@@ -50,6 +50,7 @@ GEM
50
50
 
51
51
  PLATFORMS
52
52
  arm64-darwin-21
53
+ x86_64-linux
53
54
 
54
55
  DEPENDENCIES
55
56
  rake (~> 13.0)
data/Rakefile CHANGED
@@ -7,6 +7,6 @@ require "syntax_tree/rake_tasks"
7
7
 
8
8
  RSpec::Core::RakeTask.new(:spec)
9
9
  RuboCop::RakeTask.new
10
- SyntaxTree::Rake::CheckTask.new()
10
+ SyntaxTree::Rake::CheckTask.new
11
11
 
12
12
  task default: [:spec, :rubocop, :"stree:check"]
@@ -2,6 +2,6 @@
2
2
 
3
3
  module SyntaxTree
4
4
  module ArrayBrackets
5
- VERSION = "0.1.0"
5
+ VERSION = "0.1.1"
6
6
  end
7
7
  end
@@ -37,17 +37,19 @@ module SyntaxTree
37
37
  q.group do
38
38
  q.text(opening)
39
39
 
40
- loc = elements.first.location.to(elements.last.location)
41
- str_contents =
42
- elements.map do |element|
43
- StringContent.new(parts: [element], location: nil)
44
- end
45
- contents = Args.new(parts: str_contents, location: loc)
40
+ unless elements.empty?
41
+ loc = elements.first.location.to(elements.last.location)
42
+ str_contents =
43
+ elements.map do |element|
44
+ StringContent.new(parts: [element], location: nil)
45
+ end
46
+ contents = Args.new(parts: str_contents, location: loc)
46
47
 
47
- q.indent do
48
- q.breakable_empty
49
- q.format(contents)
50
- q.if_break { q.text(",") } if q.trailing_comma?
48
+ q.indent do
49
+ q.breakable_empty
50
+ q.format(contents)
51
+ q.if_break { q.text(",") } if q.trailing_comma?
52
+ end
51
53
  end
52
54
 
53
55
  q.breakable_empty
@@ -63,17 +65,19 @@ module SyntaxTree
63
65
  q.group do
64
66
  q.text(opening)
65
67
 
66
- loc = elements.first.location.to(elements.last.location)
67
- str_contents =
68
- elements.map do |element|
69
- SymbolLiteral.new(value: element, location: nil)
70
- end
71
- contents = Args.new(parts: str_contents, location: loc)
68
+ unless elements.empty?
69
+ loc = elements.first.location.to(elements.last.location)
70
+ str_contents =
71
+ elements.map do |element|
72
+ SymbolLiteral.new(value: element, location: nil)
73
+ end
74
+ contents = Args.new(parts: str_contents, location: loc)
72
75
 
73
- q.indent do
74
- q.breakable_empty
75
- q.format(contents)
76
- q.if_break { q.text(",") } if q.trailing_comma?
76
+ q.indent do
77
+ q.breakable_empty
78
+ q.format(contents)
79
+ q.if_break { q.text(",") } if q.trailing_comma?
80
+ end
77
81
  end
78
82
 
79
83
  q.breakable_empty
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: syntax_tree-array_brackets
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nobuo Takizawa
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-05-21 00:00:00.000000000 Z
11
+ date: 2023-06-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: syntax_tree