diff --git a/README.md b/README.md index c0ce0b9..efec97c 100644 --- a/README.md +++ b/README.md @@ -164,7 +164,7 @@ Show battery status. Shows configurable weather information as provided by the BBC. Recommended over the `Temperature` block due to how much more reliable the BBC service is. -`bbc = Barr::Blocks::BBCWeather.new location: "5308655", format: "${TEMPERATURE} wind: ${WINDSPEED} ${WINDDIRECTION}" +`bbc = Barr::Blocks::BBCWeather.new location: "5308655", format: "${TEMPERATURE} wind: ${WINDSPEED} ${WINDDIRECTION}"` | Option | Value | Description | Default | | --- | --- | --- | --- | @@ -180,7 +180,7 @@ Shows configurable weather information as provided by the BBC. Recommended over | `${WINDSPEED}` | Current wind speed | | `${WINDDIRECTION}` | Current wind direction | | `${HUMIDITY}` | Current humidity percentage | -| `${VISIBILITY}` | Sumamry of visbility, e.g. "Excellent" | +| `${VISIBILITY}` | Summary of visbility, e.g. "Excellent" | | `${PRESSURE}` | Current pressure and trend, e.g. "1000mb, Falling" | #### Bspwm (Experimental) diff --git a/lib/barr/block.rb b/lib/barr/block.rb index b4b4539..aef40f0 100644 --- a/lib/barr/block.rb +++ b/lib/barr/block.rb @@ -42,25 +42,6 @@ def tmp_filename return @tmp_filename end - def substitue_variables string_format, subs - reg = /\$\{\w+\}/i - new_string = string_format - matches = string_format.scan reg - matches.each do |match| - keyword = match.scan(/\w+/i).first.downcase - - if subs.has_key? keyword - sub = keyword - else - sub = "" - end - - new_string.gsub!(match, sub) - end - - return new_string - end - def format_string_from_hash(hash) formatted = @format.clone matches = @format.scan(/([\$][\{](\w+)[\}])/)