General

Profile

D1mon (Dim F)

  • Login: D1mon
  • Registered on: 07/23/2019
  • Last sign in: 02/01/2020

Issues

open closed Total
Assigned issues 0 0 0
Reported issues 0 4 4

Activity

08/11/2019

08:30 PM Ruby Feature #16095: 2 Features: remove (simplify) 'new' keyword and Property Shorthand
**figured out how to do it:**
``` ruby
%P[arg1 arg2]
```
in def initialize:
``` ruby
def initialize(arg1, arg2)
%P[arg1 arg2] # equals to: @arg1 = arg1, @arg2 = arg2
end
```
in hash:
``` ruby
a = 1
b = 2
h = %p[a b]...
D1mon (Dim F)
07:31 AM Ruby Feature #16095: 2 Features: remove (simplify) 'new' keyword and Property Shorthand
I correctly understood that this function will be added in version 2.7? https://github.com/ruby/ruby/pull/2231/commits/7da3cdc9aa132307eff0e4376ad6a3819940fc2d D1mon (Dim F)
07:24 AM Ruby Feature #16095: 2 Features: remove (simplify) 'new' keyword and Property Shorthand
Feature 1: I agree that you can do anything with the help of metaprogramming, and this will have to be registered in each library. Therefore, I propose to do this at the language level (Ruby core). D1mon (Dim F)
03:12 PM Ruby Feature #15236: add support for hash shorthand
Well, if the syntax is misleading or intersects with an existing design. Make another syntax to work, why cancel (reject) a very cool thing which will make the code smaller (write less) and it will be nice to read the code. ? Please do n... D1mon (Dim F)
09:33 AM Ruby Misc #16096: each in each (multiple uses 'each')
this method is not suitable since the 3rd search (find_elements) is also used.
Are you saying this is a bug? you can do issue?
D1mon (Dim F)

08/10/2019

11:15 PM Ruby Misc #16096: each in each (multiple uses 'each')
**selenium**
``` ruby
for el in driver.find_elements(xpath: <some_xpath>)
for e1 in el.find_elements(xpath: ...)
...
end
for e2 in el.find_elements(xpath: ...)
...
end
end
```
I need to do two searches in one...
D1mon (Dim F)
09:43 PM Ruby Misc #16096 (Rejected): each in each (multiple uses 'each')
``` ruby
obj.each {|a|
a.some_method1.each {|b|
... # comes here (enter)
}
a.some_method2.each {|c|
... # does not enter here
}
}
# tried and that way. also does not go
for a in obj
for b ...
D1mon (Dim F)
09:16 PM Ruby Feature #16095 (Rejected): 2 Features: remove (simplify) 'new' keyword and Property Shorthand
**common use:**
``` ruby
class A
def initialize(arg1, arg2)
@arg1 = arg1
@arg2 = arg2
end
end
A.new(1,2)
```
1) feature: remove 'new' keyword:
``` ruby
A(1,2) # shorter and more comfortable
```
2) feature:...
D1mon (Dim F)

08/05/2019

07:10 AM Ruby Feature #16045: Calling functions with keyword arguments
``` ruby
def fn(a:1,b:2,c:3)
p a,b,c
end
fn(c:4) # 1 2 4
```
did not know. can close
D1mon (Dim F)
06:45 AM Ruby Feature #16045 (Rejected): Calling functions with keyword arguments
Python:
``` python
def fn(a=1,b=2,c=3):
print(a,b,c)
fn() # 1 2 3
fn(c=4) # 1 2 4
```
Ruby:
``` ruby
def fn(a=1, b=2, c=3)
p a,b,c
end
fn(c=4) # 4 2 3
```
A very convenient and necessary thing that you mus...
D1mon (Dim F)

Also available in: Atom