musk 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: df87916c30e6fcf75b145d540bf7c337040cc7c4
4
+ data.tar.gz: b7d8741df91d111578a923447378c0ff81552537
5
+ SHA512:
6
+ metadata.gz: 08eefa33efe915736f2ecc9328f59239f6a42ccb9ea2a7c9546d70dad8c225aa2a104d8109cca0eef1699d74706003906e80309da940148b1cc8af60d2d38c20
7
+ data.tar.gz: 24a3b257af512d5f3a75fb52a2b721a6acf4a86a9a648a550692b5495b353da7988971910d474316feece99fcb1ba53413c9fb4f3c24385e02f19a722bd57082
data/.gitignore ADDED
@@ -0,0 +1,5 @@
1
+ *.swp
2
+ .ruby-version
3
+ .bundle
4
+ .rspec
5
+ .DS_Store
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,38 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ musk (0.0.1)
5
+ discogs-wrapper (~> 1.1.4)
6
+ gli (~> 2.9.0)
7
+ taglib-ruby (~> 0.6.0)
8
+
9
+ GEM
10
+ remote: https://rubygems.org/
11
+ specs:
12
+ coderay (1.1.0)
13
+ diff-lcs (1.2.5)
14
+ discogs-wrapper (1.1.4)
15
+ gli (2.9.0)
16
+ method_source (0.8.2)
17
+ pry (0.9.12.6)
18
+ coderay (~> 1.0)
19
+ method_source (~> 0.8)
20
+ slop (~> 3.4)
21
+ rspec (2.14.1)
22
+ rspec-core (~> 2.14.0)
23
+ rspec-expectations (~> 2.14.0)
24
+ rspec-mocks (~> 2.14.0)
25
+ rspec-core (2.14.8)
26
+ rspec-expectations (2.14.5)
27
+ diff-lcs (>= 1.1.3, < 2.0)
28
+ rspec-mocks (2.14.6)
29
+ slop (3.5.0)
30
+ taglib-ruby (0.6.0)
31
+
32
+ PLATFORMS
33
+ ruby
34
+
35
+ DEPENDENCIES
36
+ musk!
37
+ pry (~> 0.9.12.6)
38
+ rspec (~> 2.14.1)
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2014
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,2 @@
1
+ musk
2
+ ====
data/bin/musk ADDED
@@ -0,0 +1,52 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'taglib'
4
+ require 'gli'
5
+
6
+ include GLI::App
7
+
8
+ desc 'Extract meta-data (tags) from MP3 files'
9
+ arg_name 'path_to_files'
10
+ command :extract do |command|
11
+ command.action do |global_options, options, args|
12
+ if args.empty?
13
+ STDERR.puts 'Undefined path to an MP3 file or files'
14
+ exit 1
15
+ end
16
+ unless File.directory?(args.first)
17
+ unless File.file?(args.first)
18
+ STDERR.puts "Unknown path '#{args.first}' to an MP3 file or files"
19
+ exit 2
20
+ end
21
+ unless File.extname(args.first) == '.mp3'
22
+ STDERR.puts "Unknown extension '#{File.extname(args.first)}'"
23
+ exit 2
24
+ end
25
+ end
26
+ tracks = []
27
+ if File.file?(args.first)
28
+ tracks << args.first
29
+ else
30
+ Dir.glob(File.join(args.first, '**', '*.mp3')) do |track|
31
+ tracks << track
32
+ end
33
+ end
34
+ tracks.each_with_index do |track, index|
35
+ TagLib::MPEG::File.open(track) do |file|
36
+ tag = file.id3v2_tag
37
+ puts if index > 0
38
+ printf("%-9s%s\n", 'File:', track)
39
+ printf("%-9s%s\n", 'Cover:', !tag.frame_list('APIC').first.nil?)
40
+ printf("%-9s%s\n", 'Track:', tag.frame_list('TRCK').first)
41
+ printf("%-9s%s\n", 'Title:', tag.title)
42
+ printf("%-9s%s\n", 'Artist:', tag.artist)
43
+ printf("%-9s%s\n", 'Album:', tag.album)
44
+ printf("%-9s%s\n", 'Genre:', tag.genre)
45
+ printf("%-9s%s\n", 'Year:', tag.year)
46
+ printf("%-9s%s\n", 'Comment:', tag.comment)
47
+ end
48
+ end
49
+ end
50
+ end
51
+
52
+ exit run(ARGV)
data/lib/musk.rb ADDED
@@ -0,0 +1,5 @@
1
+ class Musk
2
+ def self.hi
3
+ "Hello world!"
4
+ end
5
+ end
data/musk.gemspec ADDED
@@ -0,0 +1,20 @@
1
+ Gem::Specification.new do |s|
2
+ s.name = 'musk'
3
+ s.version = '0.0.1'
4
+ s.summary = 'Your music with the demonic scent of musk'
5
+ s.description = 'Your music with the demonic scent of musk.'
6
+ s.homepage = 'https://github.com/pempel/musk'
7
+ s.date = '2014-03-19'
8
+ s.author = 'Eugene Pempel'
9
+ s.email = 'eugene.pempel@gmail.com'
10
+ s.license = 'MIT'
11
+ s.files = `git ls-files`.split($\)
12
+ s.executables = `git ls-files -- bin/*`.split($\).map { |f| File.basename(f) }
13
+
14
+ s.add_runtime_dependency 'gli', '~> 2.9'
15
+ s.add_runtime_dependency 'taglib-ruby', '~> 0.6'
16
+ s.add_runtime_dependency 'discogs-wrapper', '~> 1.1'
17
+
18
+ s.add_development_dependency 'pry', '~> 0.9'
19
+ s.add_development_dependency 'rspec', '~> 2.14'
20
+ end
data/spec/musk_spec.rb ADDED
@@ -0,0 +1,9 @@
1
+ require 'spec_helper'
2
+
3
+ describe Musk do
4
+ describe '.hi' do
5
+ it 'should return "Hello world!"' do
6
+ Musk.hi.should eq("Hello world!")
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,4 @@
1
+ require 'bundler/setup'
2
+ Bundler.setup
3
+
4
+ require 'musk'
metadata ADDED
@@ -0,0 +1,124 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: musk
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Eugene Pempel
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-03-19 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: gli
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '2.9'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '2.9'
27
+ - !ruby/object:Gem::Dependency
28
+ name: taglib-ruby
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '0.6'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '0.6'
41
+ - !ruby/object:Gem::Dependency
42
+ name: discogs-wrapper
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.1'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '1.1'
55
+ - !ruby/object:Gem::Dependency
56
+ name: pry
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '0.9'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '0.9'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rspec
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '2.14'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '2.14'
83
+ description: Your music with the demonic scent of musk.
84
+ email: eugene.pempel@gmail.com
85
+ executables:
86
+ - musk
87
+ extensions: []
88
+ extra_rdoc_files: []
89
+ files:
90
+ - ".gitignore"
91
+ - Gemfile
92
+ - Gemfile.lock
93
+ - LICENSE
94
+ - README.md
95
+ - bin/musk
96
+ - lib/musk.rb
97
+ - musk.gemspec
98
+ - spec/musk_spec.rb
99
+ - spec/spec_helper.rb
100
+ homepage: https://github.com/pempel/musk
101
+ licenses:
102
+ - MIT
103
+ metadata: {}
104
+ post_install_message:
105
+ rdoc_options: []
106
+ require_paths:
107
+ - lib
108
+ required_ruby_version: !ruby/object:Gem::Requirement
109
+ requirements:
110
+ - - ">="
111
+ - !ruby/object:Gem::Version
112
+ version: '0'
113
+ required_rubygems_version: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ requirements: []
119
+ rubyforge_project:
120
+ rubygems_version: 2.2.2
121
+ signing_key:
122
+ specification_version: 4
123
+ summary: Your music with the demonic scent of musk
124
+ test_files: []