lastfm-tail 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/README.md +9 -0
  2. data/bin/lastfm-tail +10 -4
  3. metadata +2 -2
data/README.md CHANGED
@@ -1,6 +1,15 @@
1
1
  A small script, inspired by the Unix `tail` utility, for viewing
2
2
  recently-scrobbled tracks on [Last.fm](http://last.fm).
3
3
 
4
+ # Installation
5
+
6
+ gem install lastfm-tail
7
+
8
+ or
9
+
10
+ curl -s https://raw.github.com/xiongchiamiov/lastfm-tail/master/bin/lastfm-tail > ~/bin/lastfm-tail
11
+ chmod +x ~/bin/lastfm-tail
12
+
4
13
  # Options
5
14
 
6
15
  Usage: lastfm-tail [options] [USER]
data/bin/lastfm-tail CHANGED
@@ -5,21 +5,27 @@ require 'open-uri'
5
5
  require 'optparse'
6
6
  require 'xmlsimple'
7
7
 
8
+ # Show prettier output on interrupt (ctrl+c)
9
+ trap("INT") do |s|
10
+ puts
11
+ exit(s)
12
+ end
13
+
8
14
  trackLimit = 10
9
15
  pollFrequency = nil
10
16
  reverse = false
11
17
  OptionParser.new do |opts|
12
- opts.banner = "Usage: #{$0} [options] [USER]"
18
+ opts.banner = "Usage: #{$0.split('/').last} [options] [USER]"
13
19
 
14
20
  opts.on('-f', '--follow', "Don't exit after retrieving data, but poll "\
15
21
  +"Last.fm for new tracks. Polling frequency "\
16
- +"is controlled by the `-F` option. Implies -r.") do
22
+ +"is controlled by the -F option. Implies -r.") do
17
23
  pollFrequency = 5 # Magic number
18
24
  reverse = true
19
25
  end
20
26
 
21
27
  opts.on('-F', '--frequency NUM', Integer, 'Poll Last.fm every NUM seconds. '\
22
- +'Defaults to 5. Implies `-f`. ') do |num|
28
+ +'Defaults to 5. Implies -f. ') do |num|
23
29
  pollFrequency = num
24
30
  end
25
31
 
@@ -37,7 +43,7 @@ OptionParser.new do |opts|
37
43
  end
38
44
 
39
45
  opts.on('-v', '--version', 'Show the installed version of lastfm-tail.') do
40
- puts 'lastfm-tail 1.0'
46
+ puts 'lastfm-tail 1.0.1'
41
47
  exit 0
42
48
  end
43
49
 
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: lastfm-tail
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.0.0
5
+ version: 1.0.1
6
6
  platform: ruby
7
7
  authors:
8
8
  - xiongchiamiov
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-12-29 00:00:00 -08:00
13
+ date: 2012-01-16 00:00:00 -08:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency