source stringclasses 1
value | repo stringlengths 5 63 | repo_url stringlengths 24 82 | path stringlengths 5 167 | language stringclasses 1
value | license stringclasses 5
values | stars int64 10 51.4k | ref stringclasses 23
values | size_bytes int64 200 258k | text stringlengths 137 258k |
|---|---|---|---|---|---|---|---|---|---|
github | renchap/webpacker-react | https://github.com/renchap/webpacker-react | test/integration/custom_tag_test.rb | Ruby | mit | 203 | master | 522 | require "test_helper"
class CustomTagTest < ActionDispatch::IntegrationTest
test "renders from a view with a custom tag" do
require_js
visit "/custom_tag_view"
assert_selector "span[data-react-class]", text: "Hello, I am a component rendered from a view in a span!"
end
test "renders from a controll... |
github | renchap/webpacker-react | https://github.com/renchap/webpacker-react | test/integration/renderer_test.rb | Ruby | mit | 203 | master | 709 | require "test_helper"
class RendererTest < ActionDispatch::IntegrationTest
def url_prefix
""
end
test "renders from a view" do
get url_prefix + "/view"
assert_select "div[data-react-class]", true
end
test "renders from a controller" do
get url_prefix + "/controller"
assert_select "div[d... |
github | renchap/webpacker-react | https://github.com/renchap/webpacker-react | test/integration/renderer_with_turbolinks_test.rb | Ruby | mit | 203 | master | 561 | require "test_helper"
require_relative "./renderer_test"
class RendererWithTurbolinksTest < RendererTest
def url_prefix
"/turbolinks"
end
test "Turbolinks visits" do
require_js
visit url_prefix + "/view_consecutive"
assert page.has_content? "component 1"
assert page.has_content? "component... |
github | renchap/webpacker-react | https://github.com/renchap/webpacker-react | test/example_app/app/controllers/custom_tag_controller.rb | Ruby | mit | 203 | master | 254 | class CustomTagController < ApplicationController
def view_component
end
def controller_component
render react_component: "HelloReact", props: { name: "a component rendered from a controller in a span" }, tag_options: { tag: :span }
end
end |
github | renchap/webpacker-react | https://github.com/renchap/webpacker-react | test/example_app/app/controllers/pages_controller.rb | Ruby | mit | 203 | master | 281 | class PagesController < ApplicationController
def view_component
end
def view_consecutive
@count = (params[:count] || 2).to_i
end
def controller_component
render react_component: "HelloReact", props: { name: "a component rendered from a controller" }
end
end |
github | renchap/webpacker-react | https://github.com/renchap/webpacker-react | test/example_app/config/routes.rb | Ruby | mit | 203 | master | 627 | Rails.application.routes.draw do
get "/view", to: "pages#view_component"
get "/view_consecutive", to: "pages#view_consecutive"
get "/controller", to: "pages#controller_component"
get "/turbolinks/view", to: "turbolinks_pages#view_component"
get "/turbolinks/view_consecutive", to: "turbolinks_pages#view_conse... |
github | renchap/webpacker-react | https://github.com/renchap/webpacker-react | test/example_app/config/application.rb | Ruby | mit | 203 | master | 814 | require_relative "boot"
require "rails"
# Pick the frameworks you want:
require "active_model/railtie"
require "active_job/railtie"
# require "active_record/railtie"
require "action_controller/railtie"
# require "action_mailer/railtie"
require "action_view/railtie"
# require "action_cable/engine"
require "sprockets/ra... |
github | renchap/webpacker-react | https://github.com/renchap/webpacker-react | test/example_app/config/environments/development.rb | Ruby | mit | 203 | master | 1,771 | Rails.application.configure do
# Make javascript_pack_tag load assets from webpack-dev-server.
# config.x.webpacker[:dev_server_host] = "http://localhost:8080"
# Settings specified here will take precedence over those in config/application.rb.
# In the development environment your application's code is reload... |
github | renchap/webpacker-react | https://github.com/renchap/webpacker-react | test/example_app/config/environments/production.rb | Ruby | mit | 203 | master | 3,091 | Rails.application.configure do
# Make javascript_pack_tag lookup digest hash to enable long-term caching
config.x.webpacker[:digesting] = true
# Settings specified here will take precedence over those in config/application.rb.
# Code is not reloaded between requests.
config.cache_classes = true
# Eager l... |
github | renchap/webpacker-react | https://github.com/renchap/webpacker-react | test/example_app/config/environments/test.rb | Ruby | mit | 203 | master | 1,505 | Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# The test environment is used exclusively to run your application's
# test suite. You never need to work with it otherwise. Remember that
# your test database is "scratch space" for the test suit... |
github | renchap/webpacker-react | https://github.com/renchap/webpacker-react | test/example_app/config/initializers/assets.rb | Ruby | mit | 203 | master | 637 | # Be sure to restart your server when you modify this file.
# Version of your assets, change this if you want to expire all your assets.
Rails.application.config.assets.version = "1.0"
# Add additional assets to the asset load path.
# Rails.application.config.assets.paths << Emoji.images_path
# Add Yarn node_modules ... |
github | renchap/webpacker-react | https://github.com/renchap/webpacker-react | test/webpacker/react/component_test.rb | Ruby | mit | 203 | master | 2,278 | require "test_helper"
module Webpacker
module React
class ComponentTest < Minitest::Test
include ERB::Util
def setup
@component = {
name: "Hello",
props: {
name: "React"
}
}
end
def test_it_outputs_a_div_element
expected_... |
github | renchap/webpacker-react | https://github.com/renchap/webpacker-react | lib/webpacker/react.rb | Ruby | mit | 203 | master | 201 | require "webpacker/react/version"
module Webpacker
module React
end
end
require "webpacker/react/railtie" if defined?(Rails)
require "webpacker/react/helpers"
require "webpacker/react/component" |
github | renchap/webpacker-react | https://github.com/renchap/webpacker-react | lib/webpacker/react/railtie.rb | Ruby | mit | 203 | master | 852 | require "rails/railtie"
module Webpacker
module React
class Engine < ::Rails::Engine
initializer :webpacker_react do
ActiveSupport.on_load(:action_controller) do
ActionController::Base.helper ::Webpacker::React::Helpers
end
ActiveSupport.on_load :action_view do
... |
github | renchap/webpacker-react | https://github.com/renchap/webpacker-react | lib/webpacker/react/component.rb | Ruby | mit | 203 | master | 485 | module Webpacker
module React
class Component
include ActionView::Helpers::TagHelper
include ActionView::Helpers::TextHelper
attr_accessor :name
def initialize(name)
@name = name
end
def render(props = {}, options = {})
tag = options.delete(:tag) || :div
... |
github | renchap/webpacker-react | https://github.com/renchap/webpacker-react | lib/webpacker/react/helpers.rb | Ruby | mit | 203 | master | 226 | module Webpacker
module React
module Helpers
def react_component(component_name, props = {}, options = {})
Webpacker::React::Component.new(component_name).render(props, options)
end
end
end
end |
github | ruby/rss | https://github.com/ruby/rss | rss.gemspec | Ruby | bsd-2-clause | 204 | master | 673 | require_relative "lib/rss/version"
Gem::Specification.new do |spec|
spec.name = "rss"
spec.version = RSS::VERSION
spec.authors = ["Kouhei Sutou"]
spec.email = ["kou@cozmixng.org"]
spec.summary = %q{Family of libraries that support various formats of XML "feeds".}
spec.de... |
github | ruby/rss | https://github.com/ruby/rss | Gemfile | Ruby | bsd-2-clause | 204 | master | 318 | source "https://rubygems.org"
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
# Specify your gem's dependencies in rss.gemspec
gemspec
rexml_path = ENV["RSS_REXML_PATH"]
if rexml_path
gem "rexml", path: rexml_path
end
group :development do
gem "bundler"
gem "rake"
gem "test-unit"
end |
github | ruby/rss | https://github.com/ruby/rss | Rakefile | Ruby | bsd-2-clause | 204 | master | 558 | require "bundler/gem_helper"
helper = Bundler::GemHelper.new(__dir__)
def helper.version_tag
version
end
helper.install
desc "Run test"
task :test do
ruby("test/run-test.rb")
end
task :default => :test
release_task = Rake.application["release"]
# We use Trusted Publishing.
release_task.prerequisites.delete("bu... |
github | ruby/rss | https://github.com/ruby/rss | test/test-maker-xml-stylesheet.rb | Ruby | bsd-2-clause | 204 | master | 2,041 | # frozen_string_literal: false
require_relative "rss-testcase"
require "rss/maker"
module RSS
class TestMakerXMLStyleSheet < TestCase
def test_xml_stylesheet
href = 'a.xsl'
type = 'text/xsl'
title = 'sample'
media = 'printer'
charset = 'UTF-8'
alternate = 'yes'
rss = ... |
github | ruby/rss | https://github.com/ruby/rss | test/test-maker-taxo.rb | Ruby | bsd-2-clause | 204 | master | 2,292 | # frozen_string_literal: false
require_relative "rss-testcase"
require "rss/maker"
module RSS
class TestMakerTaxonomy < TestCase
def setup
@uri = "http://purl.org/rss/1.0/modules/taxonomy/"
@resources = [
"http://meerkat.oreillynet.com/?c=cat23",
"http://meerkat.oreillynet.com/?c=4... |
github | ruby/rss | https://github.com/ruby/rss | test/test-maker-trackback.rb | Ruby | bsd-2-clause | 204 | master | 1,000 | # frozen_string_literal: false
require_relative "rss-testcase"
require "rss/maker"
module RSS
class TestMakerTrackBack < TestCase
def setup
@uri = "http://madskills.com/public/xml/rss/module/trackback/"
@elements = {
:ping => "http://bar.com/tb.cgi?tb_id=rssplustrackback",
:abouts ... |
github | ruby/rss | https://github.com/ruby/rss | test/test-setup-maker-0.9.rb | Ruby | bsd-2-clause | 204 | master | 7,049 | # frozen_string_literal: false
require_relative "rss-testcase"
require "rss/maker"
module RSS
class TestSetupMaker09 < TestCase
def test_setup_maker_channel
title = "fugafuga"
link = "http://hoge.com"
description = "fugafugafugafuga"
language = "ja"
copyright = "foo"
managin... |
github | ruby/rss | https://github.com/ruby/rss | test/test-parser-atom-entry.rb | Ruby | bsd-2-clause | 204 | master | 4,237 | # frozen_string_literal: false
require_relative "rss-testcase"
require "rss/atom"
module RSS
class TestParserAtom < TestCase
def test_entry_validation
assert_ns("", Atom::URI) do
Parser.parse(<<-EOA)
<entry/>
EOA
end
assert_ns("", Atom::URI) do
Parser.parse(<<-EOA)
<entry xmln... |
github | ruby/rss | https://github.com/ruby/rss | test/test-maker-atom-feed.rb | Ruby | bsd-2-clause | 204 | master | 16,574 | # frozen_string_literal: false
require_relative "rss-testcase"
require "rss/maker"
module RSS
class TestMakerAtomFeed < TestCase
def test_supported?
assert(RSS::Maker.supported?("atom"))
assert(RSS::Maker.supported?("atom:feed"))
assert(RSS::Maker.supported?("atom1.0"))
assert(RSS::Maker... |
github | ruby/rss | https://github.com/ruby/rss | test/test-setup-maker-2.0.rb | Ruby | bsd-2-clause | 204 | master | 9,174 | # frozen_string_literal: false
require_relative "rss-testcase"
require "rss/maker"
module RSS
class TestSetupMaker20 < TestCase
def test_setup_maker_channel
title = "fugafuga"
link = "http://hoge.com"
description = "fugafugafugafuga"
language = "ja"
copyright = "foo"
managin... |
github | ruby/rss | https://github.com/ruby/rss | test/test-inherit.rb | Ruby | bsd-2-clause | 204 | master | 1,087 | # frozen_string_literal: false
require_relative "rss-testcase"
require "rss/1.0"
module RSS
class TestInherit < TestCase
class InheritedImage < RSS::RDF::Image
def self.indent_size; 1; end
def self.tag_name; 'image'; end
end
def setup
@rss = make_RDF(<<-EOR)
#{make_channel}
#{make_im... |
github | ruby/rss | https://github.com/ruby/rss | test/test-image.rb | Ruby | bsd-2-clause | 204 | master | 7,066 | # frozen_string_literal: false
require "cgi/escape"
require "rexml/document"
require_relative "rss-testcase"
require "rss/1.0"
require "rss/image"
module RSS
class TestImage < TestCase
def setup
@prefix = "image"
@uri = "http://purl.org/rss/1.0/modules/image/"
@favicon_attrs = {
"r... |
github | ruby/rss | https://github.com/ruby/rss | test/test-maker-content.rb | Ruby | bsd-2-clause | 204 | master | 1,049 | # frozen_string_literal: false
require_relative "rss-testcase"
require "rss/maker"
module RSS
class TestMakerContent < TestCase
def setup
@uri = "http://purl.org/rss/1.0/modules/content/"
@elements = {
:encoded => "<em>ATTENTION</em>",
}
end
def test_rss10
rss = RSS::M... |
github | ruby/rss | https://github.com/ruby/rss | test/test-xml-stylesheet.rb | Ruby | bsd-2-clause | 204 | master | 3,562 | # frozen_string_literal: false
require "rexml/document"
require_relative "rss-testcase"
require "rss/1.0"
require "rss/xml-stylesheet"
module RSS
class TestXMLStyleSheet < TestCase
def test_accessor
[
{:href => "a.xsl", :type => "text/xsl"},
{:media => "print", :title => "FOO"},
... |
github | ruby/rss | https://github.com/ruby/rss | test/test-maker-1.0.rb | Ruby | bsd-2-clause | 204 | master | 14,729 | # frozen_string_literal: false
require_relative "rss-testcase"
require "rss/maker"
module RSS
class TestMaker10 < TestCase
def test_supported?
assert(RSS::Maker.supported?("1.0"))
assert(RSS::Maker.supported?("rss1.0"))
assert(!RSS::Maker.supported?("1.1"))
assert(!RSS::Maker.supported?(... |
github | ruby/rss | https://github.com/ruby/rss | test/test-parser-atom-feed.rb | Ruby | bsd-2-clause | 204 | master | 7,565 | # frozen_string_literal: false
require_relative "rss-testcase"
require "rss/atom"
module RSS
class TestParserAtomFeed < TestCase
def test_feed_validation
assert_ns("", Atom::URI) do
Parser.parse(<<-EOA)
<feed/>
EOA
end
assert_ns("", Atom::URI) do
Parser.parse(<<-EOA)
<feed xml... |
github | ruby/rss | https://github.com/ruby/rss | test/test-accessor.rb | Ruby | bsd-2-clause | 204 | master | 2,565 | # frozen_string_literal: false
require_relative "rss-testcase"
require "rss/1.0"
require "rss/2.0"
require "rss/syndication"
require "rss/image"
module RSS
class TestAccessor < TestCase
def test_date
channel = Rss::Channel.new
channel.pubDate = nil
assert_nil(channel.pubDate)
time = Tim... |
github | ruby/rss | https://github.com/ruby/rss | test/test-maker-dc.rb | Ruby | bsd-2-clause | 204 | master | 4,247 | # frozen_string_literal: false
require_relative "rss-testcase"
require "rss/maker"
module RSS
class TestMakerDublinCore < TestCase
def setup
@uri = "http://purl.org/dc/elements/1.1/"
t = Time.iso8601("2000-01-01T12:00:05+00:00")
class << t
alias_method(:to_s, :iso8601)
end
... |
github | ruby/rss | https://github.com/ruby/rss | test/test-parser-2.0.rb | Ruby | bsd-2-clause | 204 | master | 2,955 | # frozen_string_literal: false
require_relative "rss-testcase"
require "rss/2.0"
module RSS
class TestParser20 < TestCase
def test_rss20
assert_parse(make_rss20(<<-EOR), :missing_tag, "channel", "rss")
EOR
assert_parse(make_rss20(<<-EOR), :nothing_raised)
#{make_channel20("")}
EOR
end
def ... |
github | ruby/rss | https://github.com/ruby/rss | test/test-maker-image.rb | Ruby | bsd-2-clause | 204 | master | 1,883 | # frozen_string_literal: false
require_relative "rss-testcase"
require "rss/maker"
module RSS
class TestMakerImage < TestCase
def setup
@uri = "http://web.resource.org/rss/1.0/modules/image/"
@favicon_infos = {
"about" => "http://www.kuro5hin.org/favicon.ico",
"image_size" => "smal... |
github | ruby/rss | https://github.com/ruby/rss | test/test-trackback.rb | Ruby | bsd-2-clause | 204 | master | 3,777 | # frozen_string_literal: false
require "cgi/escape"
require "rexml/document"
require_relative "rss-testcase"
require "rss/1.0"
require "rss/2.0"
require "rss/trackback"
module RSS
class TestTrackBack < TestCase
def setup
@prefix = "trackback"
@uri = "http://madskills.com/public/xml/rss/module/trac... |
github | ruby/rss | https://github.com/ruby/rss | test/test-maker-itunes.rb | Ruby | bsd-2-clause | 204 | master | 22,388 | # frozen_string_literal: false
require_relative "rss-testcase"
require "rss/maker"
module RSS
class TestMakerITunes < TestCase
def test_author
assert_maker_itunes_author(%w(channel))
assert_maker_itunes_author(%w(items last))
end
def test_block
assert_maker_itunes_block(%w(channel))
... |
github | ruby/rss | https://github.com/ruby/rss | test/test-1.0.rb | Ruby | bsd-2-clause | 204 | master | 8,353 | # frozen_string_literal: false
require "rexml/document"
require_relative "rss-testcase"
require "rss/1.0"
module RSS
class TestRSS10Core < TestCase
def setup
@rdf_prefix = "rdf"
@rdf_uri = "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
@uri = "http://purl.org/rss/1.0/"
end
def test_R... |
github | ruby/rss | https://github.com/ruby/rss | test/rss-assertions.rb | Ruby | bsd-2-clause | 204 | master | 70,726 | # frozen_string_literal: false
require 'erb'
module RSS
module Assertions
def assert_parse(rss, assert_method, *args)
__send__("assert_#{assert_method}", *args) do
::RSS::Parser.parse(rss)
end
__send__("assert_#{assert_method}", *args) do
::RSS::Parser.parse(rss, false).validate... |
github | ruby/rss | https://github.com/ruby/rss | test/test-maker-atom-entry.rb | Ruby | bsd-2-clause | 204 | master | 14,097 | # frozen_string_literal: false
require_relative "rss-testcase"
require "rss/maker"
module RSS
class TestMakerAtomEntry < TestCase
def test_supported?
assert(RSS::Maker.supported?("atom:entry"))
assert(RSS::Maker.supported?("atom1.0:entry"))
assert(!RSS::Maker.supported?("atom2.0:entry"))
e... |
github | ruby/rss | https://github.com/ruby/rss | test/test-setup-maker-atom-entry.rb | Ruby | bsd-2-clause | 204 | master | 12,667 | # frozen_string_literal: false
require_relative "rss-testcase"
require "rss/maker"
module RSS
class TestSetupMakerAtomEntry < TestCase
def setup
t = Time.iso8601("2000-01-01T12:00:05+00:00")
class << t
alias_method(:to_s, :iso8601)
end
@dc_elems = {
:title => "hoge",
... |
github | ruby/rss | https://github.com/ruby/rss | test/test-maker-sy.rb | Ruby | bsd-2-clause | 204 | master | 919 | # frozen_string_literal: false
require_relative "rss-testcase"
require "rss/maker"
module RSS
class TestMakerSyndication < TestCase
def setup
@uri = "http://purl.org/rss/1.0/modules/syndication/"
t = Time.iso8601("2000-01-01T12:00:05+00:00")
class << t
alias_method(:to_s, :iso8601)
... |
github | ruby/rss | https://github.com/ruby/rss | test/test-atom.rb | Ruby | bsd-2-clause | 204 | master | 22,324 | # frozen_string_literal: false
require "rexml/document"
require_relative "rss-testcase"
require "rss/atom"
module RSS
class TestAtomCore < TestCase
def setup
@uri = "http://www.w3.org/2005/Atom"
@xhtml_uri = "http://www.w3.org/1999/xhtml"
end
def test_feed
version = "1.0"
encod... |
github | ruby/rss | https://github.com/ruby/rss | test/run-test.rb | Ruby | bsd-2-clause | 204 | master | 290 | #!/usr/bin/env ruby
$VERBOSE = true
base_dir = File.expand_path("..", __dir__)
lib_dir = File.join(base_dir, "lib")
test_dir = File.join(base_dir, "test")
require "test-unit"
$LOAD_PATH.unshift(lib_dir)
require_relative "rss-testcase"
exit(Test::Unit::AutoRunner.run(true, test_dir)) |
github | ruby/rss | https://github.com/ruby/rss | test/test-setup-maker-atom-feed.rb | Ruby | bsd-2-clause | 204 | master | 13,859 | # frozen_string_literal: false
require_relative "rss-testcase"
require "rss/maker"
module RSS
class TestSetupMakerAtomFeed < TestCase
def setup
t = Time.iso8601("2000-01-01T12:00:05+00:00")
class << t
alias_method(:to_s, :iso8601)
end
@dc_elems = {
:title => "hoge",
... |
github | ruby/rss | https://github.com/ruby/rss | test/test-parser.rb | Ruby | bsd-2-clause | 204 | master | 3,067 | # frozen_string_literal: false
require "tempfile"
require_relative "rss-testcase"
require "rss/1.0"
require "rss/dublincore"
module RSS
class TestParser < TestCase
def setup
@_default_parser = Parser.default_parser
@rss10 = make_RDF(<<-EOR)
#{make_channel}
#{make_item}
#{make_textinput}
#{make_imag... |
github | ruby/rss | https://github.com/ruby/rss | test/test-setup-maker-1.0.rb | Ruby | bsd-2-clause | 204 | master | 16,592 | # frozen_string_literal: false
require_relative "rss-testcase"
require "rss/maker"
module RSS
class TestSetupMaker10 < TestCase
def setup
t = Time.iso8601("2000-01-01T12:00:05+00:00")
class << t
alias_method(:to_s, :iso8601)
end
@dc_elems = {
:title => "hoge",
:... |
github | ruby/rss | https://github.com/ruby/rss | test/test-setup-maker-slash.rb | Ruby | bsd-2-clause | 204 | master | 1,023 | # frozen_string_literal: false
require_relative "rss-testcase"
require "rss/maker"
module RSS
class TestSetupMakerSlash < TestCase
def test_setup_maker
elements = {
"section" => "articles",
"department" => "not-an-ocean-unless-there-are-lobsters",
"comments" => 177,
"hit_pa... |
github | ruby/rss | https://github.com/ruby/rss | test/test-maker-2.0.rb | Ruby | bsd-2-clause | 204 | master | 22,680 | # frozen_string_literal: false
require_relative "rss-testcase"
require "rss/maker"
module RSS
class TestMaker20 < TestCase
def test_supported?
assert(RSS::Maker.supported?("2.0"))
assert(RSS::Maker.supported?("rss2.0"))
assert(!RSS::Maker.supported?("2.2"))
assert(!RSS::Maker.supported?(... |
github | ruby/rss | https://github.com/ruby/rss | test/test-taxonomy.rb | Ruby | bsd-2-clause | 204 | master | 5,083 | # frozen_string_literal: false
require "cgi/escape"
require_relative "rss-testcase"
require "rss/1.0"
require "rss/2.0"
require "rss/taxonomy"
module RSS
class TestTaxonomy < TestCase
def setup
@prefix = "taxo"
@uri = "http://purl.org/rss/1.0/modules/taxonomy/"
@dc_prefix = "dc"
@dc_ur... |
github | ruby/rss | https://github.com/ruby/rss | test/rss-testcase.rb | Ruby | bsd-2-clause | 204 | master | 11,975 | # frozen_string_literal: false
require "erb"
require "test/unit"
require_relative 'rss-assertions'
require "rss"
module RSS
class TestCase < Test::Unit::TestCase
include ERB::Util
include RSS
include Assertions
XMLDECL_VERSION = "1.0"
XMLDECL_ENCODING = "UTF-8"
XMLDECL_STANDALONE = "no"
... |
github | ruby/rss | https://github.com/ruby/rss | test/test-maker-0.9.rb | Ruby | bsd-2-clause | 204 | master | 14,162 | # frozen_string_literal: false
require_relative "rss-testcase"
require "rss/maker"
module RSS
class TestMaker09 < TestCase
def test_supported?
assert(RSS::Maker.supported?("0.9"))
assert(RSS::Maker.supported?("rss0.9"))
assert(RSS::Maker.supported?("0.91"))
assert(RSS::Maker.supported?("... |
github | ruby/rss | https://github.com/ruby/rss | test/test-maker-slash.rb | Ruby | bsd-2-clause | 204 | master | 832 | # frozen_string_literal: false
require_relative "rss-testcase"
require "rss/maker"
module RSS
class TestMakerSlash < TestCase
def setup
@elements = {
"section" => "articles",
"department" => "not-an-ocean-unless-there-are-lobsters",
"comments" => 177,
"hit_parades" => [177,... |
github | ruby/rss | https://github.com/ruby/rss | test/test-syndication.rb | Ruby | bsd-2-clause | 204 | master | 3,131 | # frozen_string_literal: false
require "cgi/escape"
require "rexml/document"
require_relative "rss-testcase"
require "rss/1.0"
require "rss/syndication"
module RSS
class TestSyndication < TestCase
def setup
@prefix = "sy"
@uri = "http://purl.org/rss/1.0/modules/syndication/"
@parents = %w(c... |
github | ruby/rss | https://github.com/ruby/rss | test/test-to-s.rb | Ruby | bsd-2-clause | 204 | master | 19,680 | # frozen_string_literal: false
require "rexml/document"
require_relative "rss-testcase"
require "rss/maker"
require "rss/1.0"
require "rss/2.0"
require "rss/content"
require "rss/dublincore"
require "rss/syndication"
require "rss/trackback"
module RSS
class TestToS < TestCase
def setup
@image_url = "http... |
github | ruby/rss | https://github.com/ruby/rss | test/test-slash.rb | Ruby | bsd-2-clause | 204 | master | 1,356 | # frozen_string_literal: false
require "cgi/escape"
require "rexml/document"
require_relative "rss-testcase"
require "rss/1.0"
require "rss/slash"
module RSS
class TestSlash < TestCase
def setup
@elements = {
"section" => "articles",
"department" => "not-an-ocean-unless-there-are-lobsters... |
github | ruby/rss | https://github.com/ruby/rss | test/test-2.0.rb | Ruby | bsd-2-clause | 204 | master | 12,582 | # frozen_string_literal: false
require "rexml/document"
require_relative "rss-testcase"
module RSS
class TestRSS20Core < TestCase
def setup
@rss_version = "2.0"
end
def test_Rss
version = "1.0"
encoding = "UTF-8"
standalone = false
rss = Rss.new(@rss_version, version, en... |
github | ruby/rss | https://github.com/ruby/rss | test/test-dublincore.rb | Ruby | bsd-2-clause | 204 | master | 9,278 | # frozen_string_literal: false
require "cgi/escape"
require "rexml/document"
require_relative "rss-testcase"
require "rss/1.0"
require "rss/dublincore"
module RSS
class TestDublinCore < TestCase
def setup
@rss10_parents = [%w(channel), %w(image), %w(item), %w(textinput)]
@rss10_source = make_RDF(<... |
github | ruby/rss | https://github.com/ruby/rss | test/test-itunes.rb | Ruby | bsd-2-clause | 204 | master | 17,572 | # frozen_string_literal: false
require "cgi/escape"
require "rexml/document"
require_relative "rss-testcase"
require "rss/2.0"
require "rss/itunes"
module RSS
class TestITunes < TestCase
def test_author
assert_itunes_author(%w(channel)) do |content, xmlns|
make_rss20(make_channel20(content), xmln... |
github | ruby/rss | https://github.com/ruby/rss | test/test-setup-maker-itunes.rb | Ruby | bsd-2-clause | 204 | master | 4,555 | # frozen_string_literal: false
require_relative "rss-testcase"
require "rss/maker"
module RSS
class TestSetupMakerITunes < TestCase
def test_setup_maker_simple
author = "John Doe"
block = true
categories = ["Audio Blogs"]
image = "http://example.com/podcasts/everything/AllAboutEverything... |
github | ruby/rss | https://github.com/ruby/rss | test/test-parser-1.0.rb | Ruby | bsd-2-clause | 204 | master | 12,359 | # frozen_string_literal: false
require_relative "rss-testcase"
require "rss/1.0"
require "rss/dublincore"
module RSS
class TestParser10 < TestCase
def test_RDF
assert_ns("", RDF::URI) do
Parser.parse(<<-EOR)
#{make_xmldecl}
<RDF/>
EOR
end
assert_ns("", RDF::URI) do
Parser.pars... |
github | ruby/rss | https://github.com/ruby/rss | test/test-content.rb | Ruby | bsd-2-clause | 204 | master | 2,681 | # frozen_string_literal: false
require "cgi/escape"
require "rexml/document"
require_relative "rss-testcase"
require "rss/content"
module RSS
class TestContent < TestCase
def setup
@prefix = "content"
@uri = "http://purl.org/rss/1.0/modules/content/"
@elems = {
:encoded => "<em>ATTEN... |
github | ruby/rss | https://github.com/ruby/rss | lib/rss.rb | Ruby | bsd-2-clause | 204 | master | 2,847 | # frozen_string_literal: false
##
# = RSS reading and writing
#
# Really Simple Syndication (RSS) is a family of formats that describe 'feeds,'
# specially constructed XML documents that allow an interested person to
# subscribe and receive updates from a particular web service. This portion of
# the standard library p... |
github | ruby/rss | https://github.com/ruby/rss | lib/rss/atom.rb | Ruby | bsd-2-clause | 204 | master | 29,601 | # frozen_string_literal: false
require_relative 'parser'
module RSS
##
# Atom is an XML-based document format that is used to describe 'feeds' of related information.
# A typical use is in a news feed where the information is periodically updated and which users
# can subscribe to. The Atom format is describe... |
github | ruby/rss | https://github.com/ruby/rss | lib/rss/1.0.rb | Ruby | bsd-2-clause | 204 | master | 9,872 | # frozen_string_literal: false
require_relative "parser"
module RSS
##
# = RSS 1.0 support
#
# RSS has three different versions. This module contains support for version
# 1.0[http://web.resource.org/rss/1.0/]
#
# == Producing RSS 1.0
#
# Producing our own RSS feeds is easy as well. Let's make a ver... |
github | ruby/rss | https://github.com/ruby/rss | lib/rss/xml.rb | Ruby | bsd-2-clause | 204 | master | 1,540 | # frozen_string_literal: false
require "cgi/escape"
module RSS
module XML
class Element
include Enumerable
attr_reader :name, :prefix, :uri, :attributes, :children
def initialize(name, prefix=nil, uri=nil, attributes={}, children=[])
@name = name
@prefix = prefix
@uri ... |
github | ruby/rss | https://github.com/ruby/rss | lib/rss/rexmlparser.rb | Ruby | bsd-2-clause | 204 | master | 995 | # frozen_string_literal: false
require "rexml/document"
require "rexml/streamlistener"
module RSS
class REXMLParser < BaseParser
class << self
def listener
REXMLListener
end
end
private
def _parse
begin
REXML::Document.parse_stream(@rss, @listener)
rescue Ru... |
github | ruby/rss | https://github.com/ruby/rss | lib/rss/syndication.rb | Ruby | bsd-2-clause | 204 | master | 1,928 | # frozen_string_literal: false
require "rss/1.0"
module RSS
# The prefix for the Syndication XML namespace.
SY_PREFIX = 'sy'
# The URI of the Syndication specification.
SY_URI = "http://purl.org/rss/1.0/modules/syndication/"
RDF.install_ns(SY_PREFIX, SY_URI)
module SyndicationModel
extend BaseModel
... |
github | ruby/rss | https://github.com/ruby/rss | lib/rss/slash.rb | Ruby | bsd-2-clause | 204 | master | 1,360 | # frozen_string_literal: false
require 'rss/1.0'
module RSS
# The prefix for the Slash XML namespace.
SLASH_PREFIX = 'slash'
# The URI of the Slash specification.
SLASH_URI = "http://purl.org/rss/1.0/modules/slash/"
RDF.install_ns(SLASH_PREFIX, SLASH_URI)
module SlashModel
extend BaseModel
ELEME... |
github | ruby/rss | https://github.com/ruby/rss | lib/rss/content.rb | Ruby | bsd-2-clause | 204 | master | 895 | # frozen_string_literal: false
require_relative "rss"
module RSS
# The prefix for the Content XML namespace.
CONTENT_PREFIX = 'content'
# The URI of the Content specification.
CONTENT_URI = "http://purl.org/rss/1.0/modules/content/"
module ContentModel
extend BaseModel
ELEMENTS = ["#{CONTENT_PREFIX... |
github | ruby/rss | https://github.com/ruby/rss | lib/rss/itunes.rb | Ruby | bsd-2-clause | 204 | master | 11,882 | # frozen_string_literal: false
require 'rss/2.0'
module RSS
# The prefix for the iTunes XML namespace.
ITUNES_PREFIX = 'itunes'
# The URI of the iTunes specification.
ITUNES_URI = 'http://www.itunes.com/dtds/podcast-1.0.dtd'
Rss.install_ns(ITUNES_PREFIX, ITUNES_URI)
module ITunesModelUtils
include Ut... |
github | ruby/rss | https://github.com/ruby/rss | lib/rss/trackback.rb | Ruby | bsd-2-clause | 204 | master | 6,877 | # frozen_string_literal: false
# This file contains the implementation of trackbacks. It is entirely internal
# and not useful to outside developers.
require 'rss/1.0'
require 'rss/2.0'
module RSS # :nodoc: all
TRACKBACK_PREFIX = 'trackback'
TRACKBACK_URI = 'http://madskills.com/public/xml/rss/module/trackback/'
... |
github | ruby/rss | https://github.com/ruby/rss | lib/rss/utils.rb | Ruby | bsd-2-clause | 204 | master | 4,706 | # frozen_string_literal: false
module RSS
##
# RSS::Utils is a module that holds various utility functions that are used
# across many parts of the rest of the RSS library. Like most modules named
# some variant of 'util', its methods are probably not particularly useful
# to those who aren't developing the ... |
github | ruby/rss | https://github.com/ruby/rss | lib/rss/xml-stylesheet.rb | Ruby | bsd-2-clause | 204 | master | 2,212 | # frozen_string_literal: false
require "cgi/escape"
module RSS
module XMLStyleSheetMixin
attr_accessor :xml_stylesheets
def initialize(*args)
super
@xml_stylesheets = []
end
private
def xml_stylesheet_pi
xsss = @xml_stylesheets.collect do |xss|
pi = xss.to_s
p... |
github | ruby/rss | https://github.com/ruby/rss | lib/rss/converter.rb | Ruby | bsd-2-clause | 204 | master | 3,996 | # frozen_string_literal: false
require_relative "utils"
module RSS
class Converter
include Utils
def initialize(to_enc, from_enc=nil)
if "".respond_to?(:encode)
@to_encoding = to_enc
return
end
normalized_to_enc = to_enc.downcase.gsub(/-/, '_')
from_enc ||= 'utf-8'
... |
github | ruby/rss | https://github.com/ruby/rss | lib/rss/0.9.rb | Ruby | bsd-2-clause | 204 | master | 10,870 | # frozen_string_literal: false
require_relative "parser"
module RSS
##
# = RSS 0.9 support
#
# RSS has three different versions. This module contains support for version
# 0.9.1[http://www.rssboard.org/rss-0-9-1-netscape].
#
# == Producing RSS 0.9
#
# Producing our own RSS feeds is easy as well. Let... |
github | ruby/rss | https://github.com/ruby/rss | lib/rss/xmlscanner.rb | Ruby | bsd-2-clause | 204 | master | 2,185 | # frozen_string_literal: false
require 'xmlscan/scanner'
require 'stringio'
module RSS
class XMLScanParser < BaseParser
class << self
def listener
XMLScanListener
end
end
private
def _parse
begin
if @rss.is_a?(String)
input = StringIO.new(@rss)
e... |
github | ruby/rss | https://github.com/ruby/rss | lib/rss/2.0.rb | Ruby | bsd-2-clause | 204 | master | 3,510 | # frozen_string_literal: false
require "rss/0.9"
module RSS
##
# = RSS 2.0 support
#
# RSS has three different versions. This module contains support for version
# 2.0[http://www.rssboard.org/rss-specification]
#
# == Producing RSS 2.0
#
# Producing our own RSS feeds is easy as well. Let's make a ve... |
github | ruby/rss | https://github.com/ruby/rss | lib/rss/rss.rb | Ruby | bsd-2-clause | 204 | master | 36,750 | # frozen_string_literal: false
require "English"
require "cgi/escape"
require "time"
class Time
class << self
unless respond_to?(:w3cdtf)
# This method converts a W3CDTF string date/time format to Time object.
#
# The W3CDTF format is defined here: http://www.w3.org/TR/NOTE-datetime
#
... |
github | ruby/rss | https://github.com/ruby/rss | lib/rss/maker.rb | Ruby | bsd-2-clause | 204 | master | 1,889 | # frozen_string_literal: false
require_relative "rss"
module RSS
##
#
# Provides a set of builders for various RSS objects
#
# * Feeds
# * RSS 0.91
# * RSS 1.0
# * RSS 2.0
# * Atom 1.0
#
# * Elements
# * Atom::Entry
module Maker
# Collection of supported makers
MAKERS = {}... |
github | ruby/rss | https://github.com/ruby/rss | lib/rss/taxonomy.rb | Ruby | bsd-2-clause | 204 | master | 3,276 | # frozen_string_literal: false
require "rss/1.0"
require_relative "dublincore"
module RSS
# The prefix for the Taxonomy XML namespace.
TAXO_PREFIX = "taxo"
# The URI for the specification of the Taxonomy XML namespace.
TAXO_URI = "http://purl.org/rss/1.0/modules/taxonomy/"
RDF.install_ns(TAXO_PREFIX, TAXO_U... |
github | ruby/rss | https://github.com/ruby/rss | lib/rss/image.rb | Ruby | bsd-2-clause | 204 | master | 4,913 | # frozen_string_literal: false
require 'rss/1.0'
require_relative 'dublincore'
module RSS
# The prefix for the Image XML namespace.
IMAGE_PREFIX = 'image'
# The URI for the Image specification.
IMAGE_URI = 'http://purl.org/rss/1.0/modules/image/'
RDF.install_ns(IMAGE_PREFIX, IMAGE_URI)
# This constant h... |
github | ruby/rss | https://github.com/ruby/rss | lib/rss/dublincore.rb | Ruby | bsd-2-clause | 204 | master | 4,417 | # frozen_string_literal: false
require_relative "rss"
module RSS
# The prefix for the Dublin Core XML namespace.
DC_PREFIX = 'dc'
# The URI of the Dublin Core specification.
DC_URI = "http://purl.org/dc/elements/1.1/"
module BaseDublinCoreModel
def append_features(klass)
super
return if kla... |
github | ruby/rss | https://github.com/ruby/rss | lib/rss/xmlparser.rb | Ruby | bsd-2-clause | 204 | master | 1,690 | # frozen_string_literal: false
begin
require "xml/parser"
rescue LoadError
require "xmlparser"
end
begin
require "xml/encoding-ja"
rescue LoadError
require "xmlencoding-ja"
if defined?(Kconv)
module XMLEncoding_ja
class SJISHandler
include Kconv
end
end
end
end
module XML
cla... |
github | ruby/rss | https://github.com/ruby/rss | lib/rss/parser.rb | Ruby | bsd-2-clause | 204 | master | 16,576 | # frozen_string_literal: false
require "forwardable"
require "open-uri"
require_relative "rss"
require_relative "xml"
module RSS
class NotWellFormedError < Error
attr_reader :line, :element
# Create a new NotWellFormedError for an error at +line+
# in +element+. If a block is given the return value o... |
github | ruby/rss | https://github.com/ruby/rss | lib/rss/content/2.0.rb | Ruby | bsd-2-clause | 204 | master | 200 | # frozen_string_literal: false
require "rss/2.0"
module RSS
Rss.install_ns(CONTENT_PREFIX, CONTENT_URI)
class Rss
class Channel
class Item; include ContentModel; end
end
end
end |
github | ruby/rss | https://github.com/ruby/rss | lib/rss/dublincore/2.0.rb | Ruby | bsd-2-clause | 204 | master | 223 | # frozen_string_literal: false
require "rss/2.0"
module RSS
Rss.install_ns(DC_PREFIX, DC_URI)
class Rss
class Channel
include DublinCoreModel
class Item; include DublinCoreModel; end
end
end
end |
github | ruby/rss | https://github.com/ruby/rss | lib/rss/dublincore/atom.rb | Ruby | bsd-2-clause | 204 | master | 290 | # frozen_string_literal: false
require_relative "../atom"
module RSS
module Atom
Feed.install_ns(DC_PREFIX, DC_URI)
class Feed
include DublinCoreModel
class Entry; include DublinCoreModel; end
end
class Entry
include DublinCoreModel
end
end
end |
github | ruby/rss | https://github.com/ruby/rss | lib/rss/dublincore/1.0.rb | Ruby | bsd-2-clause | 204 | master | 309 | # frozen_string_literal: false
require "rss/1.0"
module RSS
RDF.install_ns(DC_PREFIX, DC_URI)
class RDF
class Channel; include DublinCoreModel; end
class Image; include DublinCoreModel; end
class Item; include DublinCoreModel; end
class Textinput; include DublinCoreModel; end
end
end |
github | ruby/rss | https://github.com/ruby/rss | lib/rss/maker/syndication.rb | Ruby | bsd-2-clause | 204 | master | 387 | # frozen_string_literal: false
require_relative '../syndication'
require_relative '1.0'
module RSS
module Maker
module SyndicationModel
def self.append_features(klass)
super
::RSS::SyndicationModel::ELEMENTS.each do |name|
klass.def_other_element(name)
end
end
e... |
github | ruby/rss | https://github.com/ruby/rss | lib/rss/maker/slash.rb | Ruby | bsd-2-clause | 204 | master | 773 | # frozen_string_literal: false
require_relative '../slash'
require_relative '1.0'
module RSS
module Maker
module SlashModel
def self.append_features(klass)
super
::RSS::SlashModel::ELEMENT_INFOS.each do |name, type|
full_name = "#{RSS::SLASH_PREFIX}_#{name}"
case type
... |
github | ruby/rss | https://github.com/ruby/rss | lib/rss/maker/feed.rb | Ruby | bsd-2-clause | 204 | master | 12,807 | # frozen_string_literal: false
require_relative "atom"
module RSS
module Maker
module Atom
class Feed < RSSBase
def initialize(feed_version="1.0")
super
@feed_type = "atom"
@feed_subtype = "feed"
end
private
def make_feed
::RSS::Atom:... |
github | ruby/rss | https://github.com/ruby/rss | lib/rss/maker/base.rb | Ruby | bsd-2-clause | 204 | master | 24,675 | # frozen_string_literal: false
require 'forwardable'
require_relative '../rss'
module RSS
module Maker
class Base
extend Utils::InheritedReader
OTHER_ELEMENTS = []
NEED_INITIALIZE_VARIABLES = []
class << self
def other_elements
inherited_array_reader("OTHER_ELEMENTS")... |
github | ruby/rss | https://github.com/ruby/rss | lib/rss/maker/1.0.rb | Ruby | bsd-2-clause | 204 | master | 10,292 | # frozen_string_literal: false
require_relative "../1.0"
require_relative "base"
module RSS
module Maker
class RSS10 < RSSBase
def initialize(feed_version="1.0")
super
@feed_type = "rss"
end
private
def make_feed
RDF.new(@version, @encoding, @standalone)
... |
github | ruby/rss | https://github.com/ruby/rss | lib/rss/maker/itunes.rb | Ruby | bsd-2-clause | 204 | master | 8,010 | # frozen_string_literal: false
require_relative '../itunes'
require_relative '2.0'
module RSS
module Maker
module ITunesBaseModel
def def_class_accessor(klass, name, type, *args)
name = name.gsub(/-/, "_").gsub(/^itunes_/, '')
full_name = "#{RSS::ITUNES_PREFIX}_#{name}"
case type
... |
github | ruby/rss | https://github.com/ruby/rss | lib/rss/maker/content.rb | Ruby | bsd-2-clause | 204 | master | 421 | # frozen_string_literal: false
require_relative '../content'
require_relative '1.0'
require_relative '2.0'
module RSS
module Maker
module ContentModel
def self.append_features(klass)
super
::RSS::ContentModel::ELEMENTS.each do |name|
klass.def_other_element(name)
end
... |
github | ruby/rss | https://github.com/ruby/rss | lib/rss/maker/taxonomy.rb | Ruby | bsd-2-clause | 204 | master | 3,217 | # frozen_string_literal: false
require_relative '../taxonomy'
require_relative '1.0'
require_relative 'dublincore'
module RSS
module Maker
module TaxonomyTopicsModel
def self.append_features(klass)
super
klass.def_classed_element("#{RSS::TAXO_PREFIX}_topics",
... |
github | ruby/rss | https://github.com/ruby/rss | lib/rss/maker/entry.rb | Ruby | bsd-2-clause | 204 | master | 4,848 | # frozen_string_literal: false
require_relative "atom"
require_relative "feed"
module RSS
module Maker
module Atom
class Entry < RSSBase
def initialize(feed_version="1.0")
super
@feed_type = "atom"
@feed_subtype = "entry"
end
private
def make_f... |
github | ruby/rss | https://github.com/ruby/rss | lib/rss/maker/2.0.rb | Ruby | bsd-2-clause | 204 | master | 5,859 | # frozen_string_literal: false
require_relative "../2.0"
require_relative "0.9"
module RSS
module Maker
class RSS20 < RSS09
def initialize(feed_version="2.0")
super
end
class Channel < RSS09::Channel
private
def required_variable_names
%w(link)
end... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.