Code review: Fixing some code smells.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2022-04-06 13:09:38 -05:00
parent f168045520
commit 7bab421f80
3 changed files with 7 additions and 8 deletions

View File

@ -1,4 +1,4 @@
accessing
config
^ config
^ config ifNil: [ config := Dictionary new ]

View File

@ -1,4 +1,6 @@
accessing
folder
^ self config at: 'folder'.
^ self config
at: 'folder'
ifAbsentPut: [ FileLocator userData / 'Socialmetrica' / 'web' / 'twitter.com' / self userName ].

View File

@ -7,13 +7,10 @@ writeWordsFile
rawWords := OrderedCollection new.
collectionsWords := ((rawTweets select:
[ :tweet | tweet user userName = 'FranciaMarquezM' ])
[ :tweet | tweet user userName = self userName ])
collect: [ :tweet | (tweet words
reject: [ :w | w includesSubstring: 'nitter42lfr' ]) ]).
count := 1.
collectionsWords size timesRepeat: [
rawWords addAll: (collectionsWords at:count).
count := count + 1.].
collectionsWords do: [ :word | rawWords addAll: word ].
rawWords := ' ' join:rawWords.
^ MarkupFile exportAsFileOn: (FileLocator userData / 'Socialmetrica' / self userName / self userName, 'words', 'txt') containing: rawWords.
^ MarkupFile exportAsFileOn: (self folder / 'words', 'txt') containing: rawWords.