number_tunes 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 61fd56598721c1f088e2c3abc757fe83ff5688ed64cb5bd3c01c587adb98befc
4
+ data.tar.gz: 377d2e11b65f43f6aff83bd647756e9b92ec49eea52176dad613d1a4cb7eb99e
5
+ SHA512:
6
+ metadata.gz: 4b74ac690ea23aa3ca55d386c6c9e045455d68c2c1664d2e68254daa89778a2e815d09e53255387cb88b7f14967e4e3861bde5b5523f6729c2d57d31f88fddac
7
+ data.tar.gz: a66b7118e2aa33e460292b017143ca52bab791d7238b3bf05cf05e3853336ba65118d0180d68ea8371540fec0b4794c2f0db255b73cb56fd1e5dc1f74c10c864
@@ -0,0 +1,8 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source "https://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in number_tunes.gemspec
4
+ gemspec
5
+
6
+ gem "rake", "~> 13.0"
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2020 Shugo Maeda
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
13
+ all 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
21
+ THE SOFTWARE.
@@ -0,0 +1,28 @@
1
+ # number_tunes
2
+
3
+ number_tunes is a tool to add track numbers to tune titles and to add
4
+ years to album titles.
5
+ It is written for MAZDA CONNECT on MAZDA3.
6
+
7
+ ## Installation
8
+
9
+ $ gem install number_tunes
10
+
11
+ ## Usage
12
+
13
+ $ number_tunes <directory>
14
+
15
+ ## Development
16
+
17
+ After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
18
+
19
+ 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).
20
+
21
+ ## Contributing
22
+
23
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/number_tunes.
24
+
25
+
26
+ ## License
27
+
28
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+ task :default => []
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "number_tunes"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start(__FILE__)
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "taglib"
4
+
5
+ dir = ARGV.shift&.sub(/\/\z/, "")
6
+ unless dir
7
+ STDERR.puts("number_tunes <directory>")
8
+ exit 1
9
+ end
10
+
11
+ Dir.glob("#{dir}/**/*.{mp3,m4a}") do |path|
12
+ TagLib::FileRef.open(path) do |fileref|
13
+ next if fileref.null?
14
+ tag = fileref.tag
15
+ if tag.title && tag.track > 0
16
+ prefix = format("%02d ", tag.track)
17
+ if !tag.title.start_with?(prefix)
18
+ tag.title = prefix + tag.title
19
+ end
20
+ end
21
+ if tag.album && tag.year > 0
22
+ prefix = format("%04d ", tag.year)
23
+ if !tag.album.start_with?(prefix)
24
+ tag.album = prefix + tag.album
25
+ end
26
+ end
27
+ fileref.save
28
+ end
29
+ end
@@ -0,0 +1,23 @@
1
+ Gem::Specification.new do |spec|
2
+ spec.name = "number_tunes"
3
+ spec.version = "0.0.1"
4
+ spec.authors = ["Shugo Maeda"]
5
+ spec.email = ["shugo@ruby-lang.org"]
6
+
7
+ spec.summary = %q{A tool to add track numbers to tune titles}
8
+ spec.description = %q{A tool to add track numbers to tune titles}
9
+ spec.homepage = "https://github.com/shugo/number_tunes/"
10
+ spec.license = "MIT"
11
+ spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
12
+
13
+ # Specify which files should be added to the gem when it is released.
14
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
15
+ spec.files = Dir.chdir(File.expand_path("..", __FILE__)) do
16
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
17
+ end
18
+ spec.bindir = "exe"
19
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
+ spec.require_paths = ["lib"]
21
+
22
+ spec.add_runtime_dependency "taglib-ruby"
23
+ end
metadata ADDED
@@ -0,0 +1,67 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: number_tunes
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Shugo Maeda
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2020-06-28 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: taglib-ruby
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ description: A tool to add track numbers to tune titles
28
+ email:
29
+ - shugo@ruby-lang.org
30
+ executables:
31
+ - number_tunes
32
+ extensions: []
33
+ extra_rdoc_files: []
34
+ files:
35
+ - ".gitignore"
36
+ - Gemfile
37
+ - LICENSE.txt
38
+ - README.md
39
+ - Rakefile
40
+ - bin/console
41
+ - bin/setup
42
+ - exe/number_tunes
43
+ - number_tunes.gemspec
44
+ homepage: https://github.com/shugo/number_tunes/
45
+ licenses:
46
+ - MIT
47
+ metadata: {}
48
+ post_install_message:
49
+ rdoc_options: []
50
+ require_paths:
51
+ - lib
52
+ required_ruby_version: !ruby/object:Gem::Requirement
53
+ requirements:
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ version: 2.3.0
57
+ required_rubygems_version: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ requirements: []
63
+ rubygems_version: 3.2.0.pre1
64
+ signing_key:
65
+ specification_version: 4
66
+ summary: A tool to add track numbers to tune titles
67
+ test_files: []