11# frozen_string_literal: true
22
3- Dir [ File . dirname ( __FILE__ ) + ' /**/*.rb' ] . each { |file | require file }
3+ Dir [ File . dirname ( __FILE__ ) + " /**/*.rb" ] . each { |file | require file }
44
55module DiscourseDevAssets
6- require ' discourse_dev_assets/engine'
6+ require " discourse_dev_assets/engine"
77
88 def self . avatars
99 # Using the stock avatar images from https://tinyfac.es
1010 # Tiny Faces is a free crowd-sourced avatar gallery
11- Dir [ File . join ( __dir__ , '..' , ' avatars' , ' *.*' ) ]
11+ Dir [ File . join ( __dir__ , ".." , " avatars" , " *.*" ) ]
1212 end
1313end
1414
@@ -18,41 +18,45 @@ def self.avatars
1818 alias_method :rails_each_current_configuration , :each_current_configuration
1919
2020 private
21+
2122 def each_current_configuration ( environment , name = nil )
22- rails_each_current_configuration ( environment , name ) { |db_config |
23- next if environment == "development" &&
24- ENV [ "SKIP_TEST_DATABASE" ] == "1" &&
25- db_config . configuration_hash [ :database ] != "discourse_development"
23+ rails_each_current_configuration ( environment , name ) do |db_config |
24+ if environment == "development" && ENV [ "SKIP_TEST_DATABASE" ] == "1" &&
25+ db_config . configuration_hash [ :database ] != "discourse_development"
26+ next
27+ end
2628
2729 yield db_config
28- }
30+ end
2931 end
3032end
3133
32- require ' faker'
34+ require " faker"
3335
3436Faker ::Base . instance_eval do
35- alias : faker_translate : translate
37+ alias faker_translate translate
3638
3739 def translate ( *args , **opts )
38- if args [ 0 ] == "faker.lorem.words"
39- args [ 0 ] = "faker.discourse.words"
40- end
40+ args [ 0 ] = "faker.discourse.words" if args [ 0 ] == "faker.lorem.words"
4141
4242 faker_translate ( *args , **opts )
4343 end
4444end
4545
46- require ' literate_randomizer'
46+ require " literate_randomizer"
4747
4848Faker ::Lorem . instance_eval do
49- alias : faker_sentence : sentence
50- alias : faker_paragraph : paragraph
49+ alias faker_sentence sentence
50+ alias faker_paragraph paragraph
5151
5252 NOT_GIVEN = Object . new
5353
5454 def sentence ( word_count : 4 , supplemental : false , random_words_to_add : 15 )
55- faker_sentence ( word_count : word_count , supplemental : supplemental , random_words_to_add : random_words_to_add )
55+ faker_sentence (
56+ word_count : word_count ,
57+ supplemental : supplemental ,
58+ random_words_to_add : random_words_to_add ,
59+ )
5660 end
5761
5862 def paragraph ( options = { } )
0 commit comments