Skip to content

Commit

Permalink
Readme and output adjustments, "binaries"
Browse files Browse the repository at this point in the history
  • Loading branch information
JBlackN committed Sep 20, 2015
1 parent 597d99e commit 72b631a
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 11 deletions.
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ __Warning:__ The application is intended for casual use only. Occurence of bugs
* Linux
* Raspberry Pi
* Applications:
* Ruby (> 1.9.2)
* VLC media player (Windows, Linux) or omxplayer (Raspberry Pi)
* FFmpeg or Libav
* If you need to (un)mount or spin down storage devices, these applications are tested:
Expand All @@ -41,7 +42,7 @@ Or install it yourself as:

## Configuration

When the application is run for the first time, it automatically creates its configuration in `your\_home\_directory/.budik/`. Edit `options.yml` and `sources.yml` as needed.
When the application is run for the first time, it automatically creates its configuration in `your_home_directory/.budik/`. Edit `options.yml` and `sources.yml` as needed.

For information about correct YAML syntax, look [here](http://learnxinyminutes.com/docs/yaml/).

Expand Down Expand Up @@ -84,8 +85,8 @@ sources:
path: "path to sources file (default: ~/.budik/sources.yml)"
tv:
available: "self-explainatory (true or false)"
use\_if\_no\_video: "self-explainatory (true or false)"
wait\_secs\_after\_on: "give TV time to turn on (default: 15)"
use_if_no_video: "self-explainatory (true or false)"
wait_secs_after_on: "give TV time to turn on (default: 15)"
```

### Sources.yml - explanation
Expand Down Expand Up @@ -131,7 +132,7 @@ Linux:

Windows:

$ budik.exe --help
$ budik.bat --help

### Scheduling

Expand All @@ -156,7 +157,7 @@ After checking out the repo, run `bin/setup` to install dependencies. Then, run

To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).

## TODO (Ideas)
## Todo (Ideas)

* [ ] Better sources management (add, remove, etc.)
* [ ] Scheduling without need to interact with external tools
Expand Down
4 changes: 4 additions & 0 deletions bin/budik
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env ruby

require './lib/budik'
Budik::Budik.new.run
5 changes: 5 additions & 0 deletions bin/budik.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@echo off

cd %~dp0
cd ..
ruby ./lib/budik.rb %*
3 changes: 2 additions & 1 deletion config/templates/lang/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@ budik:
summary: "Translate app."
description: "Opens your language file in your default editor."
output:
alarm: "Alarm"
category: "Category"
date: "DateTime"
number: "Number"
alarm: "Alarm"
sources:
invalid_format: "Invalid sources format."
invalid_item: "Item %1 is invalid."
2 changes: 1 addition & 1 deletion lib/budik.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def initialize
# Describes application's command line interface. Runs the application.
def run
program :name, 'Budik'
program :version, Budik::VERSION
program :version, VERSION
program :description, @strings.description

commands
Expand Down
2 changes: 1 addition & 1 deletion lib/budik/command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def run_prepare(opts, sources, devices, rng, io)
number = opts.number || rng.generate(sources.count)
source = sources.get(number)

puts io.run_info_table(number, source[:name])
puts io.run_info_table(source, number)
source
end

Expand Down
7 changes: 4 additions & 3 deletions lib/budik/io.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@ def initialize
# to the console.
#
# - *Args*:
# - +source+ -> Selected source (Hash).
# - +number+ -> Number of selected source (Fixnum).
# - +name+ -> Name of selected source (String).
#
def run_info_table(number, name)
def run_info_table(source, number)
title = 'Budik - ' + DateTime.now.strftime('%d/%m/%Y %H:%M')

rows = []
rows << [@strings.alarm, name]
rows << [@strings.alarm, source[:name]]
rows << [@strings.category, source[:category].to_s]
rows << [@strings.number, number.to_s]

Terminal::Table.new title: title, rows: rows
Expand Down

0 comments on commit 72b631a

Please sign in to comment.