ruby_list_comprehension 0.2.2 → 0.2.4

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: bc2af11cfbc01440dc7d210694011584a128be74773259a247c877b385f07cf0
4
- data.tar.gz: a222d208644f9e026fabe759e6ec8de69c00da7ae6b4291f173baac0387c985b
3
+ metadata.gz: da0d475e01e660a109eff36d8f0f4f8ca3e105757bf6577bfdce20c7440177b5
4
+ data.tar.gz: e36bcd2fa8ba9e34fce4f78efb9f4853e7fff9469573dc1da1eb3fc447e17d4b
5
5
  SHA512:
6
- metadata.gz: 4535317fbd3fbae647b53d3893876762be5d1dbf0623d6ecb7cc38899dac49d337e1c6f5896a20a7812bb6eeca8c5f95fb50a0a19ec5877a123cbb8fba772b08
7
- data.tar.gz: 3b8541f1684bfd089e778cd733bc1060ddfa99a76ce54be9391d4f2e5ab9f6d4b83b6f40ec814537e71f398a2ba0469de12cae10111de7245c07fcc15231dff4
6
+ metadata.gz: 0116246f99df3cb5f403963e4743fcc34c88d9767434c9505454078b29c8a0814f84ec7ca21a22ffc309b433a4dd5f7c1944a1b695049196f09253072f379d1f
7
+ data.tar.gz: 905a24fdd92c58f87e4cf7e0539f0b711e7689564e825a1a84168609a1a320b9e9856ad5544fb5c2e25cbdfbfe721fb3186c34334ac031d4905c28ce20bab149
@@ -2,7 +2,7 @@
2
2
  require 'readline'
3
3
  require 'singleton'
4
4
  require 'set'
5
- module RubyList
5
+ module RubyListComprehension
6
6
  FM_REGEX = /for(?<parameter>.*)(?=in)in(?<iterable>.*)(?=do)do(?<mappable>.*)(?=if)if(?<filterable>.+)end/.freeze
7
7
  F_REGEX = /for(?<parameter>.*)(?=in)in(?<iterable>.*)(.+)do(.+)(?=if)if(?<filterable>.*)end/.freeze
8
8
  M_REGEX = /(?=for)for(?<parameter>.*)(?=in)in(?<iterable>.*)(?=do)do(?<mappable>.*)(?=end)end/.freeze
@@ -169,8 +169,8 @@ module RubyList
169
169
  end
170
170
 
171
171
  class ListComprehension
172
- include Singleton
173
- include RubyList
172
+ # include Singleton
173
+ include RubyListComprehension
174
174
  attr_accessor :cache, :caching, :mappable, :filterable, :iterable, :var, :list, :location, :line, :count
175
175
  attr_accessor :flattener, :len, :nested, :nested_var, :file, :list_comp, :final_iterable_value
176
176
  attr_accessor :count
@@ -205,7 +205,7 @@ module RubyList
205
205
  def locate_list_repl
206
206
  @line = Readline::HISTORY.to_a.reverse.uniq.reverse[-1]
207
207
  start = @line.index('l[') + 2
208
- ending = @line[start..-1].index('end') + 5
208
+ ending = @line[start..-1].index('end') + 6
209
209
  @line = @line[start...ending]
210
210
  end
211
211
 
@@ -219,7 +219,6 @@ module RubyList
219
219
  def locate_list_file
220
220
  @location = caller_locations.last.to_s.scan(/\d+/).last.to_i
221
221
  @line = retrieve_file_data[@location - 1].strip.match(/\$l(?<line>.+)/)[:line][0...-1]
222
-
223
222
  # if @line.is_a? Array
224
223
  # @line.each_with_index do |list, idx|
225
224
  # list.split[3] == iterable.to_s
@@ -227,8 +226,7 @@ module RubyList
227
226
  # end
228
227
  # end
229
228
  @line
230
-
231
229
  end
232
230
  end
233
- $l = ListComprehension.instance
231
+ $l = ListComprehension.new
234
232
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_list_comprehension
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Michael