repo stringlengths 5 92 | file_url stringlengths 80 287 | file_path stringlengths 5 197 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 15:37:27 2026-01-04 17:58:21 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
aidewoode/wahwah | https://github.com/aidewoode/wahwah/blob/c451fbe9a49d04e1dd8743e904215f1a7cdb9918/test/wahwah/id3/v2_header_test.rb | test/wahwah/id3/v2_header_test.rb | # frozen_string_literal: true
require "test_helper"
class WahWah::ID3::V2HeaderTest < Minitest::Test
def test_header
content = StringIO.new("ID3\x04\x00\x00\x00\x00\x00-".b)
header = WahWah::ID3::V2Header.new(content)
assert !header.has_extended_header?
assert header.valid?
assert_equal 55, hea... | ruby | MIT | c451fbe9a49d04e1dd8743e904215f1a7cdb9918 | 2026-01-04T17:50:26.827863Z | false |
aidewoode/wahwah | https://github.com/aidewoode/wahwah/blob/c451fbe9a49d04e1dd8743e904215f1a7cdb9918/test/wahwah/id3/v1_test.rb | test/wahwah/id3/v1_test.rb | # frozen_string_literal: true
require "test_helper"
class WahWah::ID3::V1Test < Minitest::Test
def test_parse
content = StringIO.new("TAGChina Girl\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00Iggy Pop\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\... | ruby | MIT | c451fbe9a49d04e1dd8743e904215f1a7cdb9918 | 2026-01-04T17:50:26.827863Z | false |
aidewoode/wahwah | https://github.com/aidewoode/wahwah/blob/c451fbe9a49d04e1dd8743e904215f1a7cdb9918/test/wahwah/id3/image_frame_body_test.rb | test/wahwah/id3/image_frame_body_test.rb | # frozen_string_literal: true
require "test_helper"
class WahWah::ID3::ImageFrameBodyTest < Minitest::Test
def test_v2_image_frame_body
content = "\x00JPG\x00\x00\xFF\xD8\xFF\xE0\x00\x10JFIF\x00\x01\x02\x01\x00H\x00H\x00\x00\xFF\xE1\x1A\xE0Exif\x00\x00MM".b
value = WahWah::ID3::ImageFrameBody.new(content, 2... | ruby | MIT | c451fbe9a49d04e1dd8743e904215f1a7cdb9918 | 2026-01-04T17:50:26.827863Z | false |
aidewoode/wahwah | https://github.com/aidewoode/wahwah/blob/c451fbe9a49d04e1dd8743e904215f1a7cdb9918/test/wahwah/id3/comment_frame_body_test.rb | test/wahwah/id3/comment_frame_body_test.rb | # frozen_string_literal: true
require "test_helper"
class WahWah::ID3::CommentFrameBodyTest < Minitest::Test
def test_iso_8859_1_encode_comment
value = WahWah::ID3::CommentFrameBody.new("\x00eng\x00Iggy Pop Rocks".b, 4).value
assert_equal "Iggy Pop Rocks", value
assert_equal "UTF-8", value.encoding.nam... | ruby | MIT | c451fbe9a49d04e1dd8743e904215f1a7cdb9918 | 2026-01-04T17:50:26.827863Z | false |
aidewoode/wahwah | https://github.com/aidewoode/wahwah/blob/c451fbe9a49d04e1dd8743e904215f1a7cdb9918/test/wahwah/asf/object_test.rb | test/wahwah/asf/object_test.rb | # frozen_string_literal: true
require "test_helper"
class WahWah::Asf::ObjectTest < Minitest::Test
def test_parse
content = StringIO.new("\xA1\xDC\xAB\x8CG\xA9\xCF\x11\x8E\xE4\x00\xC0\f Seh\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x9AA\x04\x00\x00\x00\x00\x00\x... | ruby | MIT | c451fbe9a49d04e1dd8743e904215f1a7cdb9918 | 2026-01-04T17:50:26.827863Z | false |
aidewoode/wahwah | https://github.com/aidewoode/wahwah/blob/c451fbe9a49d04e1dd8743e904215f1a7cdb9918/lib/wahwah.rb | lib/wahwah.rb | # frozen_string_literal: true
require "stringio"
require "forwardable"
require "zlib"
require "pathname"
require "wahwah/version"
require "wahwah/errors"
require "wahwah/helper"
require "wahwah/tag_delegate"
require "wahwah/lazy_read"
require "wahwah/tag"
require "wahwah/id3/v1"
require "wahwah/id3/v2"
require "wahw... | ruby | MIT | c451fbe9a49d04e1dd8743e904215f1a7cdb9918 | 2026-01-04T17:50:26.827863Z | false |
aidewoode/wahwah | https://github.com/aidewoode/wahwah/blob/c451fbe9a49d04e1dd8743e904215f1a7cdb9918/lib/wahwah/tag.rb | lib/wahwah/tag.rb | # frozen_string_literal: true
module WahWah
class Tag
INTEGER_ATTRIBUTES = %i[disc disc_total track track_total]
INSPECT_ATTRIBUTES = %i[
title
artist
album
albumartist
composer
comments
track
track_total
genre
year
disc
disc_total
... | ruby | MIT | c451fbe9a49d04e1dd8743e904215f1a7cdb9918 | 2026-01-04T17:50:26.827863Z | false |
aidewoode/wahwah | https://github.com/aidewoode/wahwah/blob/c451fbe9a49d04e1dd8743e904215f1a7cdb9918/lib/wahwah/version.rb | lib/wahwah/version.rb | # frozen_string_literal: true
module WahWah
VERSION = "1.6.7"
end
| ruby | MIT | c451fbe9a49d04e1dd8743e904215f1a7cdb9918 | 2026-01-04T17:50:26.827863Z | false |
aidewoode/wahwah | https://github.com/aidewoode/wahwah/blob/c451fbe9a49d04e1dd8743e904215f1a7cdb9918/lib/wahwah/asf_tag.rb | lib/wahwah/asf_tag.rb | # frozen_string_literal: true
module WahWah
class AsfTag < Tag
HEADER_OBJECT_CONTENT_SIZE = 6
HEADER_OBJECT_GUID = "75B22630-668E-11CF-A6D9-00AA0062CE6C"
FILE_PROPERTIES_OBJECT_GUID = "8CABDCA1-A947-11CF-8EE4-00C00C205365"
EXTENDED_CONTENT_DESCRIPTION_OBJECT_GUID = "D2D0A440-E307-11D2-97F0-00A0C95EA8... | ruby | MIT | c451fbe9a49d04e1dd8743e904215f1a7cdb9918 | 2026-01-04T17:50:26.827863Z | false |
aidewoode/wahwah | https://github.com/aidewoode/wahwah/blob/c451fbe9a49d04e1dd8743e904215f1a7cdb9918/lib/wahwah/lazy_read.rb | lib/wahwah/lazy_read.rb | # frozen_string_literal: true
module WahWah
module LazyRead
def self.prepended(base)
base.class_eval do
attr_reader :size
end
end
def initialize(file_io, *arg)
@file_io = file_io
super(*arg)
@position = @file_io.pos
@data = get_data if @file_io.is_a?(StringIO)... | ruby | MIT | c451fbe9a49d04e1dd8743e904215f1a7cdb9918 | 2026-01-04T17:50:26.827863Z | false |
aidewoode/wahwah | https://github.com/aidewoode/wahwah/blob/c451fbe9a49d04e1dd8743e904215f1a7cdb9918/lib/wahwah/ogg_tag.rb | lib/wahwah/ogg_tag.rb | # frozen_string_literal: true
module WahWah
class OggTag < Tag
extend TagDelegate
tag_delegate :@tag,
:title,
:album,
:albumartist,
:track,
:artist,
:year,
:genre,
:disc,
:composer,
:sample_rate,
:lyrics
# Oggs require reading to the end... | ruby | MIT | c451fbe9a49d04e1dd8743e904215f1a7cdb9918 | 2026-01-04T17:50:26.827863Z | false |
aidewoode/wahwah | https://github.com/aidewoode/wahwah/blob/c451fbe9a49d04e1dd8743e904215f1a7cdb9918/lib/wahwah/errors.rb | lib/wahwah/errors.rb | # frozen_string_literal: true
module WahWah
class WahWahArgumentError < ArgumentError; end
class WahWahNotImplementedError < RuntimeError; end
end
| ruby | MIT | c451fbe9a49d04e1dd8743e904215f1a7cdb9918 | 2026-01-04T17:50:26.827863Z | false |
aidewoode/wahwah | https://github.com/aidewoode/wahwah/blob/c451fbe9a49d04e1dd8743e904215f1a7cdb9918/lib/wahwah/riff_tag.rb | lib/wahwah/riff_tag.rb | # frozen_string_literal: true
module WahWah
class RiffTag < Tag
extend TagDelegate
# see https://exiftool.org/TagNames/RIFF.html#Info for more info
INFO_ID_MAPPING = {
INAM: :title,
TITL: :title,
IART: :artist,
IPRD: :album,
ICMT: :comment,
ICRD: :year,
YEAR: :y... | ruby | MIT | c451fbe9a49d04e1dd8743e904215f1a7cdb9918 | 2026-01-04T17:50:26.827863Z | false |
aidewoode/wahwah | https://github.com/aidewoode/wahwah/blob/c451fbe9a49d04e1dd8743e904215f1a7cdb9918/lib/wahwah/mp4_tag.rb | lib/wahwah/mp4_tag.rb | # frozen_string_literal: true
module WahWah
class Mp4Tag < Tag
META_ATOM_MAPPING = {
"\xA9alb".b => :album,
"\xA9ART".b => :artist,
"\xA9cmt".b => :comment,
"\xA9wrt".b => :composer,
"\xA9day".b => :year,
"\xA9gen".b => :genre,
"\xA9nam".b => :title,
"\xA9lyr".b =>... | ruby | MIT | c451fbe9a49d04e1dd8743e904215f1a7cdb9918 | 2026-01-04T17:50:26.827863Z | false |
aidewoode/wahwah | https://github.com/aidewoode/wahwah/blob/c451fbe9a49d04e1dd8743e904215f1a7cdb9918/lib/wahwah/mp3_tag.rb | lib/wahwah/mp3_tag.rb | # frozen_string_literal: true
module WahWah
class Mp3Tag < Tag
extend TagDelegate
extend Forwardable
def_delegator :@mpeg_frame_header, :version, :mpeg_version
def_delegator :@mpeg_frame_header, :layer, :mpeg_layer
def_delegator :@mpeg_frame_header, :kind, :mpeg_kind
def_delegators :@mpeg_fr... | ruby | MIT | c451fbe9a49d04e1dd8743e904215f1a7cdb9918 | 2026-01-04T17:50:26.827863Z | false |
aidewoode/wahwah | https://github.com/aidewoode/wahwah/blob/c451fbe9a49d04e1dd8743e904215f1a7cdb9918/lib/wahwah/tag_delegate.rb | lib/wahwah/tag_delegate.rb | # frozen_string_literal: true
module WahWah
module TagDelegate
def tag_delegate(accessor, *attributes)
attributes.each do |attr|
define_method(attr) do
tag = instance_variable_get(accessor)
return super() if tag.nil?
tag.send(attr)
end
end
end
end
... | ruby | MIT | c451fbe9a49d04e1dd8743e904215f1a7cdb9918 | 2026-01-04T17:50:26.827863Z | false |
aidewoode/wahwah | https://github.com/aidewoode/wahwah/blob/c451fbe9a49d04e1dd8743e904215f1a7cdb9918/lib/wahwah/flac_tag.rb | lib/wahwah/flac_tag.rb | # frozen_string_literal: true
module WahWah
class FlacTag < Tag
include Ogg::VorbisComment
include Flac::StreaminfoBlock
TAG_ID = "fLaC"
private
# FLAC structure:
#
# The four byte string "fLaC"
# The STREAMINFO metadata block
# Zero or more other metadata blocks
# One or m... | ruby | MIT | c451fbe9a49d04e1dd8743e904215f1a7cdb9918 | 2026-01-04T17:50:26.827863Z | false |
aidewoode/wahwah | https://github.com/aidewoode/wahwah/blob/c451fbe9a49d04e1dd8743e904215f1a7cdb9918/lib/wahwah/helper.rb | lib/wahwah/helper.rb | # frozen_string_literal: true
module WahWah
module Helper
def self.encode_to_utf8(string, source_encoding: "")
encoded_string = source_encoding.empty? ?
string.force_encoding("utf-8") :
string.encode("utf-8", source_encoding, invalid: :replace, undef: :replace, replace: "")
encoded_s... | ruby | MIT | c451fbe9a49d04e1dd8743e904215f1a7cdb9918 | 2026-01-04T17:50:26.827863Z | false |
aidewoode/wahwah | https://github.com/aidewoode/wahwah/blob/c451fbe9a49d04e1dd8743e904215f1a7cdb9918/lib/wahwah/ogg/opus_tag.rb | lib/wahwah/ogg/opus_tag.rb | # frozen_string_literal: true
module WahWah
module Ogg
class OpusTag
include VorbisComment
attr_reader :sample_rate, :pre_skip, *COMMET_FIELD_MAPPING.values
def initialize(identification_packet, comment_packet)
# Identification packet structure:
#
# 1) "OpusHead"
... | ruby | MIT | c451fbe9a49d04e1dd8743e904215f1a7cdb9918 | 2026-01-04T17:50:26.827863Z | false |
aidewoode/wahwah | https://github.com/aidewoode/wahwah/blob/c451fbe9a49d04e1dd8743e904215f1a7cdb9918/lib/wahwah/ogg/vorbis_comment.rb | lib/wahwah/ogg/vorbis_comment.rb | # frozen_string_literal: true
module WahWah
module Ogg
# Vorbis comment structure:
#
# 1) [vendor_length] = read an unsigned integer of 32 bits
# 2) [vendor_string] = read a UTF-8 vector as [vendor_length] octets
# 3) [user_comment_list_length] = read an unsigned integer of 32 bits
# 4) itera... | ruby | MIT | c451fbe9a49d04e1dd8743e904215f1a7cdb9918 | 2026-01-04T17:50:26.827863Z | false |
aidewoode/wahwah | https://github.com/aidewoode/wahwah/blob/c451fbe9a49d04e1dd8743e904215f1a7cdb9918/lib/wahwah/ogg/page.rb | lib/wahwah/ogg/page.rb | # frozen_string_literal: true
module WahWah
module Ogg
# The Ogg page header has the following format:
#
# 0 1 2 3
# 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1| Byte
# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-... | ruby | MIT | c451fbe9a49d04e1dd8743e904215f1a7cdb9918 | 2026-01-04T17:50:26.827863Z | false |
aidewoode/wahwah | https://github.com/aidewoode/wahwah/blob/c451fbe9a49d04e1dd8743e904215f1a7cdb9918/lib/wahwah/ogg/flac_tag.rb | lib/wahwah/ogg/flac_tag.rb | # frozen_string_literal: true
module WahWah
module Ogg
class FlacTag
include VorbisComment
include Flac::StreaminfoBlock
attr_reader :bitrate, :duration, :sample_rate, :bit_depth, *COMMET_FIELD_MAPPING.values
def initialize(identification_packet, comment_packet)
# Identification... | ruby | MIT | c451fbe9a49d04e1dd8743e904215f1a7cdb9918 | 2026-01-04T17:50:26.827863Z | false |
aidewoode/wahwah | https://github.com/aidewoode/wahwah/blob/c451fbe9a49d04e1dd8743e904215f1a7cdb9918/lib/wahwah/ogg/pages.rb | lib/wahwah/ogg/pages.rb | # frozen_string_literal: true
module WahWah
module Ogg
class Pages
include Enumerable
def initialize(file_io)
@file_io = file_io
end
def each
@file_io.rewind
until @file_io.eof?
page = Ogg::Page.new(@file_io)
break unless page.valid?
... | ruby | MIT | c451fbe9a49d04e1dd8743e904215f1a7cdb9918 | 2026-01-04T17:50:26.827863Z | false |
aidewoode/wahwah | https://github.com/aidewoode/wahwah/blob/c451fbe9a49d04e1dd8743e904215f1a7cdb9918/lib/wahwah/ogg/packets.rb | lib/wahwah/ogg/packets.rb | # frozen_string_literal: true
module WahWah
module Ogg
# From Ogg's perspective, packets can be of any arbitrary size. A
# specific media mapping will define how to group or break up packets
# from a specific media encoder. As Ogg pages have a maximum size of
# about 64 kBytes, sometimes a packet h... | ruby | MIT | c451fbe9a49d04e1dd8743e904215f1a7cdb9918 | 2026-01-04T17:50:26.827863Z | false |
aidewoode/wahwah | https://github.com/aidewoode/wahwah/blob/c451fbe9a49d04e1dd8743e904215f1a7cdb9918/lib/wahwah/ogg/vorbis_tag.rb | lib/wahwah/ogg/vorbis_tag.rb | # frozen_string_literal: true
module WahWah
module Ogg
class VorbisTag
include VorbisComment
attr_reader :bitrate, :sample_rate, *COMMET_FIELD_MAPPING.values
def initialize(identification_packet, comment_packet)
# Identification packet structure:
#
# 1) "\x01vorbis"
... | ruby | MIT | c451fbe9a49d04e1dd8743e904215f1a7cdb9918 | 2026-01-04T17:50:26.827863Z | false |
aidewoode/wahwah | https://github.com/aidewoode/wahwah/blob/c451fbe9a49d04e1dd8743e904215f1a7cdb9918/lib/wahwah/riff/chunk.rb | lib/wahwah/riff/chunk.rb | # frozen_string_literal: true
module WahWah
module Riff
# RIFF files consist entirely of "chunks".
# All chunks have the following format:
# 4 bytes: an ASCII identifier for this chunk (examples are "fmt " and "data"; note the space in "fmt ").
# 4 bytes: an unsigned, little-endian 32-bit integer w... | ruby | MIT | c451fbe9a49d04e1dd8743e904215f1a7cdb9918 | 2026-01-04T17:50:26.827863Z | false |
aidewoode/wahwah | https://github.com/aidewoode/wahwah/blob/c451fbe9a49d04e1dd8743e904215f1a7cdb9918/lib/wahwah/mp3/mpeg_frame_header.rb | lib/wahwah/mp3/mpeg_frame_header.rb | # frozen_string_literal: true
module WahWah
module Mp3
# mpeg frame header structure:
#
# Position Length Meaning
# 0 11 Frame sync to find the header (all bits are always set)
#
# 11 2 Audio version ID
# 00 - MPEG Version 2.5 (uno... | ruby | MIT | c451fbe9a49d04e1dd8743e904215f1a7cdb9918 | 2026-01-04T17:50:26.827863Z | false |
aidewoode/wahwah | https://github.com/aidewoode/wahwah/blob/c451fbe9a49d04e1dd8743e904215f1a7cdb9918/lib/wahwah/mp3/xing_header.rb | lib/wahwah/mp3/xing_header.rb | # frozen_string_literal: true
module WahWah
module Mp3
# Xing header structure:
#
# Position Length Meaning
# 0 4 VBR header ID in 4 ASCII chars, either 'Xing' or 'Info',
# not NULL-terminated
#
# 4 ... | ruby | MIT | c451fbe9a49d04e1dd8743e904215f1a7cdb9918 | 2026-01-04T17:50:26.827863Z | false |
aidewoode/wahwah | https://github.com/aidewoode/wahwah/blob/c451fbe9a49d04e1dd8743e904215f1a7cdb9918/lib/wahwah/mp3/vbri_header.rb | lib/wahwah/mp3/vbri_header.rb | # frozen_string_literal: true
module WahWah
module Mp3
# VBRI header structure:
#
# Position Length Meaning
# 0 4 VBR header ID in 4 ASCII chars, always 'VBRI', not NULL-terminated
#
# 4 2 Version ID as Big-Endian 16-bit unsigned
#
# 6 ... | ruby | MIT | c451fbe9a49d04e1dd8743e904215f1a7cdb9918 | 2026-01-04T17:50:26.827863Z | false |
aidewoode/wahwah | https://github.com/aidewoode/wahwah/blob/c451fbe9a49d04e1dd8743e904215f1a7cdb9918/lib/wahwah/flac/streaminfo_block.rb | lib/wahwah/flac/streaminfo_block.rb | # frozen_string_literal: true
module WahWah
module Flac
module StreaminfoBlock
STREAMINFO_BLOCK_SIZE = 34
# STREAMINFO block data structure:
#
# Length(bit) Meaning
#
# 16 The minimum block size (in samples) used in the stream.
#
# 16 The maxi... | ruby | MIT | c451fbe9a49d04e1dd8743e904215f1a7cdb9918 | 2026-01-04T17:50:26.827863Z | false |
aidewoode/wahwah | https://github.com/aidewoode/wahwah/blob/c451fbe9a49d04e1dd8743e904215f1a7cdb9918/lib/wahwah/flac/block.rb | lib/wahwah/flac/block.rb | # frozen_string_literal: true
module WahWah
module Flac
class Block
prepend LazyRead
HEADER_SIZE = 4
HEADER_FORMAT = "B*"
BLOCK_TYPE_INDEX = %w[STREAMINFO PADDING APPLICATION SEEKTABLE VORBIS_COMMENT CUESHEET PICTURE]
attr_reader :type
def initialize
# Block header ... | ruby | MIT | c451fbe9a49d04e1dd8743e904215f1a7cdb9918 | 2026-01-04T17:50:26.827863Z | false |
aidewoode/wahwah | https://github.com/aidewoode/wahwah/blob/c451fbe9a49d04e1dd8743e904215f1a7cdb9918/lib/wahwah/mp4/atom.rb | lib/wahwah/mp4/atom.rb | # frozen_string_literal: true
module WahWah
module Mp4
class Atom
prepend LazyRead
VERSIONED_ATOMS = %w[meta stsd]
FLAGGED_ATOMS = %w[stsd]
HEADER_SIZE = 8
HEADER_SIZE_FIELD_SIZE = 4
EXTENDED_HEADER_SIZE = 8
attr_reader :type
def self.find(file_io, *atom_path)
... | ruby | MIT | c451fbe9a49d04e1dd8743e904215f1a7cdb9918 | 2026-01-04T17:50:26.827863Z | false |
aidewoode/wahwah | https://github.com/aidewoode/wahwah/blob/c451fbe9a49d04e1dd8743e904215f1a7cdb9918/lib/wahwah/id3/text_frame_body.rb | lib/wahwah/id3/text_frame_body.rb | # frozen_string_literal: true
module WahWah
module ID3
class TextFrameBody < FrameBody
# Text frame boby structure:
#
# Text encoding $xx
# Information <text string according to encoding>
def parse
encoding_id, text = @content.unpack("Ca*")
@value = Helper.encode... | ruby | MIT | c451fbe9a49d04e1dd8743e904215f1a7cdb9918 | 2026-01-04T17:50:26.827863Z | false |
aidewoode/wahwah | https://github.com/aidewoode/wahwah/blob/c451fbe9a49d04e1dd8743e904215f1a7cdb9918/lib/wahwah/id3/genre_frame_body.rb | lib/wahwah/id3/genre_frame_body.rb | # frozen_string_literal: true
module WahWah
module ID3
class GenreFrameBody < TextFrameBody
def parse
super
# If value is numeric value, or contain numeric value in parens
# can use as index for ID3v1 genre list
@value = ID3::V1::GENRES[$1.to_i] if @value =~ /^\((\d+)\)$/ |... | ruby | MIT | c451fbe9a49d04e1dd8743e904215f1a7cdb9918 | 2026-01-04T17:50:26.827863Z | false |
aidewoode/wahwah | https://github.com/aidewoode/wahwah/blob/c451fbe9a49d04e1dd8743e904215f1a7cdb9918/lib/wahwah/id3/v1.rb | lib/wahwah/id3/v1.rb | # frozen_string_literal: true
module WahWah
module ID3
class V1 < Tag
TAG_SIZE = 128
TAG_ID = "TAG"
DEFAULT_ENCODING = "iso-8859-1"
GENRES = [
# Standard Genres
"Blues", "Classic Rock", "Country", "Dance", "Disco", "Funk", "Grunge",
"Hip-Hop", "Jazz", "Metal", "New... | ruby | MIT | c451fbe9a49d04e1dd8743e904215f1a7cdb9918 | 2026-01-04T17:50:26.827863Z | false |
aidewoode/wahwah | https://github.com/aidewoode/wahwah/blob/c451fbe9a49d04e1dd8743e904215f1a7cdb9918/lib/wahwah/id3/image_frame_body.rb | lib/wahwah/id3/image_frame_body.rb | # frozen_string_literal: true
module WahWah
module ID3
class ImageFrameBody < FrameBody
TYPES = %i[
other
file_icon
other_file_icon
cover_front
cover_back
leaflet
media
lead_artist
artist
conductor
band
composer... | ruby | MIT | c451fbe9a49d04e1dd8743e904215f1a7cdb9918 | 2026-01-04T17:50:26.827863Z | false |
aidewoode/wahwah | https://github.com/aidewoode/wahwah/blob/c451fbe9a49d04e1dd8743e904215f1a7cdb9918/lib/wahwah/id3/frame.rb | lib/wahwah/id3/frame.rb | # frozen_string_literal: true
module WahWah
module ID3
class Frame
prepend LazyRead
ID_MAPPING = {
# ID3v2.2 frame id
COM: :comment,
TRK: :track,
TYE: :year,
TAL: :album,
TP1: :artist,
TT2: :title,
TCO: :genre,
TPA: :disc,
... | ruby | MIT | c451fbe9a49d04e1dd8743e904215f1a7cdb9918 | 2026-01-04T17:50:26.827863Z | false |
aidewoode/wahwah | https://github.com/aidewoode/wahwah/blob/c451fbe9a49d04e1dd8743e904215f1a7cdb9918/lib/wahwah/id3/v2_header.rb | lib/wahwah/id3/v2_header.rb | # frozen_string_literal: true
module WahWah
module ID3
# The ID3v2 tag header, which should be the first information in the file,
# is 10 bytes as follows:
# ID3v2/file identifier "ID3"
# ID3v2 version $03 00
# ID3v2 flags %abc00000
# ID3v2 size 4 * %0xxx... | ruby | MIT | c451fbe9a49d04e1dd8743e904215f1a7cdb9918 | 2026-01-04T17:50:26.827863Z | false |
aidewoode/wahwah | https://github.com/aidewoode/wahwah/blob/c451fbe9a49d04e1dd8743e904215f1a7cdb9918/lib/wahwah/id3/frame_body.rb | lib/wahwah/id3/frame_body.rb | # frozen_string_literal: true
module WahWah
module ID3
class FrameBody
# Textual frames are marked with an encoding byte.
#
# $00 ISO-8859-1 [ISO-8859-1]. Terminated with $00.
# $01 UTF-16 [UTF-16] encoded Unicode [UNICODE] with BOM.
# $02 UTF-16BE [UTF-16] encoded Unicode [UN... | ruby | MIT | c451fbe9a49d04e1dd8743e904215f1a7cdb9918 | 2026-01-04T17:50:26.827863Z | false |
aidewoode/wahwah | https://github.com/aidewoode/wahwah/blob/c451fbe9a49d04e1dd8743e904215f1a7cdb9918/lib/wahwah/id3/v2.rb | lib/wahwah/id3/v2.rb | # frozen_string_literal: true
module WahWah
module ID3
class V2 < Tag
extend Forwardable
def_delegators :@header, :major_version, :size, :has_extended_header?, :valid?
def version
"v2.#{major_version}"
end
private
def parse
@file_io.rewind
@header =... | ruby | MIT | c451fbe9a49d04e1dd8743e904215f1a7cdb9918 | 2026-01-04T17:50:26.827863Z | false |
aidewoode/wahwah | https://github.com/aidewoode/wahwah/blob/c451fbe9a49d04e1dd8743e904215f1a7cdb9918/lib/wahwah/id3/comment_frame_body.rb | lib/wahwah/id3/comment_frame_body.rb | # frozen_string_literal: true
module WahWah
module ID3
class CommentFrameBody < FrameBody
# Comment frame body structure:
#
# Text encoding $xx
# Language $xx xx xx
# Short content description <textstring> $00 (00)
# The actual text <text... | ruby | MIT | c451fbe9a49d04e1dd8743e904215f1a7cdb9918 | 2026-01-04T17:50:26.827863Z | false |
aidewoode/wahwah | https://github.com/aidewoode/wahwah/blob/c451fbe9a49d04e1dd8743e904215f1a7cdb9918/lib/wahwah/id3/lyrics_frame_body.rb | lib/wahwah/id3/lyrics_frame_body.rb | # frozen_string_literal: true
module WahWah
module ID3
class LyricsFrameBody < CommentFrameBody
end
end
end
| ruby | MIT | c451fbe9a49d04e1dd8743e904215f1a7cdb9918 | 2026-01-04T17:50:26.827863Z | false |
aidewoode/wahwah | https://github.com/aidewoode/wahwah/blob/c451fbe9a49d04e1dd8743e904215f1a7cdb9918/lib/wahwah/asf/object.rb | lib/wahwah/asf/object.rb | # frozen_string_literal: true
module WahWah
module Asf
# The base unit of organization for ASF files is called the ASF object.
# It consists of a 128-bit GUID for the object, a 64-bit integer object size, and the variable-length object data.
# The value of the object size field is the sum of 24 bytes plu... | ruby | MIT | c451fbe9a49d04e1dd8743e904215f1a7cdb9918 | 2026-01-04T17:50:26.827863Z | false |
zmoazeni/harvested | https://github.com/zmoazeni/harvested/blob/33d26049651fde6adf651d5c8aff8fff97156210/spec/factories.rb | spec/factories.rb | FactoryGirl.define do
sequence :name do |n|
"Joe's Steam Cleaning #{n}"
end
sequence :description do |n|
"Item #{n}"
end
sequence :project_name do |n|
"Joe's Steam Cleaning Project #{n}"
end
factory :client, class: Harvest::Client do
name
details "Steam Cleaning across the country"
... | ruby | MIT | 33d26049651fde6adf651d5c8aff8fff97156210 | 2026-01-04T17:50:27.559404Z | false |
zmoazeni/harvested | https://github.com/zmoazeni/harvested/blob/33d26049651fde6adf651d5c8aff8fff97156210/spec/spec_helper.rb | spec/spec_helper.rb | require 'harvested'
require 'webmock/rspec'
require 'vcr'
require 'factory_girl'
require 'byebug'
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require File.expand_path(f) }
VCR.configure do |c|
c.cassette_library_dir = '.cassettes'
c.hook_into :webmock
c.default_cassette_options = {
# force c... | ruby | MIT | 33d26049651fde6adf651d5c8aff8fff97156210 | 2026-01-04T17:50:27.559404Z | false |
zmoazeni/harvested | https://github.com/zmoazeni/harvested/blob/33d26049651fde6adf651d5c8aff8fff97156210/spec/support/harvested_helpers.rb | spec/support/harvested_helpers.rb | module HarvestedHelpers
def self.credentials
raise "You need a credentials file in support/harvest_credentials.yml!!" unless File.exist?("#{File.dirname(__FILE__)}/harvest_credentials.yml")
@credentials ||= YAML.load_file("#{File.dirname(__FILE__)}/harvest_credentials.yml")
end
def credentials; HarvestedH... | ruby | MIT | 33d26049651fde6adf651d5c8aff8fff97156210 | 2026-01-04T17:50:27.559404Z | false |
zmoazeni/harvested | https://github.com/zmoazeni/harvested/blob/33d26049651fde6adf651d5c8aff8fff97156210/spec/support/json_examples.rb | spec/support/json_examples.rb | shared_examples_for 'a json sanitizer' do |keys|
keys.each do |key|
it "doesn't include '#{key}' when serializing to json" do
instance = described_class.new
instance[key] = 10
instance.as_json[instance.class.json_root].keys.should_not include(key)
end
end
end
# it_behaves_like 'a json san... | ruby | MIT | 33d26049651fde6adf651d5c8aff8fff97156210 | 2026-01-04T17:50:27.559404Z | false |
zmoazeni/harvested | https://github.com/zmoazeni/harvested/blob/33d26049651fde6adf651d5c8aff8fff97156210/spec/harvest/user_assignment_spec.rb | spec/harvest/user_assignment_spec.rb | require 'spec_helper'
describe Harvest::UserAssignment do
describe "#user_as_json" do
it "should generate the xml for existing users" do
assignment = Harvest::UserAssignment.new(:user => double(:user, :to_i => 3))
assignment.user_as_json.should == {"user" => {"id" => 3}}
end
end
end
| ruby | MIT | 33d26049651fde6adf651d5c8aff8fff97156210 | 2026-01-04T17:50:27.559404Z | false |
zmoazeni/harvested | https://github.com/zmoazeni/harvested/blob/33d26049651fde6adf651d5c8aff8fff97156210/spec/harvest/oauth_credentials_spec.rb | spec/harvest/oauth_credentials_spec.rb | require 'spec_helper'
describe Harvest::OAuthCredentials do
context '#set_authentication' do
it "should set the access token in the query" do
credentials = Harvest::OAuthCredentials.new('theaccesstoken')
credentials.set_authentication(options = {})
options[:query]['access_token'].should == 'the... | ruby | MIT | 33d26049651fde6adf651d5c8aff8fff97156210 | 2026-01-04T17:50:27.559404Z | false |
zmoazeni/harvested | https://github.com/zmoazeni/harvested/blob/33d26049651fde6adf651d5c8aff8fff97156210/spec/harvest/trackable_project_spec.rb | spec/harvest/trackable_project_spec.rb | require 'spec_helper'
describe Harvest::TrackableProject do
it "creates task objects" do
projects = Harvest::TrackableProject.parse('[{"tasks":[{"id":123}]}]').first
projects.tasks.first.id.should == 123
end
end
| ruby | MIT | 33d26049651fde6adf651d5c8aff8fff97156210 | 2026-01-04T17:50:27.559404Z | false |
zmoazeni/harvested | https://github.com/zmoazeni/harvested/blob/33d26049651fde6adf651d5c8aff8fff97156210/spec/harvest/invoice_message_spec.rb | spec/harvest/invoice_message_spec.rb | require 'spec_helper'
describe Harvest::InvoiceMessage do
it_behaves_like 'a json sanitizer', %w(cache_version)
end
| ruby | MIT | 33d26049651fde6adf651d5c8aff8fff97156210 | 2026-01-04T17:50:27.559404Z | false |
zmoazeni/harvested | https://github.com/zmoazeni/harvested/blob/33d26049651fde6adf651d5c8aff8fff97156210/spec/harvest/project_spec.rb | spec/harvest/project_spec.rb | require 'spec_helper'
describe Harvest::Project do
it_behaves_like 'a json sanitizer', %w(hint_latest_record_at hint_earliest_record_at cache_version)
end
| ruby | MIT | 33d26049651fde6adf651d5c8aff8fff97156210 | 2026-01-04T17:50:27.559404Z | false |
zmoazeni/harvested | https://github.com/zmoazeni/harvested/blob/33d26049651fde6adf651d5c8aff8fff97156210/spec/harvest/task_assignment_spec.rb | spec/harvest/task_assignment_spec.rb | require 'spec_helper'
describe Harvest::TaskAssignment do
context "task_as_json" do
it "generates the json for existing tasks" do
assignment = Harvest::TaskAssignment.new(:task => double(:task, :to_i => 3))
assignment.task_as_json.should == {"task" => {"id" => 3}}
end
end
end
| ruby | MIT | 33d26049651fde6adf651d5c8aff8fff97156210 | 2026-01-04T17:50:27.559404Z | false |
zmoazeni/harvested | https://github.com/zmoazeni/harvested/blob/33d26049651fde6adf651d5c8aff8fff97156210/spec/harvest/expense_category_spec.rb | spec/harvest/expense_category_spec.rb | require 'spec_helper'
describe Harvest::ExpenseCategory do
it_behaves_like 'a json sanitizer', %w(cache_version)
end | ruby | MIT | 33d26049651fde6adf651d5c8aff8fff97156210 | 2026-01-04T17:50:27.559404Z | false |
zmoazeni/harvested | https://github.com/zmoazeni/harvested/blob/33d26049651fde6adf651d5c8aff8fff97156210/spec/harvest/time_entry_spec.rb | spec/harvest/time_entry_spec.rb | require 'spec_helper'
describe Harvest::TimeEntry do
context '#as_json' do
it 'builds a specialized hash' do
entry = Harvest::TimeEntry.new(:notes => 'the notes', :project_id => 'the project id', :task_id => 'the task id', :hours => 'the hours', :spent_at => Time.utc(2009, 12, 28))
entry.as_json.shou... | ruby | MIT | 33d26049651fde6adf651d5c8aff8fff97156210 | 2026-01-04T17:50:27.559404Z | false |
zmoazeni/harvested | https://github.com/zmoazeni/harvested/blob/33d26049651fde6adf651d5c8aff8fff97156210/spec/harvest/invoice_payment_spec.rb | spec/harvest/invoice_payment_spec.rb | require 'spec_helper'
describe Harvest::InvoicePayment do
it_behaves_like 'a json sanitizer', %w(cache_version)
end
| ruby | MIT | 33d26049651fde6adf651d5c8aff8fff97156210 | 2026-01-04T17:50:27.559404Z | false |
zmoazeni/harvested | https://github.com/zmoazeni/harvested/blob/33d26049651fde6adf651d5c8aff8fff97156210/spec/harvest/task_spec.rb | spec/harvest/task_spec.rb | require 'spec_helper'
describe Harvest::Task do
it_behaves_like 'a json sanitizer', %w(cache_version)
end
| ruby | MIT | 33d26049651fde6adf651d5c8aff8fff97156210 | 2026-01-04T17:50:27.559404Z | false |
zmoazeni/harvested | https://github.com/zmoazeni/harvested/blob/33d26049651fde6adf651d5c8aff8fff97156210/spec/harvest/base_spec.rb | spec/harvest/base_spec.rb | require 'spec_helper'
describe Harvest::Base do
describe "username/password errors" do
it "should raise error if missing a credential" do
lambda { Harvest::Base.new(subdomain: "subdomain", password: "secure") }.should raise_error(/must provide either/i)
end
end
end
| ruby | MIT | 33d26049651fde6adf651d5c8aff8fff97156210 | 2026-01-04T17:50:27.559404Z | false |
zmoazeni/harvested | https://github.com/zmoazeni/harvested/blob/33d26049651fde6adf651d5c8aff8fff97156210/spec/harvest/basic_auth_credentials_spec.rb | spec/harvest/basic_auth_credentials_spec.rb | require 'spec_helper'
describe Harvest::BasicAuthCredentials do
context '#set_authentication' do
it "should set the headers Authorization" do
credentials = Harvest::BasicAuthCredentials.new(subdomain: 'some-domain', username: 'username', password: 'password')
credentials.set_authentication(options = ... | ruby | MIT | 33d26049651fde6adf651d5c8aff8fff97156210 | 2026-01-04T17:50:27.559404Z | false |
zmoazeni/harvested | https://github.com/zmoazeni/harvested/blob/33d26049651fde6adf651d5c8aff8fff97156210/spec/harvest/expense_spec.rb | spec/harvest/expense_spec.rb | require 'spec_helper'
describe Harvest::Expense do
it_behaves_like 'a json sanitizer', %w(has_receipt receipt_url)
describe "#spent_at" do
it "should parse strings" do
date = RUBY_VERSION =~ /1.8/ ? "12/01/2009" : "01/12/2009"
expense = Harvest::Expense.new(:spent_at => date)
expense.spent... | ruby | MIT | 33d26049651fde6adf651d5c8aff8fff97156210 | 2026-01-04T17:50:27.559404Z | false |
zmoazeni/harvested | https://github.com/zmoazeni/harvested/blob/33d26049651fde6adf651d5c8aff8fff97156210/spec/harvest/invoice_spec.rb | spec/harvest/invoice_spec.rb | require 'spec_helper'
describe Harvest::Invoice do
context 'line_items' do
it 'parses csv into objects' do
invoice = Harvest::Invoice.new(:line_items => "kind,description,quantity,unit_price,amount,taxed,taxed2,project_id\nService,Abc,200,12.00,2400.0,false,false,100\nService,def,1.00,20.00,20.0,false,fals... | ruby | MIT | 33d26049651fde6adf651d5c8aff8fff97156210 | 2026-01-04T17:50:27.559404Z | false |
zmoazeni/harvested | https://github.com/zmoazeni/harvested/blob/33d26049651fde6adf651d5c8aff8fff97156210/spec/harvest/user_spec.rb | spec/harvest/user_spec.rb | require 'spec_helper'
describe Harvest::User do
it_behaves_like 'a json sanitizer', %w(cache_version)
describe "#timezone" do
it "should convert friendly timezone setting" do
p = Harvest::User.new(:timezone => :cst)
p.timezone.should == 'Central Time (US & Canada)'
p = Harvest::User... | ruby | MIT | 33d26049651fde6adf651d5c8aff8fff97156210 | 2026-01-04T17:50:27.559404Z | false |
zmoazeni/harvested | https://github.com/zmoazeni/harvested/blob/33d26049651fde6adf651d5c8aff8fff97156210/spec/functional/expenses_spec.rb | spec/functional/expenses_spec.rb | require 'spec_helper'
describe 'harvest expenses' do
context 'categories' do
it 'allows adding, updating and removing categories' do
cassette("expense_category1") do
category = harvest.expense_categories.create(
"name" => "Mileage",
"unit_price" => 100,
"un... | ruby | MIT | 33d26049651fde6adf651d5c8aff8fff97156210 | 2026-01-04T17:50:27.559404Z | false |
zmoazeni/harvested | https://github.com/zmoazeni/harvested/blob/33d26049651fde6adf651d5c8aff8fff97156210/spec/functional/clients_spec.rb | spec/functional/clients_spec.rb | require 'spec_helper'
describe 'harvest clients' do
it 'allows adding, updating and removing clients' do
client_attributes = FactoryGirl.attributes_for(:client)
cassette("client") do
client = harvest.clients.create(client_attributes)
client.name.should == client_attributes[:name]
client.n... | ruby | MIT | 33d26049651fde6adf651d5c8aff8fff97156210 | 2026-01-04T17:50:27.559404Z | false |
zmoazeni/harvested | https://github.com/zmoazeni/harvested/blob/33d26049651fde6adf651d5c8aff8fff97156210/spec/functional/project_spec.rb | spec/functional/project_spec.rb | require 'spec_helper'
describe 'harvest projects' do
it 'allows adding, updating and removing projects' do
cassette('project1') do
client = harvest.clients.create(FactoryGirl.attributes_for(:client))
project = harvest.projects.create(
"name" => "Test Project",
"active" ... | ruby | MIT | 33d26049651fde6adf651d5c8aff8fff97156210 | 2026-01-04T17:50:27.559404Z | false |
zmoazeni/harvested | https://github.com/zmoazeni/harvested/blob/33d26049651fde6adf651d5c8aff8fff97156210/spec/functional/invoice_messages_spec.rb | spec/functional/invoice_messages_spec.rb | require 'spec_helper'
describe 'harvest invoice messages' do
it 'allows adding/removing messages to invoice and retrieving existing invoice messages' do
# Make sure Reminder Message is turned off for this test to pass
cassette('invoice_message1') do
# create a new client and invoice
client = har... | ruby | MIT | 33d26049651fde6adf651d5c8aff8fff97156210 | 2026-01-04T17:50:27.559404Z | false |
zmoazeni/harvested | https://github.com/zmoazeni/harvested/blob/33d26049651fde6adf651d5c8aff8fff97156210/spec/functional/reporting_spec.rb | spec/functional/reporting_spec.rb | require 'spec_helper'
describe 'harvest reporting' do
it 'allows project and people entry reporting' do
cassette("reports1") do
user = harvest.users.create(
email: "jane@example.com",
first_name: "Jane",
last_name: "Doe",
password: "secure"
)
client = h... | ruby | MIT | 33d26049651fde6adf651d5c8aff8fff97156210 | 2026-01-04T17:50:27.559404Z | false |
zmoazeni/harvested | https://github.com/zmoazeni/harvested/blob/33d26049651fde6adf651d5c8aff8fff97156210/spec/functional/tasks_spec.rb | spec/functional/tasks_spec.rb | require 'spec_helper'
describe 'harvest tasks' do
it 'allows adding, updating and removing tasks' do
cassette('tasks') do
task = harvest.tasks.create(
"name" => "A crud task",
"billable_by_default" => true,
"default_hourly_rate" => 120
)
task.defa... | ruby | MIT | 33d26049651fde6adf651d5c8aff8fff97156210 | 2026-01-04T17:50:27.559404Z | false |
zmoazeni/harvested | https://github.com/zmoazeni/harvested/blob/33d26049651fde6adf651d5c8aff8fff97156210/spec/functional/users_spec.rb | spec/functional/users_spec.rb | require 'spec_helper'
describe 'harvest users' do
it "allows adding, updating, and removing users" do
cassette("users") do
user = harvest.users.create(
"first_name" => "Edgar",
"last_name" => "Ruth",
"email" => "edgar@ruth.com",
"timezo... | ruby | MIT | 33d26049651fde6adf651d5c8aff8fff97156210 | 2026-01-04T17:50:27.559404Z | false |
zmoazeni/harvested | https://github.com/zmoazeni/harvested/blob/33d26049651fde6adf651d5c8aff8fff97156210/spec/functional/hardy_client_spec.rb | spec/functional/hardy_client_spec.rb | require 'spec_helper'
describe 'harvest hardy client' do
before do
WebMock.disable_net_connect!
@time = Time.now
end
it "waits the alloted time out when over rate limit" do
stub_request(:get, /\/clients/).to_return({:status => ['503', 'Rate Limited'], :headers => {"Retry-After" => "5"}}, {:body =... | ruby | MIT | 33d26049651fde6adf651d5c8aff8fff97156210 | 2026-01-04T17:50:27.559404Z | false |
zmoazeni/harvested | https://github.com/zmoazeni/harvested/blob/33d26049651fde6adf651d5c8aff8fff97156210/spec/functional/invoice_payments_spec.rb | spec/functional/invoice_payments_spec.rb | require 'spec_helper'
describe 'harvest invoice payments' do
it 'allows retrieving existing invoice payments' do
cassette('invoice_payment1') do
client = harvest.clients.create(FactoryGirl.attributes_for(:client))
invoice = harvest.invoices.create(FactoryGirl.attributes_for(:invoice, :client_id => c... | ruby | MIT | 33d26049651fde6adf651d5c8aff8fff97156210 | 2026-01-04T17:50:27.559404Z | false |
zmoazeni/harvested | https://github.com/zmoazeni/harvested/blob/33d26049651fde6adf651d5c8aff8fff97156210/spec/functional/time_tracking_spec.rb | spec/functional/time_tracking_spec.rb | require 'spec_helper'
describe 'harvest time tracking' do
it 'allows adding, updating and removing entries' do
cassette("time_tracking1") do
client = harvest.clients.create("name" => "Jane's Car Shop")
project = harvest.projects.create("name" => "Tracking Project", "client_id" => client.id)
har... | ruby | MIT | 33d26049651fde6adf651d5c8aff8fff97156210 | 2026-01-04T17:50:27.559404Z | false |
zmoazeni/harvested | https://github.com/zmoazeni/harvested/blob/33d26049651fde6adf651d5c8aff8fff97156210/spec/functional/account_spec.rb | spec/functional/account_spec.rb | require 'spec_helper'
describe 'account information' do
it 'returns the rate limit when requested' do
cassette('account1') do
status = harvest.account.rate_limit_status
status.max_calls.should == 100
end
end
it 'returns the result of whoami' do
cassette('account2') do
user = harves... | ruby | MIT | 33d26049651fde6adf651d5c8aff8fff97156210 | 2026-01-04T17:50:27.559404Z | false |
zmoazeni/harvested | https://github.com/zmoazeni/harvested/blob/33d26049651fde6adf651d5c8aff8fff97156210/spec/functional/invoice_spec.rb | spec/functional/invoice_spec.rb | require 'spec_helper'
describe 'harvest invoices' do
it 'allows adding, updating and removing categories' do
cassette('invoice1') do
cat = harvest.invoice_categories.create("name" => "New Category")
cat.name.should == "New Category"
cat.name = "Updated Category"
cat = harvest.invoice_cat... | ruby | MIT | 33d26049651fde6adf651d5c8aff8fff97156210 | 2026-01-04T17:50:27.559404Z | false |
zmoazeni/harvested | https://github.com/zmoazeni/harvested/blob/33d26049651fde6adf651d5c8aff8fff97156210/spec/functional/errors_spec.rb | spec/functional/errors_spec.rb | require 'spec_helper'
describe 'harvest errors' do
before { WebMock.disable_net_connect! }
it "wraps errors" do
stub_request(:get, /\/clients/).to_return({:status => ['400', 'Bad Request']}, {:body => "[]", :status => 200})
expect { harvest.clients.all }.to raise_error(Harvest::BadRequest)
stub... | ruby | MIT | 33d26049651fde6adf651d5c8aff8fff97156210 | 2026-01-04T17:50:27.559404Z | false |
zmoazeni/harvested | https://github.com/zmoazeni/harvested/blob/33d26049651fde6adf651d5c8aff8fff97156210/examples/project_create_script.rb | examples/project_create_script.rb | # File: project_create_script.rb
# Date Created: 2012-10-08
# Author(s): Mark Rickert (mjar81@gmail.com) / Skookum Digital Works - http://skookum.com
#
# Description: This example script takes user input from the command line and
# creates a project based the selected options. It then assigns tasks from Harvest
# to th... | ruby | MIT | 33d26049651fde6adf651d5c8aff8fff97156210 | 2026-01-04T17:50:27.559404Z | false |
zmoazeni/harvested | https://github.com/zmoazeni/harvested/blob/33d26049651fde6adf651d5c8aff8fff97156210/examples/clear_account.rb | examples/clear_account.rb | # This is commented out because it can be very dangerous if run against a production account
# require "harvested"
#
# subdomain = 'yoursubdomain'
# username = 'yourusername'
# password = 'yourpassword'
#
# api = Harvest.hardy_client(subdomain: subdomain, username: username, password: password)
#
# raise "Are you sure... | ruby | MIT | 33d26049651fde6adf651d5c8aff8fff97156210 | 2026-01-04T17:50:27.559404Z | false |
zmoazeni/harvested | https://github.com/zmoazeni/harvested/blob/33d26049651fde6adf651d5c8aff8fff97156210/examples/basics.rb | examples/basics.rb | require "harvested"
subdomain = 'yoursubdomain'
username = 'yourusername'
password = 'yourpassword'
harvest = Harvest.hardy_client(subdomain: subdomain, username: username, password: password)
# Print out all users, clients, and projects on the account
puts "Users:"
harvest.users.all.each {|u| p u }
puts "Clients:"... | ruby | MIT | 33d26049651fde6adf651d5c8aff8fff97156210 | 2026-01-04T17:50:27.559404Z | false |
zmoazeni/harvested | https://github.com/zmoazeni/harvested/blob/33d26049651fde6adf651d5c8aff8fff97156210/examples/user_assignments.rb | examples/user_assignments.rb | require "harvested"
subdomain = 'yoursubdomain'
username = 'userusername'
password = 'yourpassword'
harvest = Harvest.hardy_client(subdomain: subdomain, username: username, password: password)
# Create a Client, Project, and a User then assign that User to that Project
client = Harvest::Client.new(name: 'SuprCorp')... | ruby | MIT | 33d26049651fde6adf651d5c8aff8fff97156210 | 2026-01-04T17:50:27.559404Z | false |
zmoazeni/harvested | https://github.com/zmoazeni/harvested/blob/33d26049651fde6adf651d5c8aff8fff97156210/examples/task_assignments.rb | examples/task_assignments.rb | require "harvested"
subdomain = 'yoursubdomain'
username = 'yourusername'
password = 'yourpassword'
harvest = Harvest.hardy_client(subdomain: subdomain, username: username, password: password)
# Create a Client add a Project to that Client
client = Harvest::Client.new(name: 'SuprCorp')
client = harvest.clients.crea... | ruby | MIT | 33d26049651fde6adf651d5c8aff8fff97156210 | 2026-01-04T17:50:27.559404Z | false |
zmoazeni/harvested | https://github.com/zmoazeni/harvested/blob/33d26049651fde6adf651d5c8aff8fff97156210/lib/harvested.rb | lib/harvested.rb | require 'httparty'
require 'base64'
require 'delegate'
require 'hashie'
require 'json'
require 'time'
require 'csv'
require 'ext/array'
require 'ext/hash'
require 'ext/date'
require 'ext/time'
require 'harvest/version'
require 'harvest/credentials'
require 'harvest/errors'
require 'harvest/hardy_client'
require 'harv... | ruby | MIT | 33d26049651fde6adf651d5c8aff8fff97156210 | 2026-01-04T17:50:27.559404Z | false |
zmoazeni/harvested | https://github.com/zmoazeni/harvested/blob/33d26049651fde6adf651d5c8aff8fff97156210/lib/harvest/expense_category.rb | lib/harvest/expense_category.rb | module Harvest
class ExpenseCategory < Hashie::Mash
include Harvest::Model
api_path '/expense_categories'
def active?
!deactivated
end
end
end
| ruby | MIT | 33d26049651fde6adf651d5c8aff8fff97156210 | 2026-01-04T17:50:27.559404Z | false |
zmoazeni/harvested | https://github.com/zmoazeni/harvested/blob/33d26049651fde6adf651d5c8aff8fff97156210/lib/harvest/task.rb | lib/harvest/task.rb | module Harvest
# The model that contains information about a task
#
# == Fields
# [+id+] (READONLY) the id of the task
# [+name+] (REQUIRED) the name of the task
# [+billable+] whether the task is billable by default
# [+deactivated+] whether the task is deactivated
# [+hourly_rate+] what the default h... | ruby | MIT | 33d26049651fde6adf651d5c8aff8fff97156210 | 2026-01-04T17:50:27.559404Z | false |
zmoazeni/harvested | https://github.com/zmoazeni/harvested/blob/33d26049651fde6adf651d5c8aff8fff97156210/lib/harvest/task_assignment.rb | lib/harvest/task_assignment.rb | module Harvest
class TaskAssignment < Hashie::Mash
include Harvest::Model
def initialize(args = {}, _ = nil)
args = args.to_hash.stringify_keys
self.task = args.delete("task") if args["task"]
self.project = args.delete("project") if args["project"]
super
end
def task=(task... | ruby | MIT | 33d26049651fde6adf651d5c8aff8fff97156210 | 2026-01-04T17:50:27.559404Z | false |
zmoazeni/harvested | https://github.com/zmoazeni/harvested/blob/33d26049651fde6adf651d5c8aff8fff97156210/lib/harvest/version.rb | lib/harvest/version.rb | module Harvest
VERSION = "4.0.0"
end
| ruby | MIT | 33d26049651fde6adf651d5c8aff8fff97156210 | 2026-01-04T17:50:27.559404Z | false |
zmoazeni/harvested | https://github.com/zmoazeni/harvested/blob/33d26049651fde6adf651d5c8aff8fff97156210/lib/harvest/project.rb | lib/harvest/project.rb | module Harvest
# The model that contains information about a project
#
# == Fields
# [+id+] (READONLY) the id of the project
# [+name+] (REQUIRED) the name of the project
# [+client_id+] (REQUIRED) the client id of the project
# [+code+] the project code
# [+notes+] the project notes
# [+active?+] tr... | ruby | MIT | 33d26049651fde6adf651d5c8aff8fff97156210 | 2026-01-04T17:50:27.559404Z | false |
zmoazeni/harvested | https://github.com/zmoazeni/harvested/blob/33d26049651fde6adf651d5c8aff8fff97156210/lib/harvest/errors.rb | lib/harvest/errors.rb | module Harvest
class HTTPError < StandardError
attr_reader :response
attr_reader :params
attr_reader :hint
def initialize(response, params = {}, hint = nil)
@response = response
@params = params
@hint = hint
super(response)
end
def to_s
"#{self.class.to_s} : #{r... | ruby | MIT | 33d26049651fde6adf651d5c8aff8fff97156210 | 2026-01-04T17:50:27.559404Z | false |
zmoazeni/harvested | https://github.com/zmoazeni/harvested/blob/33d26049651fde6adf651d5c8aff8fff97156210/lib/harvest/user_assignment.rb | lib/harvest/user_assignment.rb | module Harvest
class UserAssignment < Hashie::Mash
include Harvest::Model
delegate_methods :project_manager? => :is_project_manager
def initialize(args = {}, _ = nil)
args = args.to_hash.stringify_keys
self.user = args.delete("user") if args["user"]
self.project = args.delete("proje... | ruby | MIT | 33d26049651fde6adf651d5c8aff8fff97156210 | 2026-01-04T17:50:27.559404Z | false |
zmoazeni/harvested | https://github.com/zmoazeni/harvested/blob/33d26049651fde6adf651d5c8aff8fff97156210/lib/harvest/timezones.rb | lib/harvest/timezones.rb | module Harvest
# shamelessly ripped from Rails: http://github.com/rails/rails/blob/master/activesupport/lib/active_support/values/time_zone.rb
module Timezones
MAPPING = {
"pacific/midway" => "Midway Island",
"pacific/pago_pago" => "Samoa",
"pacific/hon... | ruby | MIT | 33d26049651fde6adf651d5c8aff8fff97156210 | 2026-01-04T17:50:27.559404Z | false |
zmoazeni/harvested | https://github.com/zmoazeni/harvested/blob/33d26049651fde6adf651d5c8aff8fff97156210/lib/harvest/line_item.rb | lib/harvest/line_item.rb | module Harvest
class LineItem < Hashie::Mash
end
end
| ruby | MIT | 33d26049651fde6adf651d5c8aff8fff97156210 | 2026-01-04T17:50:27.559404Z | false |
zmoazeni/harvested | https://github.com/zmoazeni/harvested/blob/33d26049651fde6adf651d5c8aff8fff97156210/lib/harvest/trackable_project.rb | lib/harvest/trackable_project.rb | module Harvest
# The model for project-tasks combinations that can be added to the timesheet
#
# == Fields
# [+id+] the id of the project
# [+name+] the name of the project
# [+client+] the name of the client of the project
# [+client_id+] the client id of the project
# [+tasks+] trackable tasks for th... | ruby | MIT | 33d26049651fde6adf651d5c8aff8fff97156210 | 2026-01-04T17:50:27.559404Z | false |
zmoazeni/harvested | https://github.com/zmoazeni/harvested/blob/33d26049651fde6adf651d5c8aff8fff97156210/lib/harvest/base.rb | lib/harvest/base.rb | module Harvest
class Base
attr_reader :request, :credentials
# @see Harvest.client
# @see Harvest.hardy_client
def initialize(subdomain: nil, username: nil, password: nil, access_token: nil)
@credentials = if subdomain && username && password
BasicAuthCredentials.new(subdomain: subdomai... | ruby | MIT | 33d26049651fde6adf651d5c8aff8fff97156210 | 2026-01-04T17:50:27.559404Z | false |
zmoazeni/harvested | https://github.com/zmoazeni/harvested/blob/33d26049651fde6adf651d5c8aff8fff97156210/lib/harvest/invoice_category.rb | lib/harvest/invoice_category.rb | module Harvest
class InvoiceCategory < Hashie::Mash
include Harvest::Model
api_path '/invoice_item_categories'
def self.json_root; "invoice_item_category"; end
class << self
def parse(json)
parsed = String === json ? JSON.parse(json) : json
Array.wrap(parsed).map {|attrs| new(a... | ruby | MIT | 33d26049651fde6adf651d5c8aff8fff97156210 | 2026-01-04T17:50:27.559404Z | false |
zmoazeni/harvested | https://github.com/zmoazeni/harvested/blob/33d26049651fde6adf651d5c8aff8fff97156210/lib/harvest/rate_limit_status.rb | lib/harvest/rate_limit_status.rb | module Harvest
# The model that contains the information about the user's rate limit
#
# == Fields
# [+last_access_at+] The last registered request
# [+count+] The current number of requests registered
# [+timeframe_limit+] The amount of seconds before a rate limit refresh occurs
# [+max_calls+] The num... | ruby | MIT | 33d26049651fde6adf651d5c8aff8fff97156210 | 2026-01-04T17:50:27.559404Z | false |
zmoazeni/harvested | https://github.com/zmoazeni/harvested/blob/33d26049651fde6adf651d5c8aff8fff97156210/lib/harvest/credentials.rb | lib/harvest/credentials.rb | module Harvest
class BasicAuthCredentials
def initialize(subdomain: nil, username: nil, password: nil)
@subdomain, @username, @password = subdomain, username, password
end
def set_authentication(request_options)
request_options[:headers] ||= {}
request_options[:headers]["Authorization"]... | ruby | MIT | 33d26049651fde6adf651d5c8aff8fff97156210 | 2026-01-04T17:50:27.559404Z | false |
zmoazeni/harvested | https://github.com/zmoazeni/harvested/blob/33d26049651fde6adf651d5c8aff8fff97156210/lib/harvest/expense.rb | lib/harvest/expense.rb | module Harvest
class Expense < Hashie::Mash
include Harvest::Model
api_path '/expenses'
delegate_methods(:billed? => :is_billed,
:closed? => :is_closed)
def initialize(args = {}, _ = nil)
args = args.to_hash.stringify_keys
self.spent_at = args.delete("spent_... | ruby | MIT | 33d26049651fde6adf651d5c8aff8fff97156210 | 2026-01-04T17:50:27.559404Z | false |
zmoazeni/harvested | https://github.com/zmoazeni/harvested/blob/33d26049651fde6adf651d5c8aff8fff97156210/lib/harvest/invoice.rb | lib/harvest/invoice.rb | module Harvest
# == Fields
# [+due_at+] when the invoice is due
# [+due_at_human_format+] when the invoice is due in human representation (e.g., due upon receipt) overrides +due_at+
# [+client_id+] (REQUIRED) the client id of the invoice
# [+currency+] the invoice currency
# [+issued_at+] when the invoice ... | ruby | MIT | 33d26049651fde6adf651d5c8aff8fff97156210 | 2026-01-04T17:50:27.559404Z | false |
zmoazeni/harvested | https://github.com/zmoazeni/harvested/blob/33d26049651fde6adf651d5c8aff8fff97156210/lib/harvest/invoice_message.rb | lib/harvest/invoice_message.rb | module Harvest
class InvoiceMessage < Hashie::Mash
include Harvest::Model
api_path '/messages'
def self.json_root; 'message'; end
end
end
| ruby | MIT | 33d26049651fde6adf651d5c8aff8fff97156210 | 2026-01-04T17:50:27.559404Z | false |
zmoazeni/harvested | https://github.com/zmoazeni/harvested/blob/33d26049651fde6adf651d5c8aff8fff97156210/lib/harvest/client.rb | lib/harvest/client.rb | module Harvest
# The model that contains information about a client
#
# == Fields
# [+id+] (READONLY) the id of the client
# [+name+] (REQUIRED) the name of the client
# [+details+] the details of the client
# [+currency+] what type of currency is associated with the client
# [+currency_symbol+] what cu... | ruby | MIT | 33d26049651fde6adf651d5c8aff8fff97156210 | 2026-01-04T17:50:27.559404Z | false |
zmoazeni/harvested | https://github.com/zmoazeni/harvested/blob/33d26049651fde6adf651d5c8aff8fff97156210/lib/harvest/time_entry.rb | lib/harvest/time_entry.rb | module Harvest
class TimeEntry < Hashie::Mash
include Harvest::Model
skip_json_root true
delegate_methods(:closed? => :is_closed,
:billed? => :is_billed)
def initialize(args = {}, _ = nil)
args = args.to_hash.stringify_keys
self.spent_at = args.delete("spent_at") if ... | ruby | MIT | 33d26049651fde6adf651d5c8aff8fff97156210 | 2026-01-04T17:50:27.559404Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.