Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
| --- | --- | --- | --- |
Expand All @@ -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)
Expand Down
19 changes: 0 additions & 19 deletions lib/barr/block.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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+)[\}])/)
Expand Down