lyricli 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/bin/lrc +4 -2
- data/lib/lyricli.rb +6 -1
- data/lib/lyricli/configuration.rb +2 -2
- data/lib/lyricli/lyricli.rb +9 -2
- data/lib/lyricli/lyrics_engine.rb +5 -1
- metadata +50 -68
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 4a3c40e40ef5bbfcb2e58f24190e9e16d9cfe833
|
4
|
+
data.tar.gz: 0730ffe22cf4ab44f33933337814e6db33d34f08
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 445a763aac0d369a8c703f5427a90ab4c0c98b16485d62aa9543b6e4c4e2de859e871974ab7c32cc7b920edaf98a238c40359ec71203e5b05802eeed91a22c1d
|
7
|
+
data.tar.gz: fd938e701f9e2a780f56204f003472e070133130235bddd7b136fe68901fdf5eb000dc6ac4d43f9e30e5c4436adbc310de415c0cf94a13fa172f8536739b0909
|
data/bin/lrc
CHANGED
@@ -3,8 +3,6 @@
|
|
3
3
|
require 'optparse'
|
4
4
|
require 'lyricli'
|
5
5
|
|
6
|
-
|
7
|
-
options = {}
|
8
6
|
OptionParser.new do |opts|
|
9
7
|
opts.banner = %{Usage:
|
10
8
|
lrc [options]
|
@@ -37,6 +35,10 @@ Options:
|
|
37
35
|
exit
|
38
36
|
end
|
39
37
|
|
38
|
+
opts.on("-t", "--title", "Shows the song title and artist") do
|
39
|
+
Lyricli.show_title
|
40
|
+
end
|
41
|
+
|
40
42
|
opts.on("-h", "--help", "Shows this message") do
|
41
43
|
puts opts
|
42
44
|
exit
|
data/lib/lyricli.rb
CHANGED
@@ -40,7 +40,7 @@ module Lyricli
|
|
40
40
|
# @return [String] the fetched lyrics
|
41
41
|
def self.lyrics
|
42
42
|
@lyricli = Lyricli.new
|
43
|
-
@lyricli.get_lyrics
|
43
|
+
@lyricli.get_lyrics(@show_title)
|
44
44
|
end
|
45
45
|
|
46
46
|
# Returns the version of the library
|
@@ -93,4 +93,9 @@ module Lyricli
|
|
93
93
|
def self.root
|
94
94
|
File.expand_path('../..',__FILE__)
|
95
95
|
end
|
96
|
+
|
97
|
+
# Sets the show_title instance variable so it requests the title
|
98
|
+
def self.show_title
|
99
|
+
@show_title = true
|
100
|
+
end
|
96
101
|
end
|
@@ -56,7 +56,7 @@ module Lyricli
|
|
56
56
|
def load_config
|
57
57
|
path = File.expand_path(@config_path)
|
58
58
|
|
59
|
-
if File.
|
59
|
+
if File.exist?(path)
|
60
60
|
file = File.new(path, "r")
|
61
61
|
@config = MultiJson.decode(file.read)
|
62
62
|
else
|
@@ -79,7 +79,7 @@ module Lyricli
|
|
79
79
|
# Load the default
|
80
80
|
path = File.join(::Lyricli.root, "config", @defaults_path)
|
81
81
|
|
82
|
-
if File.
|
82
|
+
if File.exist?(path)
|
83
83
|
file = File.new(path, "r")
|
84
84
|
@config = MultiJson.decode(file.read)
|
85
85
|
else
|
data/lib/lyricli/lyricli.rb
CHANGED
@@ -21,7 +21,7 @@ module Lyricli
|
|
21
21
|
# LyricsEngine
|
22
22
|
#
|
23
23
|
# @return [String] the found lyrics, or a string indicating none were found
|
24
|
-
def get_lyrics
|
24
|
+
def get_lyrics(show_title=false)
|
25
25
|
|
26
26
|
begin
|
27
27
|
set_current_track
|
@@ -33,7 +33,14 @@ module Lyricli
|
|
33
33
|
engine = LyricsEngine.new(@current_track[:artist], @current_track[:song])
|
34
34
|
|
35
35
|
begin
|
36
|
-
|
36
|
+
lyrics_output = engine.get_lyrics
|
37
|
+
|
38
|
+
if show_title
|
39
|
+
lyrics_title = "#{@current_track[:artist]} - #{@current_track[:song]}"
|
40
|
+
lyrics_output = "#{lyrics_title}\n\n#{lyrics_output}"
|
41
|
+
end
|
42
|
+
|
43
|
+
return lyrics_output
|
37
44
|
rescue Exceptions::LyricsNotFoundError
|
38
45
|
return "Lyrics not found :("
|
39
46
|
end
|
metadata
CHANGED
@@ -1,144 +1,127 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lyricli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.0.2
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Ben Beltran
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2014-11-14 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: nokogiri
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- - ~>
|
17
|
+
- - "~>"
|
20
18
|
- !ruby/object:Gem::Version
|
21
|
-
version: 1.5
|
19
|
+
version: '1.5'
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- - ~>
|
24
|
+
- - "~>"
|
28
25
|
- !ruby/object:Gem::Version
|
29
|
-
version: 1.5
|
26
|
+
version: '1.5'
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: multi_json
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- - ~>
|
31
|
+
- - "~>"
|
36
32
|
- !ruby/object:Gem::Version
|
37
|
-
version: 1.3
|
33
|
+
version: '1.3'
|
38
34
|
type: :runtime
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- - ~>
|
38
|
+
- - "~>"
|
44
39
|
- !ruby/object:Gem::Version
|
45
|
-
version: 1.3
|
40
|
+
version: '1.3'
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: rdio
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
|
-
- - ~>
|
45
|
+
- - "~>"
|
52
46
|
- !ruby/object:Gem::Version
|
53
|
-
version: 0.1
|
47
|
+
version: '0.1'
|
54
48
|
type: :runtime
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
|
-
- - ~>
|
52
|
+
- - "~>"
|
60
53
|
- !ruby/object:Gem::Version
|
61
|
-
version: 0.1
|
54
|
+
version: '0.1'
|
62
55
|
- !ruby/object:Gem::Dependency
|
63
56
|
name: launchy
|
64
57
|
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
58
|
requirements:
|
67
|
-
- - ~>
|
59
|
+
- - "~>"
|
68
60
|
- !ruby/object:Gem::Version
|
69
|
-
version: 2.1
|
61
|
+
version: '2.1'
|
70
62
|
type: :runtime
|
71
63
|
prerelease: false
|
72
64
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
65
|
requirements:
|
75
|
-
- - ~>
|
66
|
+
- - "~>"
|
76
67
|
- !ruby/object:Gem::Version
|
77
|
-
version: 2.1
|
68
|
+
version: '2.1'
|
78
69
|
- !ruby/object:Gem::Dependency
|
79
70
|
name: ruby-debug19
|
80
71
|
requirement: !ruby/object:Gem::Requirement
|
81
|
-
none: false
|
82
72
|
requirements:
|
83
|
-
- - ~>
|
73
|
+
- - "~>"
|
84
74
|
- !ruby/object:Gem::Version
|
85
|
-
version: 0.11
|
75
|
+
version: '0.11'
|
86
76
|
type: :development
|
87
77
|
prerelease: false
|
88
78
|
version_requirements: !ruby/object:Gem::Requirement
|
89
|
-
none: false
|
90
79
|
requirements:
|
91
|
-
- - ~>
|
80
|
+
- - "~>"
|
92
81
|
- !ruby/object:Gem::Version
|
93
|
-
version: 0.11
|
82
|
+
version: '0.11'
|
94
83
|
- !ruby/object:Gem::Dependency
|
95
84
|
name: yard
|
96
85
|
requirement: !ruby/object:Gem::Requirement
|
97
|
-
none: false
|
98
86
|
requirements:
|
99
|
-
- - ~>
|
87
|
+
- - "~>"
|
100
88
|
- !ruby/object:Gem::Version
|
101
|
-
version: 0.8
|
89
|
+
version: '0.8'
|
102
90
|
type: :development
|
103
91
|
prerelease: false
|
104
92
|
version_requirements: !ruby/object:Gem::Requirement
|
105
|
-
none: false
|
106
93
|
requirements:
|
107
|
-
- - ~>
|
94
|
+
- - "~>"
|
108
95
|
- !ruby/object:Gem::Version
|
109
|
-
version: 0.8
|
96
|
+
version: '0.8'
|
110
97
|
- !ruby/object:Gem::Dependency
|
111
98
|
name: thin
|
112
99
|
requirement: !ruby/object:Gem::Requirement
|
113
|
-
none: false
|
114
100
|
requirements:
|
115
|
-
- - ~>
|
101
|
+
- - "~>"
|
116
102
|
- !ruby/object:Gem::Version
|
117
|
-
version: 1.5
|
103
|
+
version: '1.5'
|
118
104
|
type: :development
|
119
105
|
prerelease: false
|
120
106
|
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
none: false
|
122
107
|
requirements:
|
123
|
-
- - ~>
|
108
|
+
- - "~>"
|
124
109
|
- !ruby/object:Gem::Version
|
125
|
-
version: 1.5
|
110
|
+
version: '1.5'
|
126
111
|
- !ruby/object:Gem::Dependency
|
127
112
|
name: rspec
|
128
113
|
requirement: !ruby/object:Gem::Requirement
|
129
|
-
none: false
|
130
114
|
requirements:
|
131
|
-
- - ~>
|
115
|
+
- - "~>"
|
132
116
|
- !ruby/object:Gem::Version
|
133
|
-
version: 2.11
|
117
|
+
version: '2.11'
|
134
118
|
type: :development
|
135
119
|
prerelease: false
|
136
120
|
version_requirements: !ruby/object:Gem::Requirement
|
137
|
-
none: false
|
138
121
|
requirements:
|
139
|
-
- - ~>
|
122
|
+
- - "~>"
|
140
123
|
- !ruby/object:Gem::Version
|
141
|
-
version: 2.11
|
124
|
+
version: '2.11'
|
142
125
|
description: Lyricli is an awesome CLI tool to read the lyrics of your currently playing
|
143
126
|
song right in the command line
|
144
127
|
email: ben@nsovocal.com
|
@@ -147,7 +130,14 @@ executables:
|
|
147
130
|
extensions: []
|
148
131
|
extra_rdoc_files: []
|
149
132
|
files:
|
133
|
+
- Gemfile
|
134
|
+
- Gemfile.lock
|
135
|
+
- README.md
|
136
|
+
- bin/lrc
|
137
|
+
- config/defaults.json
|
138
|
+
- lib/lyricli.rb
|
150
139
|
- lib/lyricli/configuration.rb
|
140
|
+
- lib/lyricli/exceptions.rb
|
151
141
|
- lib/lyricli/exceptions/disable_source_error.rb
|
152
142
|
- lib/lyricli/exceptions/enable_source_error.rb
|
153
143
|
- lib/lyricli/exceptions/invalid_lyrics_error.rb
|
@@ -156,20 +146,15 @@ files:
|
|
156
146
|
- lib/lyricli/exceptions/source_configuration_error.rb
|
157
147
|
- lib/lyricli/exceptions/start_source_error.rb
|
158
148
|
- lib/lyricli/exceptions/unknown_source_error.rb
|
159
|
-
- lib/lyricli/exceptions.rb
|
160
149
|
- lib/lyricli/lyricli.rb
|
161
150
|
- lib/lyricli/lyrics_engine.rb
|
162
151
|
- lib/lyricli/source_manager.rb
|
152
|
+
- lib/lyricli/sources.rb
|
163
153
|
- lib/lyricli/sources/arguments.rb
|
154
|
+
- lib/lyricli/sources/current_song.scpt
|
164
155
|
- lib/lyricli/sources/itunes.rb
|
165
156
|
- lib/lyricli/sources/rdio.rb
|
166
|
-
- lib/lyricli/sources.rb
|
167
157
|
- lib/lyricli/util.rb
|
168
|
-
- lib/lyricli.rb
|
169
|
-
- bin/lrc
|
170
|
-
- Gemfile
|
171
|
-
- Gemfile.lock
|
172
|
-
- README.md
|
173
158
|
- spec/bin/lrc_spec.rb
|
174
159
|
- spec/lib/lyricli/configuration_spec.rb
|
175
160
|
- spec/lib/lyricli/exceptions_spec.rb
|
@@ -182,31 +167,28 @@ files:
|
|
182
167
|
- spec/lib/lyricli/sources_spec.rb
|
183
168
|
- spec/lib/lyricli/util_spec.rb
|
184
169
|
- spec/lib/lyricli_spec.rb
|
185
|
-
- config/defaults.json
|
186
|
-
- lib/lyricli/sources/current_song.scpt
|
187
170
|
homepage: http://nsovocal.com/lyricli
|
188
|
-
licenses:
|
171
|
+
licenses:
|
172
|
+
- BSD-3-Clause
|
173
|
+
metadata: {}
|
189
174
|
post_install_message:
|
190
175
|
rdoc_options: []
|
191
176
|
require_paths:
|
192
177
|
- lib
|
193
178
|
required_ruby_version: !ruby/object:Gem::Requirement
|
194
|
-
none: false
|
195
179
|
requirements:
|
196
|
-
- -
|
180
|
+
- - ">="
|
197
181
|
- !ruby/object:Gem::Version
|
198
182
|
version: '0'
|
199
183
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
200
|
-
none: false
|
201
184
|
requirements:
|
202
|
-
- -
|
185
|
+
- - ">="
|
203
186
|
- !ruby/object:Gem::Version
|
204
187
|
version: '0'
|
205
188
|
requirements: []
|
206
189
|
rubyforge_project:
|
207
|
-
rubygems_version:
|
190
|
+
rubygems_version: 2.2.2
|
208
191
|
signing_key:
|
209
|
-
specification_version:
|
192
|
+
specification_version: 4
|
210
193
|
summary: Lyricli is an awesome lyric client for your Command Line
|
211
194
|
test_files: []
|
212
|
-
has_rdoc:
|