Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move random-string fn to proton.string #11

Merged
merged 4 commits into from
Feb 13, 2019
Merged

Conversation

totakke
Copy link
Member

@totakke totakke commented Feb 12, 2019

I moved proton.core/random-string to proton.string/rand-string with character-type options.

(require '[proton.string :as pstring])

(pstring/rand-string 8)
;;=> "bonYIfi9"

(pstring/rand-string 8 :number :lower-case-letter)
;;=> "iw5tx9bk"

I think random-string fn should be located in proton.string, and rand-string is a bit better name because it is similar to rand-int.

I marked proton.core/random-string as deprecated. proton.string/rand-string maintains full compatibility with proton.core/random-string.

Besides, I fixed a bug of ascii codes of proton.core/random-string.

@codecov
Copy link

codecov bot commented Feb 12, 2019

Codecov Report

Merging #11 into master will increase coverage by 0.27%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #11      +/-   ##
==========================================
+ Coverage   94.05%   94.32%   +0.27%     
==========================================
  Files           5        5              
  Lines         185      194       +9     
  Branches        2        2              
==========================================
+ Hits          174      183       +9     
  Misses          9        9              
  Partials        2        2
Impacted Files Coverage Δ
src/cljc/proton/core.cljc 95.18% <100%> (ø) ⬆️
src/cljc/proton/string.cljc 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 78ab41c...533a126. Read the comment docs.

@iku000888
Copy link
Contributor

How about rand-str? Just my 2 cents as int is an abbreviation so it sounded more consistent...

@totakke
Copy link
Member Author

totakke commented Feb 12, 2019

Exactly. I'll fix it.

Copy link
Member

@federkasten federkasten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🙆‍♂️

@federkasten federkasten merged commit 16b1dce into master Feb 13, 2019
@federkasten
Copy link
Member

Merged. Thanks for your great contribution!

@federkasten federkasten deleted the fix/move-random-string branch February 13, 2019 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants