code-ruby 0.15.11 → 0.15.13

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: d1e71c7d755fca9f48ebac0f951308578715356cc85a75adf2c3adef3f0d31f1
4
- data.tar.gz: e7fd87732757ee125baf8fabb5553d5010dac2fb47a6edc1c6b3d2d5cdac0c2b
3
+ metadata.gz: d25709cc45c81b913c88e19a5c3981db53a787211b18ed5e0ae9ca562450e98b
4
+ data.tar.gz: 5dda0a4c74c867ab304454519ea27242db1f8b4dbbc9ee48d7bffed8fb1ffba9
5
5
  SHA512:
6
- metadata.gz: c5c1044b259a4fec2e40d574c1642132783e75fa05fd45b59f03d2395d2c482df0c21c6f022d0a861638f69182d1c2dd3f4563a8881521a20b6e41f2be8457d3
7
- data.tar.gz: ad1390b1556722d9733884c88cdf8f79ecdf6c413d9bb515ee0ef4ee15a73189c824ecbdf884fa9c987416fc057b3738777be5790bb98b8a2d555e0424a9b4b9
6
+ metadata.gz: 605e509a867be495750727afd3059ab4e93f3dd5123c1b0716f3008b77ab8a07dbb29f26e6785b1bbb5f408859f89edaa8efd7d5c65fe893237a591ade7e859d
7
+ data.tar.gz: 04b087fea330fb2e729952d116e8304673ae82696e7fdaeef3e7480dc779cf9b602ad5930c7578b80dfeed4750437d9920d5f49643fb0c987094d30145526ecf
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- code-ruby (0.15.11)
4
+ code-ruby (0.15.13)
5
5
  activesupport
6
6
  bigdecimal
7
7
  did-you-mean
data/bin/code CHANGED
@@ -64,7 +64,10 @@ argv =
64
64
  end
65
65
  .parse!
66
66
 
67
- options[:input] = argv.join(" ") if options[:input].empty?
67
+ if options[:input].empty?
68
+ options[:input] = argv.join(" ")
69
+ options[:input] = File.read(options[:input]) if File.exist?(options[:input])
70
+ end
68
71
 
69
72
  abort <<~HELP if options[:input].empty?
70
73
  Usage: code INPUT
@@ -56,7 +56,7 @@ class Code
56
56
  end
57
57
 
58
58
  def to_h
59
- raw
59
+ raw.raw
60
60
  end
61
61
  end
62
62
  end
data/lib/code/version.rb CHANGED
@@ -2,4 +2,4 @@
2
2
 
3
3
  require_relative "../code"
4
4
 
5
- Code::Version = Gem::Version.new("0.15.11")
5
+ Code::Version = Gem::Version.new("0.15.13")
data/spec/code_spec.rb CHANGED
@@ -323,4 +323,19 @@ RSpec.describe Code do
323
323
  expect(output.string).to eq(expected)
324
324
  end
325
325
  end
326
+
327
+ it "doesn't crash with dictionnary as parameter" do
328
+ Code.evaluate(<<~INPUT)
329
+ [
330
+ {
331
+ videos: [{}]
332
+ },
333
+ {
334
+ videos: [{}]
335
+ }
336
+ ].map do |post|
337
+ post.videos.map { |video| }
338
+ end
339
+ INPUT
340
+ end
326
341
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: code-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.11
4
+ version: 0.15.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dorian Marié