lyriki 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 +7 -0
- data/.gitignore +1 -0
- data/.hound.yml +3 -0
- data/.travis.yml +7 -0
- data/Gemfile +16 -0
- data/Gemfile.lock +93 -0
- data/Guardfile +7 -0
- data/LICENSE.txt +22 -0
- data/README.md +5 -0
- data/Rakefile +2 -0
- data/config/rubocop.yml +10 -0
- data/lib/lyriki.rb +2 -0
- data/lib/lyriki/legacy.rb +3 -0
- data/lib/lyriki/legacy/artist_data.rb +26 -0
- data/lib/lyriki/legacy/song_data.rb +27 -0
- data/lib/lyriki/legacy/song_lyrics.rb +23 -0
- data/lib/lyriki/version.rb +3 -0
- data/lib/web_helpers.rb +11 -0
- data/lyriki.gemspec +26 -0
- data/spec/fixtures/vcr_cassettes/Lyriki_Legacy_ArtistData/.yml +316 -0
- data/spec/fixtures/vcr_cassettes/Lyriki_Legacy_ArtistData/_response_data/should_return_stored_data.yml +316 -0
- data/spec/fixtures/vcr_cassettes/Lyriki_Legacy_SongData/.yml +65 -0
- data/spec/fixtures/vcr_cassettes/Lyriki_Legacy_SongData/_response_data/returns_stored_data.yml +65 -0
- data/spec/fixtures/vcr_cassettes/Lyriki_Legacy_SongLyrics/.yml +1919 -0
- data/spec/fixtures/vcr_cassettes/Lyriki_Legacy_SongLyrics/response_data/returns_data.yml +1919 -0
- data/spec/lyriki/legacy/artist_data_spec.rb +27 -0
- data/spec/lyriki/legacy/song_data_spec.rb +37 -0
- data/spec/lyriki/legacy/song_lyrics_spec.rb +33 -0
- data/spec/lyriki/legacy_spec.rb +7 -0
- data/spec/lyriki_spec.rb +7 -0
- data/spec/spec_helper.rb +15 -0
- data/spec/web_helpers_spec.rb +23 -0
- metadata +144 -0
| @@ -0,0 +1,27 @@ | |
| 1 | 
            +
            require "spec_helper"
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            describe Lyriki::Legacy::ArtistData, vcr: { record: :none } do
         | 
| 4 | 
            +
             | 
| 5 | 
            +
              subject { Lyriki::Legacy::ArtistData.new "frank zappa" }
         | 
| 6 | 
            +
             | 
| 7 | 
            +
              it { is_expected.to be_truthy }
         | 
| 8 | 
            +
             | 
| 9 | 
            +
              describe "#response_data" do
         | 
| 10 | 
            +
                it "should return stored data" do
         | 
| 11 | 
            +
                  data = subject.response_data
         | 
| 12 | 
            +
             | 
| 13 | 
            +
                  expect(data).to have_key "artist"
         | 
| 14 | 
            +
                  expect(data["artist"]).to eq "Frank Zappa"
         | 
| 15 | 
            +
                  expect(data).to have_key "albums"
         | 
| 16 | 
            +
                  expect(data["albums"].length).to eq 41
         | 
| 17 | 
            +
                  expect(data["albums"].first["album"]).to eq "Lumpy Gravy"
         | 
| 18 | 
            +
                end
         | 
| 19 | 
            +
              end
         | 
| 20 | 
            +
             | 
| 21 | 
            +
              describe "initialize without a name" do
         | 
| 22 | 
            +
                it "should raise an error" do
         | 
| 23 | 
            +
                  expect { Lyriki::Legacy::ArtistData.new }.to raise_error ArgumentError
         | 
| 24 | 
            +
                end
         | 
| 25 | 
            +
              end
         | 
| 26 | 
            +
             | 
| 27 | 
            +
            end
         | 
| @@ -0,0 +1,37 @@ | |
| 1 | 
            +
            require "spec_helper"
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            describe Lyriki::Legacy::SongData, vcr: { record: :none } do
         | 
| 4 | 
            +
             | 
| 5 | 
            +
              subject { Lyriki::Legacy::SongData.new artist: "frank zappa", song: "inca roads" }
         | 
| 6 | 
            +
             | 
| 7 | 
            +
              it { is_expected.to be_truthy }
         | 
| 8 | 
            +
             | 
| 9 | 
            +
              describe "#response_data" do
         | 
| 10 | 
            +
                it "returns stored data" do
         | 
| 11 | 
            +
                  data = subject.response_data
         | 
| 12 | 
            +
             | 
| 13 | 
            +
                  expect(data).to have_key "artist"
         | 
| 14 | 
            +
                  expect(data["artist"]).to eq "Frank Zappa"
         | 
| 15 | 
            +
                  expect(data).to have_key "song"
         | 
| 16 | 
            +
                  expect(data["song"]).to eq "Inca Roads"
         | 
| 17 | 
            +
                  expect(data).to have_key "lyrics"
         | 
| 18 | 
            +
                  expect(data["lyrics"].split("\n").length).to eq 11
         | 
| 19 | 
            +
                  expect(data).to have_key "url"
         | 
| 20 | 
            +
                  expect(data["url"]).to eq "http://lyrics.wikia.com/Frank_Zappa:Inca_Roads"
         | 
| 21 | 
            +
                end
         | 
| 22 | 
            +
              end
         | 
| 23 | 
            +
             | 
| 24 | 
            +
              describe "initialize" do
         | 
| 25 | 
            +
                describe "missing artist" do
         | 
| 26 | 
            +
                  it "should throw" do
         | 
| 27 | 
            +
                    expect { Lyriki::Legacy::SongData.new song: "inca roads" }.to raise_error(ArgumentError)
         | 
| 28 | 
            +
                  end
         | 
| 29 | 
            +
                end
         | 
| 30 | 
            +
                describe "missing song" do
         | 
| 31 | 
            +
                  it "should throw" do
         | 
| 32 | 
            +
                    expect { Lyriki::Legacy::SongData.new artist: "frank zappa" }.to raise_error(ArgumentError)
         | 
| 33 | 
            +
                  end
         | 
| 34 | 
            +
                end
         | 
| 35 | 
            +
              end
         | 
| 36 | 
            +
             | 
| 37 | 
            +
            end
         | 
| @@ -0,0 +1,33 @@ | |
| 1 | 
            +
            require "spec_helper"
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            describe Lyriki::Legacy::SongLyrics, vcr: { record: :none } do
         | 
| 4 | 
            +
             | 
| 5 | 
            +
              subject { Lyriki::Legacy::SongLyrics.new artist: "frank zappa", song: "inca roads" }
         | 
| 6 | 
            +
             | 
| 7 | 
            +
              it { is_expected.to be_truthy }
         | 
| 8 | 
            +
             | 
| 9 | 
            +
              describe "response_data" do
         | 
| 10 | 
            +
                it "returns data" do
         | 
| 11 | 
            +
                  data = subject.response_data
         | 
| 12 | 
            +
                  trimmed_data = data.map(&:strip)
         | 
| 13 | 
            +
             | 
| 14 | 
            +
                  expect(trimmed_data).to include "Did a vehicle"
         | 
| 15 | 
            +
                  expect(trimmed_data).to include "Come from somewhere out there"
         | 
| 16 | 
            +
                  expect(trimmed_data).to include "That's Ruth"
         | 
| 17 | 
            +
                end
         | 
| 18 | 
            +
              end
         | 
| 19 | 
            +
             | 
| 20 | 
            +
              describe "initialize" do
         | 
| 21 | 
            +
                describe "without an artist" do
         | 
| 22 | 
            +
                  it "should raise an error" do
         | 
| 23 | 
            +
                    expect{ Lyriki::Legacy::SongLyrics.new song: "inca roads" }.to raise_error(ArgumentError)
         | 
| 24 | 
            +
                  end
         | 
| 25 | 
            +
                end
         | 
| 26 | 
            +
                describe "without a song" do
         | 
| 27 | 
            +
                  it "should raise an error" do
         | 
| 28 | 
            +
                    expect{ Lyriki::Legacy::SongLyrics.new artist: "fz" }.to raise_error(ArgumentError)
         | 
| 29 | 
            +
                  end
         | 
| 30 | 
            +
                end
         | 
| 31 | 
            +
              end
         | 
| 32 | 
            +
             | 
| 33 | 
            +
            end
         | 
    
        data/spec/lyriki_spec.rb
    ADDED
    
    
    
        data/spec/spec_helper.rb
    ADDED
    
    | @@ -0,0 +1,15 @@ | |
| 1 | 
            +
            require "codeclimate-test-reporter"
         | 
| 2 | 
            +
            CodeClimate::TestReporter.start
         | 
| 3 | 
            +
             | 
| 4 | 
            +
            require "lyriki"
         | 
| 5 | 
            +
             | 
| 6 | 
            +
            # order matters
         | 
| 7 | 
            +
            require "webmock/rspec"
         | 
| 8 | 
            +
            require "vcr"
         | 
| 9 | 
            +
             | 
| 10 | 
            +
            VCR.configure do |c|
         | 
| 11 | 
            +
              c.cassette_library_dir = "spec/fixtures/vcr_cassettes"
         | 
| 12 | 
            +
              c.configure_rspec_metadata!
         | 
| 13 | 
            +
              c.hook_into :webmock
         | 
| 14 | 
            +
              c.ignore_hosts "codeclimate.com"
         | 
| 15 | 
            +
            end
         | 
| @@ -0,0 +1,23 @@ | |
| 1 | 
            +
            require "spec_helper"
         | 
| 2 | 
            +
            require "web_helpers"
         | 
| 3 | 
            +
             | 
| 4 | 
            +
            describe WebHelpers do
         | 
| 5 | 
            +
             | 
| 6 | 
            +
              subject { Class.new { include WebHelpers }.new }
         | 
| 7 | 
            +
             | 
| 8 | 
            +
              describe "#url_encode" do
         | 
| 9 | 
            +
                it "should replace apostrophes" do
         | 
| 10 | 
            +
                  encoded = subject.url_encode("foo's bar")
         | 
| 11 | 
            +
             | 
| 12 | 
            +
                  expect(encoded).not_to include "'"
         | 
| 13 | 
            +
                  expect(encoded).to include "%27"
         | 
| 14 | 
            +
                end
         | 
| 15 | 
            +
              end
         | 
| 16 | 
            +
             | 
| 17 | 
            +
              describe "#get" do
         | 
| 18 | 
            +
                it { is_expected.to respond_to :get }
         | 
| 19 | 
            +
                it "should hit Net::HTTP"
         | 
| 20 | 
            +
                it "should use URI"
         | 
| 21 | 
            +
              end
         | 
| 22 | 
            +
             | 
| 23 | 
            +
            end
         | 
    
        metadata
    ADDED
    
    | @@ -0,0 +1,144 @@ | |
| 1 | 
            +
            --- !ruby/object:Gem::Specification
         | 
| 2 | 
            +
            name: lyriki
         | 
| 3 | 
            +
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            +
              version: 0.0.1
         | 
| 5 | 
            +
            platform: ruby
         | 
| 6 | 
            +
            authors:
         | 
| 7 | 
            +
            - Alexander
         | 
| 8 | 
            +
            autorequire: 
         | 
| 9 | 
            +
            bindir: bin
         | 
| 10 | 
            +
            cert_chain: []
         | 
| 11 | 
            +
            date: 2014-11-30 00:00:00.000000000 Z
         | 
| 12 | 
            +
            dependencies:
         | 
| 13 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 14 | 
            +
              name: json
         | 
| 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 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 28 | 
            +
              name: nokogiri
         | 
| 29 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 30 | 
            +
                requirements:
         | 
| 31 | 
            +
                - - ">="
         | 
| 32 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 33 | 
            +
                    version: '0'
         | 
| 34 | 
            +
              type: :runtime
         | 
| 35 | 
            +
              prerelease: false
         | 
| 36 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 37 | 
            +
                requirements:
         | 
| 38 | 
            +
                - - ">="
         | 
| 39 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 40 | 
            +
                    version: '0'
         | 
| 41 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 42 | 
            +
              name: bundler
         | 
| 43 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 44 | 
            +
                requirements:
         | 
| 45 | 
            +
                - - "~>"
         | 
| 46 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 47 | 
            +
                    version: '1.6'
         | 
| 48 | 
            +
              type: :development
         | 
| 49 | 
            +
              prerelease: false
         | 
| 50 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 51 | 
            +
                requirements:
         | 
| 52 | 
            +
                - - "~>"
         | 
| 53 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 54 | 
            +
                    version: '1.6'
         | 
| 55 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 56 | 
            +
              name: rake
         | 
| 57 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 58 | 
            +
                requirements:
         | 
| 59 | 
            +
                - - ">="
         | 
| 60 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 61 | 
            +
                    version: '0'
         | 
| 62 | 
            +
              type: :development
         | 
| 63 | 
            +
              prerelease: false
         | 
| 64 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 65 | 
            +
                requirements:
         | 
| 66 | 
            +
                - - ">="
         | 
| 67 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 68 | 
            +
                    version: '0'
         | 
| 69 | 
            +
            description: A basic Ruby wrapper for the API provided by LyricsWiki (http://lyrics.wikia.com/).
         | 
| 70 | 
            +
            email:
         | 
| 71 | 
            +
            - alxndr+gem@gmail.com
         | 
| 72 | 
            +
            executables: []
         | 
| 73 | 
            +
            extensions: []
         | 
| 74 | 
            +
            extra_rdoc_files: []
         | 
| 75 | 
            +
            files:
         | 
| 76 | 
            +
            - ".gitignore"
         | 
| 77 | 
            +
            - ".hound.yml"
         | 
| 78 | 
            +
            - ".travis.yml"
         | 
| 79 | 
            +
            - Gemfile
         | 
| 80 | 
            +
            - Gemfile.lock
         | 
| 81 | 
            +
            - Guardfile
         | 
| 82 | 
            +
            - LICENSE.txt
         | 
| 83 | 
            +
            - README.md
         | 
| 84 | 
            +
            - Rakefile
         | 
| 85 | 
            +
            - config/rubocop.yml
         | 
| 86 | 
            +
            - lib/lyriki.rb
         | 
| 87 | 
            +
            - lib/lyriki/legacy.rb
         | 
| 88 | 
            +
            - lib/lyriki/legacy/artist_data.rb
         | 
| 89 | 
            +
            - lib/lyriki/legacy/song_data.rb
         | 
| 90 | 
            +
            - lib/lyriki/legacy/song_lyrics.rb
         | 
| 91 | 
            +
            - lib/lyriki/version.rb
         | 
| 92 | 
            +
            - lib/web_helpers.rb
         | 
| 93 | 
            +
            - lyriki.gemspec
         | 
| 94 | 
            +
            - spec/fixtures/vcr_cassettes/Lyriki_Legacy_ArtistData/.yml
         | 
| 95 | 
            +
            - spec/fixtures/vcr_cassettes/Lyriki_Legacy_ArtistData/_response_data/should_return_stored_data.yml
         | 
| 96 | 
            +
            - spec/fixtures/vcr_cassettes/Lyriki_Legacy_SongData/.yml
         | 
| 97 | 
            +
            - spec/fixtures/vcr_cassettes/Lyriki_Legacy_SongData/_response_data/returns_stored_data.yml
         | 
| 98 | 
            +
            - spec/fixtures/vcr_cassettes/Lyriki_Legacy_SongLyrics/.yml
         | 
| 99 | 
            +
            - spec/fixtures/vcr_cassettes/Lyriki_Legacy_SongLyrics/response_data/returns_data.yml
         | 
| 100 | 
            +
            - spec/lyriki/legacy/artist_data_spec.rb
         | 
| 101 | 
            +
            - spec/lyriki/legacy/song_data_spec.rb
         | 
| 102 | 
            +
            - spec/lyriki/legacy/song_lyrics_spec.rb
         | 
| 103 | 
            +
            - spec/lyriki/legacy_spec.rb
         | 
| 104 | 
            +
            - spec/lyriki_spec.rb
         | 
| 105 | 
            +
            - spec/spec_helper.rb
         | 
| 106 | 
            +
            - spec/web_helpers_spec.rb
         | 
| 107 | 
            +
            homepage: http://github.com/alxndr/lyriki
         | 
| 108 | 
            +
            licenses:
         | 
| 109 | 
            +
            - MIT
         | 
| 110 | 
            +
            metadata: {}
         | 
| 111 | 
            +
            post_install_message: 
         | 
| 112 | 
            +
            rdoc_options: []
         | 
| 113 | 
            +
            require_paths:
         | 
| 114 | 
            +
            - lib
         | 
| 115 | 
            +
            required_ruby_version: !ruby/object:Gem::Requirement
         | 
| 116 | 
            +
              requirements:
         | 
| 117 | 
            +
              - - ">="
         | 
| 118 | 
            +
                - !ruby/object:Gem::Version
         | 
| 119 | 
            +
                  version: '0'
         | 
| 120 | 
            +
            required_rubygems_version: !ruby/object:Gem::Requirement
         | 
| 121 | 
            +
              requirements:
         | 
| 122 | 
            +
              - - ">="
         | 
| 123 | 
            +
                - !ruby/object:Gem::Version
         | 
| 124 | 
            +
                  version: '0'
         | 
| 125 | 
            +
            requirements: []
         | 
| 126 | 
            +
            rubyforge_project: 
         | 
| 127 | 
            +
            rubygems_version: 2.2.2
         | 
| 128 | 
            +
            signing_key: 
         | 
| 129 | 
            +
            specification_version: 4
         | 
| 130 | 
            +
            summary: A wrapper for the LyricsWiki API
         | 
| 131 | 
            +
            test_files:
         | 
| 132 | 
            +
            - spec/fixtures/vcr_cassettes/Lyriki_Legacy_ArtistData/.yml
         | 
| 133 | 
            +
            - spec/fixtures/vcr_cassettes/Lyriki_Legacy_ArtistData/_response_data/should_return_stored_data.yml
         | 
| 134 | 
            +
            - spec/fixtures/vcr_cassettes/Lyriki_Legacy_SongData/.yml
         | 
| 135 | 
            +
            - spec/fixtures/vcr_cassettes/Lyriki_Legacy_SongData/_response_data/returns_stored_data.yml
         | 
| 136 | 
            +
            - spec/fixtures/vcr_cassettes/Lyriki_Legacy_SongLyrics/.yml
         | 
| 137 | 
            +
            - spec/fixtures/vcr_cassettes/Lyriki_Legacy_SongLyrics/response_data/returns_data.yml
         | 
| 138 | 
            +
            - spec/lyriki/legacy/artist_data_spec.rb
         | 
| 139 | 
            +
            - spec/lyriki/legacy/song_data_spec.rb
         | 
| 140 | 
            +
            - spec/lyriki/legacy/song_lyrics_spec.rb
         | 
| 141 | 
            +
            - spec/lyriki/legacy_spec.rb
         | 
| 142 | 
            +
            - spec/lyriki_spec.rb
         | 
| 143 | 
            +
            - spec/spec_helper.rb
         | 
| 144 | 
            +
            - spec/web_helpers_spec.rb
         |