diff --git a/README.md b/README.md index 74769e4..28145e7 100644 --- a/README.md +++ b/README.md @@ -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: @@ -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/). @@ -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 @@ -131,7 +132,7 @@ Linux: Windows: - $ budik.exe --help + $ budik.bat --help ### Scheduling @@ -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 diff --git a/bin/budik b/bin/budik new file mode 100644 index 0000000..e4142b9 --- /dev/null +++ b/bin/budik @@ -0,0 +1,4 @@ +#!/usr/bin/env ruby + +require './lib/budik' +Budik::Budik.new.run diff --git a/bin/budik.bat b/bin/budik.bat new file mode 100644 index 0000000..7bbd574 --- /dev/null +++ b/bin/budik.bat @@ -0,0 +1,5 @@ +@echo off + +cd %~dp0 +cd .. +ruby ./lib/budik.rb %* diff --git a/config/templates/lang/en.yml b/config/templates/lang/en.yml index 069febb..a073983 100644 --- a/config/templates/lang/en.yml +++ b/config/templates/lang/en.yml @@ -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." diff --git a/lib/budik.rb b/lib/budik.rb index 065366b..436700e 100644 --- a/lib/budik.rb +++ b/lib/budik.rb @@ -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 diff --git a/lib/budik/command.rb b/lib/budik/command.rb index 184944d..468b228 100644 --- a/lib/budik/command.rb +++ b/lib/budik/command.rb @@ -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 diff --git a/lib/budik/io.rb b/lib/budik/io.rb index bcc7c4f..862134b 100644 --- a/lib/budik/io.rb +++ b/lib/budik/io.rb @@ -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