Giter Site home page Giter Site logo

austinksmith / spud_videos Goto Github PK

View Code? Open in Web Editor NEW

This project forked from spud-rails/spud_videos

0.0 2.0 0.0 215 KB

Basic video Management Spud Gem

Home Page: http://www.redwindsw.com

License: MIT License

Ruby 92.74% JavaScript 5.10% CSS 2.15%

spud_videos's Introduction

Spud Videos

Spud Videos is an engine for managing and embedding Youtube / Vimeo videos, designed for use with Spud and Spud CMS.

Installation/Usage

  1. In your Gemfile add the following

    gem 'spud_videos'

  2. Run bundle install

  3. Copy in database migrations to your new rails project

    bundle exec rake railties:install:migrations rake db:migrate

  4. Run a rails server instance and point your browser to /spud/admin

Configuration

Spud Videos accepts the following configuration options:

Spud::Videos.configure do |config|
  config.base_layout = "application"
  config.enable_videos_route = true
  config.default_dimensions = [560,315]
end

Adding a Video

Videos are added in the Spud admin. When adding a video, you can specify wether the video is hosted on youtube or vimeo. It is also possible to specify a name and description for the video which can be rendered on the /videos url. In many cases, it may be unnecessary to have the videos route. Spud Videos makes it easy to embed videos into spud_cms pages by using liquid tags.

Helpers

Videos provides a helper method for rendering these embedded videos:

spud_video(set_or_identifier, options)

Example:

spud_video(:promotional, {:width => 500, :height => 300})

Liquid

Spud Videos comes with its own custom Liquid tag. For now the liquid tag only supports rendering the standard html as generated by the spud_video. Will support more advanced options in the future.

Usage:

  <%= raw Liquid::Template.parse("{% video Promotion width=500 height=300 %}").render %>

Testing

Spud uses RSpec for testing. Get the tests running with a few short commands:

  1. Create and migrate the databases:

    rake db:create rake db:migrate

  2. Load the schema in to the test database:

    rake app:db:test:prepare

  3. Run the tests with RSpec

    rspec spec

After the tests have completed the current code coverage stats is available by opening /coverage/index.html in a browser.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.