Skip to content

Commit

Permalink
update README and add github action for gem push
Browse files Browse the repository at this point in the history
  • Loading branch information
aidewoode committed Jul 2, 2020
1 parent f5a78ec commit 7f465fe
Show file tree
Hide file tree
Showing 4 changed files with 105 additions and 14 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/gem-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Ruby Gem

on:
push:
tags:
- v*

jobs:
create_release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: false
prerelease: false
build:
name: Build + Publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Ruby 2.5
uses: actions/setup-ruby@v1
with:
version: 2.5.x

- name: Publish to RubyGems
run: |
mkdir -p $HOME/.gem
touch $HOME/.gem/credentials
chmod 0600 $HOME/.gem/credentials
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
gem build *.gemspec
gem push *.gem
env:
GEM_HOST_API_KEY: ${{secrets.RUBYGEMS_AUTH_TOKEN}}
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) Aidewoode <aidewoode@gmail.com>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
47 changes: 37 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
# WahWah

Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/wahwah`. To experiment with that code, run `bin/console` for an interactive prompt.
[![Build Status](https://travis-ci.org/aidewoode/wahwah.svg?branch=master)](https://travis-ci.org/aidewoode/wahwah)
[![codecov](https://codecov.io/gh/aidewoode/wahwah/branch/master/graph/badge.svg)](https://codecov.io/gh/aidewoode/wahwah)

TODO: Delete this and the text above, and describe your gem
WahWah is an audio metadata reader ruby gem, it supports many popular formats including mp3(ID3 v1, v2.2, v2.3, v2.4), m4a, ogg, oga, opus, wav, flac and wma.

WahWah is written in pure ruby, and without any dependencies.

## Installation

Expand All @@ -20,16 +23,40 @@ Or install it yourself as:

$ gem install wahwah

## Usage

TODO: Write usage instructions here

## Development
## Compatibility

After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
WahWah support ruby 2.5+

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).
## Usage

## Contributing
WahWah is so easy to use.

Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/wahwah.
```ruby
# Get metadata from an audio file

tag = WahWah.open('/files/example.mp3')

tag.title # => 'song title'
tag.artist # => 'artist name'
tag.album # => 'album name'
tag.albumartist # => 'albumartist name'
tag.composer # => 'composer name'
tag.comments # => ['comment', 'another comment']
tag.track # => 1
tag.track_total # => 10
tag.genre # => 'Rock'
tag.year # => '1984'
tag.disc # => 1
tag.disc_total # => 2
tag.duration # => 256 (in seconds)
tag.bitrate # => 192 (in kbps)
tag.sample_rate # => 44100 (in Hz)
tag.file_size # => 976700 (in bytes)
tag.images # => [{ :type => :cover_front, :mime_type => 'image/jpeg', :data => 'image data binary string' }]


# Get all support formats

WahWah.support_formats # => ['mp3', 'ogg', 'oga', 'opus', 'wav', 'flac', 'wma', 'm4a']
```
8 changes: 4 additions & 4 deletions wahwah.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ Gem::Specification.new do |spec|
spec.authors = ['aidewoode']
spec.email = ['aidewoode@gmail.com']

spec.summary = 'A library for reading meta data from audio'
spec.description = 'A library written in pure ruby for reading meta data from audio, and support several common audio formats.'
spec.summary = 'Audio metadata reader ruby gem'
spec.description = 'WahWah is an audio metadata reader ruby gem, it supports many popular formats including mp3(ID3 v1, v2.2, v2.3, v2.4), m4a, ogg, oga, opus, wav, flac and wma.'
spec.homepage = 'https://github.com/aidewoode'
spec.license = 'MIT'

spec.files = `git ls-files -z`.split("\x0").reject do |f|
f.match(%r{^(test|spec|features)/})
spec.files = `git ls-files -z`.split("\x0").select do |f|
f.start_with?('lib', 'pagy.gemspec', 'LICENSE')
end

spec.required_ruby_version = '>= 2.5.0'
Expand Down

0 comments on commit 7f465fe

Please sign in to comment.