ruby-next-core 0.9.1 → 0.10.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +42 -0
  3. data/README.md +20 -6
  4. data/lib/.rbnext/2.3/ruby-next/commands/core_ext.rb +167 -0
  5. data/lib/.rbnext/2.3/ruby-next/commands/nextify.rb +201 -0
  6. data/lib/.rbnext/2.3/ruby-next/language/eval.rb +66 -0
  7. data/lib/.rbnext/2.3/ruby-next/language/rewriters/base.rb +121 -0
  8. data/lib/.rbnext/2.3/ruby-next/language/rewriters/endless_range.rb +63 -0
  9. data/lib/.rbnext/2.3/ruby-next/language/rewriters/pattern_matching.rb +944 -0
  10. data/lib/.rbnext/2.3/ruby-next/language/rewriters/right_hand_assignment.rb +107 -0
  11. data/lib/.rbnext/2.3/ruby-next/utils.rb +65 -0
  12. data/lib/ruby-next.rb +8 -6
  13. data/lib/ruby-next/cli.rb +2 -2
  14. data/lib/ruby-next/commands/core_ext.rb +1 -1
  15. data/lib/ruby-next/commands/nextify.rb +44 -10
  16. data/lib/ruby-next/core.rb +27 -21
  17. data/lib/ruby-next/core/array/deconstruct.rb +9 -9
  18. data/lib/ruby-next/core/array/difference_union_intersection.rb +12 -12
  19. data/lib/ruby-next/core/constants/no_matching_pattern_error.rb +3 -3
  20. data/lib/ruby-next/core/enumerable/filter.rb +8 -8
  21. data/lib/ruby-next/core/enumerable/filter_map.rb +25 -25
  22. data/lib/ruby-next/core/enumerable/tally.rb +7 -7
  23. data/lib/ruby-next/core/enumerator/produce.rb +12 -12
  24. data/lib/ruby-next/core/hash/deconstruct_keys.rb +9 -9
  25. data/lib/ruby-next/core/hash/except.rb +11 -0
  26. data/lib/ruby-next/core/hash/merge.rb +8 -8
  27. data/lib/ruby-next/core/kernel/then.rb +2 -2
  28. data/lib/ruby-next/core/proc/compose.rb +11 -11
  29. data/lib/ruby-next/core/string/split.rb +6 -6
  30. data/lib/ruby-next/core/struct/deconstruct.rb +2 -2
  31. data/lib/ruby-next/core/struct/deconstruct_keys.rb +17 -17
  32. data/lib/ruby-next/core/symbol/end_with.rb +4 -4
  33. data/lib/ruby-next/core/symbol/start_with.rb +4 -4
  34. data/lib/ruby-next/core/time/ceil.rb +6 -6
  35. data/lib/ruby-next/core/time/floor.rb +4 -4
  36. data/lib/ruby-next/core/unboundmethod/bind_call.rb +4 -4
  37. data/lib/ruby-next/core_ext.rb +1 -1
  38. data/lib/ruby-next/language.rb +30 -6
  39. data/lib/ruby-next/language/proposed.rb +3 -0
  40. data/lib/ruby-next/language/rewriters/args_forward.rb +24 -20
  41. data/lib/ruby-next/language/rewriters/base.rb +1 -1
  42. data/lib/ruby-next/language/rewriters/endless_method.rb +26 -3
  43. data/lib/ruby-next/language/rewriters/endless_range.rb +1 -0
  44. data/lib/ruby-next/language/rewriters/find_pattern.rb +44 -0
  45. data/lib/ruby-next/language/rewriters/method_reference.rb +2 -1
  46. data/lib/ruby-next/language/rewriters/numbered_params.rb +1 -0
  47. data/lib/ruby-next/language/rewriters/pattern_matching.rb +103 -12
  48. data/lib/ruby-next/language/rewriters/right_hand_assignment.rb +74 -11
  49. data/lib/ruby-next/language/rewriters/safe_navigation.rb +87 -0
  50. data/lib/ruby-next/language/rewriters/shorthand_hash.rb +47 -0
  51. data/lib/ruby-next/language/rewriters/squiggly_heredoc.rb +36 -0
  52. data/lib/ruby-next/logging.rb +1 -1
  53. data/lib/ruby-next/rubocop.rb +91 -9
  54. data/lib/ruby-next/setup_self.rb +22 -0
  55. data/lib/ruby-next/version.rb +1 -1
  56. data/lib/uby-next.rb +8 -4
  57. metadata +21 -7
@@ -43,11 +43,14 @@ at_exit do
43
43
  end
44
44
 
45
45
  if $0 == "-e" && e_script.nil?
46
- `ps axw`.split("\n").find { |ps| ps[/\A\s*#{$$}/] }.then do |command|
46
+ if File.file?("/proc/self/cmdline")
47
+ File.read("/proc/self/cmdline")
48
+ else
49
+ `ps axw`.split("\n").find { |ps| ps[/\A\s*#{$$}/] }
50
+ end.then do |command|
47
51
  next unless command
48
- command.tr! '\012', "\n"
49
- command.tr! "\\", "\n"
50
- command.match(/\-e(.*)/m)
52
+ command.gsub!(/(\\012|\u0000)/, "\n")
53
+ command.match(/-e(.*)/m)
51
54
  end.then do |matches|
52
55
  next unless matches
53
56
 
@@ -63,6 +66,7 @@ at_exit do
63
66
 
64
67
  if e_script
65
68
  new_e_script = RubyNext::Language::Runtime.transform(e_script)
69
+ RubyNext.debug_source new_e_script, $0
66
70
  TOPLEVEL_BINDING.eval(new_e_script, $0)
67
71
  exit!(0)
68
72
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-next-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.1
4
+ version: 0.10.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vladimir Dementyev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-05 00:00:00.000000000 Z
11
+ date: 2020-09-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby-next-parser
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 2.8.0.6
19
+ version: 3.0.0.1
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 2.8.0.6
26
+ version: 3.0.0.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: unparser
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 0.4.7
33
+ version: 0.4.8
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: 0.4.7
40
+ version: 0.4.8
41
41
  description: "\n Ruby Next Core is a zero deps version of Ruby Next meant to be
42
42
  used\n as as dependency in your gems.\n\n It contains all the polyfills and
43
43
  utility files but doesn't require transpiler\n dependencies to be install.\n
@@ -55,6 +55,14 @@ files:
55
55
  - bin/parse
56
56
  - bin/ruby-next
57
57
  - bin/transform
58
+ - lib/.rbnext/2.3/ruby-next/commands/core_ext.rb
59
+ - lib/.rbnext/2.3/ruby-next/commands/nextify.rb
60
+ - lib/.rbnext/2.3/ruby-next/language/eval.rb
61
+ - lib/.rbnext/2.3/ruby-next/language/rewriters/base.rb
62
+ - lib/.rbnext/2.3/ruby-next/language/rewriters/endless_range.rb
63
+ - lib/.rbnext/2.3/ruby-next/language/rewriters/pattern_matching.rb
64
+ - lib/.rbnext/2.3/ruby-next/language/rewriters/right_hand_assignment.rb
65
+ - lib/.rbnext/2.3/ruby-next/utils.rb
58
66
  - lib/ruby-next.rb
59
67
  - lib/ruby-next/cli.rb
60
68
  - lib/ruby-next/commands/base.rb
@@ -69,6 +77,7 @@ files:
69
77
  - lib/ruby-next/core/enumerable/tally.rb
70
78
  - lib/ruby-next/core/enumerator/produce.rb
71
79
  - lib/ruby-next/core/hash/deconstruct_keys.rb
80
+ - lib/ruby-next/core/hash/except.rb
72
81
  - lib/ruby-next/core/hash/merge.rb
73
82
  - lib/ruby-next/core/kernel/then.rb
74
83
  - lib/ruby-next/core/proc/compose.rb
@@ -92,17 +101,22 @@ files:
92
101
  - lib/ruby-next/language/rewriters/base.rb
93
102
  - lib/ruby-next/language/rewriters/endless_method.rb
94
103
  - lib/ruby-next/language/rewriters/endless_range.rb
104
+ - lib/ruby-next/language/rewriters/find_pattern.rb
95
105
  - lib/ruby-next/language/rewriters/method_reference.rb
96
106
  - lib/ruby-next/language/rewriters/numbered_params.rb
97
107
  - lib/ruby-next/language/rewriters/pattern_matching.rb
98
108
  - lib/ruby-next/language/rewriters/right_hand_assignment.rb
99
109
  - lib/ruby-next/language/rewriters/runtime.rb
100
110
  - lib/ruby-next/language/rewriters/runtime/dir.rb
111
+ - lib/ruby-next/language/rewriters/safe_navigation.rb
112
+ - lib/ruby-next/language/rewriters/shorthand_hash.rb
113
+ - lib/ruby-next/language/rewriters/squiggly_heredoc.rb
101
114
  - lib/ruby-next/language/runtime.rb
102
115
  - lib/ruby-next/language/setup.rb
103
116
  - lib/ruby-next/language/unparser.rb
104
117
  - lib/ruby-next/logging.rb
105
118
  - lib/ruby-next/rubocop.rb
119
+ - lib/ruby-next/setup_self.rb
106
120
  - lib/ruby-next/utils.rb
107
121
  - lib/ruby-next/version.rb
108
122
  - lib/uby-next.rb
@@ -123,7 +137,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
123
137
  requirements:
124
138
  - - ">="
125
139
  - !ruby/object:Gem::Version
126
- version: 2.3.0
140
+ version: 2.2.0
127
141
  required_rubygems_version: !ruby/object:Gem::Requirement
128
142
  requirements:
129
143
  - - ">="