mirror of
				https://gitea.invidious.io/iv-org/shard-ameba.git
				synced 2024-08-15 00:53:29 +00:00 
			
		
		
		
	Document the new Config.load behaviour
				
					
				
			This commit is contained in:
		
							parent
							
								
									e481a8d139
								
							
						
					
					
						commit
						8d56f22af1
					
				
					 1 changed files with 23 additions and 1 deletions
				
			
		| 
						 | 
					@ -10,8 +10,30 @@ require "./glob_utils"
 | 
				
			||||||
# config.formatter = my_formatter
 | 
					# config.formatter = my_formatter
 | 
				
			||||||
# ```
 | 
					# ```
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# By default config loads `.ameba.yml` file in a current directory.
 | 
					# By default config loads `.ameba.yml` file located in a current
 | 
				
			||||||
 | 
					# working directory.
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
 | 
					# If it cannot be found until reaching the root directory, then it will be
 | 
				
			||||||
 | 
					# searched for in the user’s global config locations, which consists of a
 | 
				
			||||||
 | 
					# dotfile or a config file inside the XDG Base Directory specification.
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# - `~/.ameba.yml`
 | 
				
			||||||
 | 
					# - `$XDG_CONFIG_HOME/ameba/config.yml` (expands to `~/.config/ameba/config.yml`
 | 
				
			||||||
 | 
					#   if `$XDG_CONFIG_HOME` is not set)
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# If both files exist, the dotfile will be selected.
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# As an example, if Ameba is invoked from inside `/path/to/project/lib/utils`,
 | 
				
			||||||
 | 
					# then it will use the config as specified inside the first of the following files:
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# - `/path/to/project/lib/utils/.ameba.yml`
 | 
				
			||||||
 | 
					# - `/path/to/project/lib/.ameba.yml`
 | 
				
			||||||
 | 
					# - `/path/to/project/.ameba.yml`
 | 
				
			||||||
 | 
					# - `/path/to/.ameba.yml`
 | 
				
			||||||
 | 
					# - `/path/.ameba.yml`
 | 
				
			||||||
 | 
					# - `/.ameba.yml`
 | 
				
			||||||
 | 
					# - `~/.ameba.yml`
 | 
				
			||||||
 | 
					# - `~/.config/ameba/config.yml`
 | 
				
			||||||
class Ameba::Config
 | 
					class Ameba::Config
 | 
				
			||||||
  include GlobUtils
 | 
					  include GlobUtils
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue