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
jedcn/reveal-ck
https://github.com/jedcn/reveal-ck
spec/examples/programmatic_slides_spec.rb
Ruby
mit
201
master
266
require 'spec_helper' describe 'examples/programmatic_slides.rb' do it 'prints output from a presentation with several slides' do expect($stdout).to receive :puts expect do load 'examples/programmatic_slides.rb' end.to_not raise_error end end
github
jedcn/reveal-ck
https://github.com/jedcn/reveal-ck
spec/data/presentation_dsl/dsl.rb
Ruby
mit
201
master
310
presentation do title 'Presentation Title' author 'Presentation Author' theme 'night' transition 'page' revealjs_config 'autoSlide', 5000 slide 'text', content: 'Hello World' slide 'code', content: contents_of('lib/reveal-ck.rb') slide 'text', content: 'Thanks!' end
github
jedcn/reveal-ck
https://github.com/jedcn/reveal-ck
spec/lib/reveal-ck_spec.rb
Ruby
mit
201
master
745
require 'spec_helper' describe RevealCK do describe '.path' do it 'provides the location of any file stored within the gem' do index_html_erb = RevealCK.path('files', 'reveal-ck', 'templates', 'index.html', 'ind...
github
jedcn/reveal-ck
https://github.com/jedcn/reveal-ck
spec/lib/html/pipeline/reveal_ck_emoji_filter_spec.rb
Ruby
mit
201
master
757
require 'spec_helper' module HTML class Pipeline describe RevealCKEmojiFilter do let :emoji_filter do doc = nil context = { asset_root: 'asset_root' } RevealCKEmojiFilter.new doc, context end it 'works with defined emoji' do expected = "I <img ...
github
jedcn/reveal-ck
https://github.com/jedcn/reveal-ck
spec/lib/reveal-ck/config_spec.rb
Ruby
mit
201
master
3,184
require 'spec_helper' module RevealCK describe Config do let :config do Config.new end describe 'core attributes' do it 'supplies a default theme (black)' do expect(config.theme).to eq 'black' end it 'supplies an #theme, and #theme=' do config.theme = 'night' ...
github
jedcn/reveal-ck
https://github.com/jedcn/reveal-ck
spec/lib/reveal-ck/presentation_dsl_spec.rb
Ruby
mit
201
master
1,488
require 'spec_helper' module RevealCK describe PresentationDSL do let :config do Config.new end let :dsl_file do spec_data 'presentation_dsl', 'dsl.rb' end let :presentation do PresentationDSL.load file: dsl_file, config: config end describe '.load' do it 'can b...
github
jedcn/reveal-ck
https://github.com/jedcn/reveal-ck
spec/lib/reveal-ck/slide_spec.rb
Ruby
mit
201
master
507
require 'spec_helper' module RevealCK describe Slide do let :intro_slide do Slide.new template: 'intro', title: 'Reveal.js', subtitle: 'HTML Presentations Made Easy', author: 'Hakim El Hattab', site: 'http://hakim.se', twitter:...
github
jedcn/reveal-ck
https://github.com/jedcn/reveal-ck
spec/lib/reveal-ck/presentation_spec.rb
Ruby
mit
201
master
2,284
require 'spec_helper' module RevealCK describe Presentation do let :config do Config.new end let :presentation do presentation = Presentation.new config: config presentation.add double('content', html: 'first') presentation.add double('content', html: 'second') presentation...
github
jedcn/reveal-ck
https://github.com/jedcn/reveal-ck
spec/lib/reveal-ck/commands/thread_waker_spec.rb
Ruby
mit
201
master
511
require 'spec_helper' module RevealCK module Commands describe ThreadWaker do describe '#run' do it 'wakes up an associated thread periodically' do signal = false signal_changer = Thread.new do # This sleep will be infinite unless someone wakes it up.. sl...
github
jedcn/reveal-ck
https://github.com/jedcn/reveal-ck
spec/lib/reveal-ck/commands/listen_to_reload_browser_spec.rb
Ruby
mit
201
master
998
require 'spec_helper' require 'guard' module RevealCK module Commands describe ListenToReloadBrowser do describe '#run' do it 'works with Guard to setup livereload' do serve_ui = double expect(serve_ui) .to(receive(:prefix_for)) .and_return('[prefix]') ...
github
jedcn/reveal-ck
https://github.com/jedcn/reveal-ck
spec/lib/reveal-ck/commands/start_web_server_spec.rb
Ruby
mit
201
master
540
require 'spec_helper' require 'tmpdir' module RevealCK module Commands describe StartWebServer do describe '#run' do it 'works with Rack to start an application' do start_web_server = StartWebServer.new('doc_root', 'port', 'host') rack_server = double expec...
github
jedcn/reveal-ck
https://github.com/jedcn/reveal-ck
spec/lib/reveal-ck/commands/serve_spec.rb
Ruby
mit
201
master
2,263
require 'spec_helper' require 'tmpdir' def build_serve RevealCK::Commands::Serve .new(doc_root: 'doc_root', port: 'port', host: 'host', user_dir: 'user_dir', gem_dir: 'gem_dir', output_dir: 'output_dir', slides_file: 'slides_file') end def expect_new_and_run...
github
jedcn/reveal-ck
https://github.com/jedcn/reveal-ck
spec/lib/reveal-ck/commands/generate_spec.rb
Ruby
mit
201
master
814
require 'spec_helper' module RevealCK module Commands describe Generate do describe '#run' do it 'generates a new set of slides' do slides_builder = double allow(RevealCK::Builders::SlidesBuilder) .to receive(:new) .and_return(slides_builder) e...
github
jedcn/reveal-ck
https://github.com/jedcn/reveal-ck
spec/lib/reveal-ck/commands/print_banner_spec.rb
Ruby
mit
201
master
565
require 'spec_helper' module RevealCK module Commands describe PrintBanner do describe '#run' do it 'sends #messages and #separators to the ui' do serve_ui = double expect(serve_ui) .to(receive(:separator)) .at_least :once expect(serve_ui) ...
github
jedcn/reveal-ck
https://github.com/jedcn/reveal-ck
spec/lib/reveal-ck/commands/serve_ui_spec.rb
Ruby
mit
201
master
1,597
require 'spec_helper' module RevealCK module Commands describe ServeUI do let :serve_ui do ServeUI.new end let :separator do '------------------------------------------------------------' end let :default_prefix do '[ reveal-ck ]' end let :prob...
github
jedcn/reveal-ck
https://github.com/jedcn/reveal-ck
spec/lib/reveal-ck/commands/listen_to_rebuild_slides_spec.rb
Ruby
mit
201
master
731
require 'spec_helper' require 'listen' module RevealCK module Commands describe ListenToRebuildSlides do describe '#run' do let :current_directory do '.' end let :slides_file_regex do /^slides.md$/ end it 'sets up ::Listen to run when things cha...
github
jedcn/reveal-ck
https://github.com/jedcn/reveal-ck
spec/lib/reveal-ck/templates/finder_spec.rb
Ruby
mit
201
master
2,680
require 'spec_helper' require 'tmpdir' require 'fileutils' module RevealCK module Templates describe Finder do let :reveal_ck_dir do Dir.pwd end describe '#paths' do it 'defaults to Dir.pwd/templates and reveal-ck\'s slide templates' do Dir.mktmpdir do |dir| ...
github
jedcn/reveal-ck
https://github.com/jedcn/reveal-ck
spec/lib/reveal-ck/templates/processor_spec.rb
Ruby
mit
201
master
799
require 'spec_helper' module RevealCK module Templates describe Processor do let :config do Config.new end let :slim_file do spec_data 'templates', 'processor', 'basic.slim' end let :haml_file do spec_data 'templates', 'processor', 'basic.haml' end ...
github
jedcn/reveal-ck
https://github.com/jedcn/reveal-ck
spec/lib/reveal-ck/misc/remove_extension_spec.rb
Ruby
mit
201
master
533
require 'spec_helper' module RevealCK module Misc describe RemoveExtension do describe 'remove_extension' do class Sample include RemoveExtension end let :sample do Sample.new end it 'removes a file extension' do result = sample.remove...
github
jedcn/reveal-ck
https://github.com/jedcn/reveal-ck
spec/lib/reveal-ck/render/scope_spec.rb
Ruby
mit
201
master
942
require 'spec_helper' module RevealCK module Render describe Scope do describe '#contents_of' do let :quote_file do spec_data 'render', 'scope', 'quote' end let :scope do Scope.new(dir: Dir.pwd, config: {}) end it 'provides access to a file on t...
github
jedcn/reveal-ck
https://github.com/jedcn/reveal-ck
spec/lib/reveal-ck/builders/reveal_js_files_spec.rb
Ruby
mit
201
master
758
require 'spec_helper' module RevealCK module Builders describe RevealJsFiles do describe '#all' do let :dir do File.join(Dir.pwd, 'reveal.js') end let :reveal_js_files do RevealJsFiles.new(dir: dir) end describe '#files' do it 'it name...
github
jedcn/reveal-ck
https://github.com/jedcn/reveal-ck
spec/lib/reveal-ck/builders/create_slides_html_spec.rb
Ruby
mit
201
master
2,850
require 'spec_helper' require 'tmpdir' require 'rake' module RevealCK module Builders describe CreateSlidesHtml do it 'creates a transformed slides file' do Dir.mktmpdir do |dir| Dir.chdir(dir) do slides_file_initial = 'slides-initial.md' File.open(slides_file_init...
github
jedcn/reveal-ck
https://github.com/jedcn/reveal-ck
spec/lib/reveal-ck/builders/slides_builder_spec.rb
Ruby
mit
201
master
2,262
require 'spec_helper' require 'tmpdir' module RevealCK module Builders describe SlidesBuilder do it 'creates a reveal.js presentation' do Dir.mktmpdir do |dir| Dir.chdir(dir) do slides_file = 'slides.md' File.open(slides_file, 'w') do |file| file.puts...
github
jedcn/reveal-ck
https://github.com/jedcn/reveal-ck
spec/lib/reveal-ck/builders/create_index_html_spec.rb
Ruby
mit
201
master
1,266
require 'spec_helper' require 'tmpdir' require 'rake' module RevealCK module Builders describe CreateIndexHtml do it 'creates a reveal.js index.html' do Dir.mktmpdir do |dir| Dir.chdir(dir) do slides_html = 'slides.html' File.open(slides_html, 'w') do |file| ...
github
jedcn/reveal-ck
https://github.com/jedcn/reveal-ck
spec/lib/reveal-ck/builders/creation_task_spec.rb
Ruby
mit
201
master
2,276
require 'spec_helper' module RevealCK module Builders class CreationTaskTestingClass < CreationTask attr_reader :setup_called def initialize(args) @setup_called = false super end def setup @setup_called = true things_to_create << 'foo' things_to_cr...
github
jedcn/reveal-ck
https://github.com/jedcn/reveal-ck
spec/lib/reveal-ck/builders/index_html_spec.rb
Ruby
mit
201
master
2,337
require 'spec_helper' module RevealCK module Builders describe IndexHtml do let(:version) { RevealCK::VERSION } let :index_html_erb do RevealCK.template_path('index.html', 'index.html.erb') end let :slides_html do spec_data('builders', 'inde...
github
jedcn/reveal-ck
https://github.com/jedcn/reveal-ck
spec/lib/reveal-ck/builders/user_files_spec.rb
Ruby
mit
201
master
816
require 'spec_helper' module RevealCK module Builders describe UserFiles do describe '#all' do let :stand_in_user_files_dir do File.join(Dir.pwd, 'files', 'reveal.js') end let :user_files do UserFiles.new(dir: stand_in_user_files_dir) end descri...
github
jedcn/reveal-ck
https://github.com/jedcn/reveal-ck
spec/lib/reveal-ck/builders/copy_files_task_spec.rb
Ruby
mit
201
master
2,392
require 'spec_helper' module RevealCK module Builders describe CopyFilesTask do let :source_dir do 'source' end let :file_a_source do "#{source_dir}/file_a" end let :file_b_source do "#{source_dir}/file_b" end let :file_listing do file_...
github
jedcn/reveal-ck
https://github.com/jedcn/reveal-ck
spec/lib/reveal-ck/builders/rake_aware_spec.rb
Ruby
mit
201
master
1,768
require 'spec_helper' require 'tmpdir' module RevealCK module Builders class RakeAwareTestingClass include RakeAware attr_reader :application def initialize @application = Rake::Application.new end end describe RakeAware do describe 'when included into a class with ...
github
jedcn/reveal-ck
https://github.com/jedcn/reveal-ck
spec/lib/reveal-ck/markdown/pre_processor_spec.rb
Ruby
mit
201
master
8,302
require 'spec_helper' module RevealCK module Markdown describe PreProcessor do describe 'handling ```notes' do let :notes_input do <<-SLIDES.strip_heredoc ```notes This is a note ``` SLIDES end let :note_input do <<-SLIDES...
github
jedcn/reveal-ck
https://github.com/jedcn/reveal-ck
spec/lib/reveal-ck/markdown/post_processor_spec.rb
Ruby
mit
201
master
7,198
require 'spec_helper' module RevealCK module Markdown describe PostProcessor do it 'unprotects emojis' do input = ':moneyEUwithEUwings:' output = PostProcessor.new(input).process expect(output).to include ':money_with_wings:' input = ':blueEUheart:' output = PostPro...
github
jedcn/reveal-ck
https://github.com/jedcn/reveal-ck
spec/lib/reveal-ck/markdown/slide_markdown_template_spec.rb
Ruby
mit
201
master
2,584
require 'spec_helper' require 'tempfile' module RevealCK module Markdown describe SlideMarkdownTemplate do def render_markdown(markdown) tmp_file = Tempfile.new(['test', '.md']) File.open(tmp_file, 'w') do |test_md| test_md.puts(markdown) end template = Tilt.new(tm...
github
jedcn/reveal-ck
https://github.com/jedcn/reveal-ck
rakelib/cucumber.rake
Ruby
mit
201
master
373
require 'cucumber' require 'cucumber/rake/task' require 'rake/clean' CUKE_RESULTS = 'cucumber_results.html'.freeze CLEAN << CUKE_RESULTS desc 'Run Cucumber' Cucumber::Rake::Task.new(:cucumber) do |t| opts = "features --format html -o #{CUKE_RESULTS} --format progress -x" opts += " --tags #{ENV['TAGS']}" if ENV['...
github
jedcn/reveal-ck
https://github.com/jedcn/reveal-ck
rakelib/relish.rake
Ruby
mit
201
master
530
namespace :relish do def run(cmd) require 'open3' puts "Running '#{cmd}'" Open3.popen3(cmd) do |_, o, e, _| puts 'STDOUT:' puts o.readlines puts puts 'STDERR:' puts e.readlines end end desc 'Publish to relish' task :push do run 'relish push jedcn/reveal-ck' e...
github
jedcn/reveal-ck
https://github.com/jedcn/reveal-ck
rakelib/prepare_release.rake
Ruby
mit
201
master
2,300
def change_file(filepath, regex, regex_replacement) current_content = File.open(filepath).read new_content = current_content.gsub(regex, regex_replacement) IO.write(filepath, new_content) end def update_version_rb(new_version) change_file('lib/reveal-ck/version.rb', /^ VERSION = '.*'\.freeze$/, ...
github
jedcn/reveal-ck
https://github.com/jedcn/reveal-ck
features/support/file_management.rb
Ruby
mit
201
master
581
# Absolute path of reveal-ck/features def features_dir File.expand_path(File.join(File.dirname(__FILE__), '..')) end # Support for easily copying any file underneath features to a new # location. Presumed to be helpful for copying around test data stored # at reveal-ck/features/data. def copy_file_under_features(rel...
github
jedcn/reveal-ck
https://github.com/jedcn/reveal-ck
features/step_definitions/serve_steps.rb
Ruby
mit
201
master
218
When(/^I temporarily start reveal\-ck serve with host "(.*?)"$/) do |host| port = rand(10_000..11_000) cmd = "reveal-ck serve --port #{port} --host #{host}" run_command("#{cmd} --test-quit-after-starting 2") end
github
jedcn/reveal-ck
https://github.com/jedcn/reveal-ck
features/step_definitions/html_match_steps.rb
Ruby
mit
201
master
787
require 'nokogiri' def check_html_matches(file, selector_list, selector_type) content = IO.read(expand_path(file)) doc = Nokogiri::HTML(content) selector_list.each do |selector, description| check_doc_matches(doc, selector, description, selector_type) end end def check_doc_matches(doc, selector, descripti...
github
jedcn/reveal-ck
https://github.com/jedcn/reveal-ck
lib/reveal-ck.rb
Ruby
mit
201
master
1,217
# The following require adds "#to_json" to Hash. This is needed in # script.js.erb. We do it here to provide as much clarity as is # possible. require 'json' require_relative 'reveal-ck/version' require_relative 'reveal-ck/config' require_relative 'reveal-ck/retrieve' require_relative 'reveal-ck/filtered_html_string' ...
github
jedcn/reveal-ck
https://github.com/jedcn/reveal-ck
lib/html/pipeline/reveal_ck_emoji_filter.rb
Ruby
mit
201
master
354
module HTML class Pipeline # Very similar to EmojiFilter, but it removes the inline # width/height/align attributes so that reveal-ck supplied CSS # takes effect. class RevealCKEmojiFilter < EmojiFilter def emoji_image_tag(name) "<img class='emoji' alt=':#{name}:' src='#{emoji_url(name)}...
github
jedcn/reveal-ck
https://github.com/jedcn/reveal-ck
lib/reveal-ck/commands.rb
Ruby
mit
201
master
342
require_relative 'commands/generate' require_relative 'commands/thread_waker' require_relative 'commands/print_banner' require_relative 'commands/listen_to_rebuild_slides' require_relative 'commands/listen_to_reload_browser' require_relative 'commands/start_web_server' require_relative 'commands/serve_ui' require_rela...
github
jedcn/reveal-ck
https://github.com/jedcn/reveal-ck
lib/reveal-ck/config.rb
Ruby
mit
201
master
1,520
require 'ostruct' module RevealCK # A Config represents core configuration options within # reveal-ck. It has defaults. It is mutable. class Config < OpenStruct def initialize super defaults end def merge!(hash) hash.each_pair do |name, value| self[name] = value end end...
github
jedcn/reveal-ck
https://github.com/jedcn/reveal-ck
lib/reveal-ck/filtered_html_string.rb
Ruby
mit
201
master
537
module RevealCK # Enables easy filtering of an HTML string through an html-pipeline. class FilteredHtmlString include Retrieve attr_reader :html, :pipeline, :config def initialize(args) @html = retrieve(:html, args) @pipeline = retrieve(:pipeline, args) @config = retrieve(:config, arg...
github
jedcn/reveal-ck
https://github.com/jedcn/reveal-ck
lib/reveal-ck/markdown.rb
Ruby
mit
201
master
866
module RevealCK # This module defines how reveal-ck works with kramdown to produce # slides from markdown. module Markdown REVEALCK_SYMBOL_FOR_DIVIDER = '<div>DIVIDER</div>'.freeze REVEALCK_SYMBOL_FOR_NOTES_OPEN = '<div>NOTES_OPEN</div>'.freeze REVEALCK_SYMBOL_FOR_NOTES_CLOSE = '<d...
github
jedcn/reveal-ck
https://github.com/jedcn/reveal-ck
lib/reveal-ck/presentation_dsl.rb
Ruby
mit
201
master
1,580
module RevealCK # # Public: A PresentationDSL defines the DSL behind a # presentation. It also knows how to load file containing the DSL. # class PresentationDSL include Retrieve attr_reader :config def initialize(args) @slides = [] @config = retrieve(:config, args) end def t...
github
jedcn/reveal-ck
https://github.com/jedcn/reveal-ck
lib/reveal-ck/rake_task.rb
Ruby
mit
201
master
1,645
require 'rake' require 'rake/tasklib' require 'reveal-ck' module RevealCK # Generate a reveal.js presentation class RakeTask < Rake::TaskLib include ::Rake::DSL if defined?(::Rake::DSL) # Name of task. # # default: # :reveal attr_accessor :name # File containing slide content. #...
github
jedcn/reveal-ck
https://github.com/jedcn/reveal-ck
lib/reveal-ck/retrieve.rb
Ruby
mit
201
master
256
module RevealCK # Retrieve the value of a symbol from a hash or fail module Retrieve def retrieve(symbol, hash) hash[symbol] || raise("#{symbol} is required") end def self.included(base) base.extend(Retrieve) end end end
github
jedcn/reveal-ck
https://github.com/jedcn/reveal-ck
lib/reveal-ck/presentation.rb
Ruby
mit
201
master
1,373
require 'forwardable' module RevealCK # # Public: A Presentation is slide html and metadata. Access html via # #html. Access metadata via theme, title, author, transition. # class Presentation include Retrieve extend Forwardable %i[author title transition theme].each do |name| def_delegator...
github
jedcn/reveal-ck
https://github.com/jedcn/reveal-ck
lib/reveal-ck/render.rb
Ruby
mit
201
master
223
require_relative 'render/contents_of' require_relative 'render/css_files' require_relative 'render/js_files' require_relative 'render/plugin_files' require_relative 'render/index_html_maker' require_relative 'render/scope'
github
jedcn/reveal-ck
https://github.com/jedcn/reveal-ck
lib/reveal-ck/slide.rb
Ruby
mit
201
master
510
module RevealCK # # Public: A Slide produces HTML output to be included in a # presentation. Presently, this output is based upon a template. # class Slide include Retrieve def initialize(args) template = retrieve(:template, args) config = args[:config] || {} file = Templates::Finder...
github
jedcn/reveal-ck
https://github.com/jedcn/reveal-ck
lib/reveal-ck/builders.rb
Ruby
mit
201
master
427
require_relative 'builders/rake_aware' require_relative 'builders/creation_task' require_relative 'builders/copy_files_task' require_relative 'builders/slides_builder' require_relative 'builders/reveal_js_files' require_relative 'builders/reveal_ck_files' require_relative 'builders/create_slides_html' require_relative ...
github
jedcn/reveal-ck
https://github.com/jedcn/reveal-ck
lib/reveal-ck/templates/finder.rb
Ruby
mit
201
master
980
module RevealCK module Templates # # Public: This class is home to a simple algorithm for looking up # files in a series of directories. Directory order matters, and the # first match for the file will be returned. It'll raise if it can't # find the file you've asked for. # class Finder ...
github
jedcn/reveal-ck
https://github.com/jedcn/reveal-ck
lib/reveal-ck/templates/processor.rb
Ruby
mit
201
master
759
# # Setup Slim require 'slim' ::Slim::Engine.set_options pretty: true require 'tilt' module RevealCK module Templates # Public: A Processor is given a template and expected to render # it. class Processor include Retrieve attr_reader :config def initialize(args) @config = ret...
github
jedcn/reveal-ck
https://github.com/jedcn/reveal-ck
lib/reveal-ck/markdown/slide_markdown_template.rb
Ruby
mit
201
master
882
require 'tilt/template' require 'kramdown' module RevealCK module Markdown # # Public: This class allows Kramdown to hook into Tilt 2.0. See # https://github.com/rtomayko/tilt. # class SlideMarkdownTemplate < ::Tilt::Template # Must be implemented by all subclasses of Tilt::Template d...
github
jedcn/reveal-ck
https://github.com/jedcn/reveal-ck
lib/reveal-ck/markdown/pre_processor_for_dividers.rb
Ruby
mit
201
master
1,318
module RevealCK module Markdown # This class embodies the preprocessing that starts with a # traditional Markdown document and turns it into something that # can later "become" reveal.js slides. class PreProcessorForDividers attr_reader :doc def initialize(doc) @doc = doc end...
github
jedcn/reveal-ck
https://github.com/jedcn/reveal-ck
lib/reveal-ck/markdown/pre_processor_for_emoji.rb
Ruby
mit
201
master
675
module RevealCK module Markdown # This class knows how to modify emoji so that underscores within # emoji are not considered as indicators of markdown emphasis. class PreProcessorForEmoji attr_reader :doc def initialize(doc) @doc = doc end def process protect_emoji...
github
jedcn/reveal-ck
https://github.com/jedcn/reveal-ck
lib/reveal-ck/markdown/post_processor.rb
Ruby
mit
201
master
3,361
module RevealCK module Markdown # This class embodies the preprocessing that starts with an HTML # document generated via Markdown and results in HTML that's # suitable for reveal.js slides. class PostProcessor attr_reader :doc def initialize(doc) @doc = doc end def pr...
github
jedcn/reveal-ck
https://github.com/jedcn/reveal-ck
lib/reveal-ck/markdown/pre_processor_transforms.rb
Ruby
mit
201
master
2,871
module RevealCK module Markdown # This class gives special meaning to legitimate markdown within # slides. This "slides markdown" is transformed into symbols that # are not markdown. Later on these will be transformed into HTML # meanings. # # For example, # # * --- becomes <div>DIVIDE...
github
jedcn/reveal-ck
https://github.com/jedcn/reveal-ck
lib/reveal-ck/markdown/pre_processor.rb
Ruby
mit
201
master
616
module RevealCK module Markdown # This class embodies the preprocessing that starts with a # traditional Markdown document and turns it into something that # can later "become" reveal.js slides. class PreProcessor attr_reader :doc def initialize(doc) @doc = doc end def...
github
jedcn/reveal-ck
https://github.com/jedcn/reveal-ck
lib/reveal-ck/builders/creation_task.rb
Ruby
mit
201
master
854
module RevealCK module Builders # Works within the context of Rake to setup a task for a given # name class CreationTask include Retrieve include RakeAware attr_reader :application, :things_to_create def initialize(args) @application = retrieve(:application, args) ...
github
jedcn/reveal-ck
https://github.com/jedcn/reveal-ck
lib/reveal-ck/builders/rake_aware.rb
Ruby
mit
201
master
686
require 'rake' module RevealCK module Builders # Classes including this module reference a Rake application, and # know how to add tasks to it. They also know how to use it to # copy files and create directories. module RakeAware def task(*args, &block) application.define_task(Rake::Tas...
github
jedcn/reveal-ck
https://github.com/jedcn/reveal-ck
lib/reveal-ck/builders/reveal_ck_files.rb
Ruby
mit
201
master
372
require 'rake' module RevealCK module Builders # This class knows which files from reveal-ck are vital to the # presentation. class RevealCkFiles include Retrieve attr_reader :dir def initialize(args) @dir = retrieve(:dir, args) end def files FileList["#{d...
github
jedcn/reveal-ck
https://github.com/jedcn/reveal-ck
lib/reveal-ck/builders/create_index_html.rb
Ruby
mit
201
master
1,127
require 'rake' module RevealCK module Builders # Given a slides.html, a Rake application, a template for building # out a reveal.js index.html, and a place where the resulting # index.html file should end up, this class knows how to work with # Rake and create the index.html. class CreateIndexHtm...
github
jedcn/reveal-ck
https://github.com/jedcn/reveal-ck
lib/reveal-ck/builders/create_slides_html.rb
Ruby
mit
201
master
1,912
require 'html/pipeline' require 'html/pipeline/reveal_ck_emoji_filter' module RevealCK module Builders # Given a slides_file, a Rake application, and a place where the # transformed slides file should end up, this class knows how to # work with Rake and create the slides.html. class CreateSlidesHtml ...
github
jedcn/reveal-ck
https://github.com/jedcn/reveal-ck
lib/reveal-ck/builders/reveal_js_files.rb
Ruby
mit
201
master
1,183
require 'rake' module RevealCK module Builders # Given a copy of reveal.js, this class knows which files are # vital to the presentation. class RevealJsFiles include Retrieve attr_reader :dir def initialize(args) @dir = retrieve(:dir, args) end def files [...
github
jedcn/reveal-ck
https://github.com/jedcn/reveal-ck
lib/reveal-ck/builders/slides_builder.rb
Ruby
mit
201
master
2,923
require 'rake' require 'yaml' module RevealCK module Builders # Given a location of reveal.js files, reveal-ck files, and slides # file to work with, and a place to put it all.. this class # creates a presentation. class SlidesBuilder < CreationTask attr_reader :user_dir, :gem_dir, :reveal_js_d...
github
jedcn/reveal-ck
https://github.com/jedcn/reveal-ck
lib/reveal-ck/builders/index_html.rb
Ruby
mit
201
master
729
require 'tilt' module RevealCK module Builders # # Public: An IndexHtml knows how to build the index.html file (the # core slides) within a reveal.js presentation. # class IndexHtml include Retrieve attr_reader :template, :slides_html, :config def initialize(args) @tem...
github
jedcn/reveal-ck
https://github.com/jedcn/reveal-ck
lib/reveal-ck/builders/copy_files_task.rb
Ruby
mit
201
master
820
module RevealCK module Builders # Copy a listing of files from one location to another class CopyFilesTask < CreationTask attr_reader :file_listing, :output_dir def initialize(args) @file_listing = retrieve(:file_listing, args) @output_dir = retrieve(:output_dir, args) sup...
github
jedcn/reveal-ck
https://github.com/jedcn/reveal-ck
lib/reveal-ck/builders/user_files.rb
Ruby
mit
201
master
799
require 'rake' module RevealCK module Builders # Given a location to a user's files, this class knows which files # should be included. class UserFiles include Retrieve attr_reader :dir def initialize(args) @dir = retrieve(:dir, args) end def files [] ...
github
jedcn/reveal-ck
https://github.com/jedcn/reveal-ck
lib/reveal-ck/tilt/config.rb
Ruby
mit
201
master
344
# Direct Tilt to use SlideMarkdownTemplate for "md" files Tilt.register RevealCK::Markdown::SlideMarkdownTemplate, 'md' # The following requires are present to avoid warnings such as: # # WARN: tilt autoloading 'tilt/erb' in a non thread-safe way; explicit # require 'tilt/erb' suggested. # # The same goes for tilt/ham...
github
jedcn/reveal-ck
https://github.com/jedcn/reveal-ck
lib/reveal-ck/misc/remove_extension.rb
Ruby
mit
201
master
219
module RevealCK module Misc # Knows how to remove an extension from a filename module RemoveExtension def remove_extension(file_name) file_name.sub(%r{\.[^/]*\z}, '') end end end end
github
jedcn/reveal-ck
https://github.com/jedcn/reveal-ck
lib/reveal-ck/commands/listen_to_rebuild_slides.rb
Ruby
mit
201
master
1,006
require 'listen' module RevealCK module Commands # The idea of listening for file system changes and then # rebuilding slides. class ListenToRebuildSlides attr_reader :ui, :rebuild_method def initialize(ui, slides_file, &block) @ui = ui @slides_file = slides_file @rebu...
github
jedcn/reveal-ck
https://github.com/jedcn/reveal-ck
lib/reveal-ck/commands/serve_ui.rb
Ruby
mit
201
master
945
module RevealCK module Commands # This object represents controls the "User Interface" of the # serve command. class ServeUI PREFIXES = { default: '[ reveal-ck ]', problem: '[ problem ]', rebuild: '[ rebuild ]', reload: '[ reload ]' }.freeze def pr...
github
jedcn/reveal-ck
https://github.com/jedcn/reveal-ck
lib/reveal-ck/commands/generate.rb
Ruby
mit
201
master
1,064
module RevealCK module Commands # This Command is responsible for implementing the idea behind # "reveal-ck generate." class Generate include Retrieve attr_reader :slides_builder, :slides_file, :stdout_prefix def initialize(args) user_dir = retrieve(:user_dir, args) gem_d...
github
jedcn/reveal-ck
https://github.com/jedcn/reveal-ck
lib/reveal-ck/commands/print_banner.rb
Ruby
mit
201
master
742
module RevealCK module Commands # The idea of displaying a banner via an injected ui. Messages # sent explain everything to do with the serve command (listening, # reloading, and webserving) class PrintBanner attr_reader :doc_root, :port, :host, :slides_file, :ui def initialize(doc_root, p...
github
jedcn/reveal-ck
https://github.com/jedcn/reveal-ck
lib/reveal-ck/commands/serve.rb
Ruby
mit
201
master
1,900
module RevealCK module Commands # This Command is responsible for implementing the idea behind # "reveal-ck serve." # # This includes taking an action and managing stdout class Serve include Retrieve attr_reader :doc_root, :port, :host attr_reader :slides_file, :user_dir, :gem_di...
github
jedcn/reveal-ck
https://github.com/jedcn/reveal-ck
lib/reveal-ck/commands/thread_waker.rb
Ruby
mit
201
master
447
module RevealCK module Commands # Utility that wakes up a thread periodically class ThreadWaker def initialize(thread_to_wake, wait_period = 1) @thread_to_wake = thread_to_wake @wait_period = wait_period end def run Thread.new do loop do sleep @...
github
jedcn/reveal-ck
https://github.com/jedcn/reveal-ck
lib/reveal-ck/commands/start_web_server.rb
Ruby
mit
201
master
1,321
require 'rack' require 'webrick' require 'rack/livereload' module RevealCK module Commands # The idea of starting up a webserver to display slides locally. class StartWebServer attr_reader :doc_root, :port, :host def initialize(doc_root, port, host) @doc_root = doc_root @port = po...
github
jedcn/reveal-ck
https://github.com/jedcn/reveal-ck
lib/reveal-ck/commands/listen_to_reload_browser.rb
Ruby
mit
201
master
1,177
module RevealCK module Commands # The idea of listening for file system changes that indicate its # time to tell browsers to reload. class ListenToReloadBrowser attr_reader :prefix def initialize(ui, output_dir) @prefix = ui.prefix_for(:reload) @output_dir = output_dir e...
github
jedcn/reveal-ck
https://github.com/jedcn/reveal-ck
lib/reveal-ck/render/index_html_maker.rb
Ruby
mit
201
master
901
require 'tilt' module RevealCK module Render # An IndexHtml is made by composed head, body, and script. module IndexHtmlMaker def head head_html_erb = RevealCK.template_path('index.html', 'head.html.erb') template = Tilt.new(head_html_erb) ...
github
jedcn/reveal-ck
https://github.com/jedcn/reveal-ck
lib/reveal-ck/render/css_files.rb
Ruby
mit
201
master
402
module RevealCK module Render # Determine which .css files are underneath a @dir module CssFiles def css_files things_in_css_dir = FileList["#{@dir}/css/**/*"] only_css_files = things_in_css_dir.grep(/\.css$/) relative_css_files = only_css_files.map do |file| file.sub("...
github
jedcn/reveal-ck
https://github.com/jedcn/reveal-ck
lib/reveal-ck/render/js_files.rb
Ruby
mit
201
master
391
module RevealCK module Render # Determine which .js files are underneath a @dir module JsFiles def js_files things_in_js_dir = FileList["#{@dir}/js/**/*"] only_js_files = things_in_js_dir.grep(/\.js$/) relative_js_files = only_js_files.map do |file| file.sub("#{@dir}/",...
github
jedcn/reveal-ck
https://github.com/jedcn/reveal-ck
lib/reveal-ck/render/scope.rb
Ruby
mit
201
master
414
module RevealCK module Render # A Scope provides methods available at render time. class Scope include Retrieve include ContentsOf include CssFiles include JsFiles include PluginFiles include IndexHtmlMaker attr_reader :config def initialize(args) @dir...
github
jedcn/reveal-ck
https://github.com/jedcn/reveal-ck
lib/reveal-ck/render/plugin_files.rb
Ruby
mit
201
master
418
module RevealCK module Render # Determine which js files are in the plugin dir module PluginFiles def plugin_files things_in_plugin_dir = FileList["#{@dir}/plugin/**/*"] only_js_files = things_in_plugin_dir.grep(/\.js$/) relative_plugin_files = only_js_files.map do |file| ...
github
spilliton/randumb
https://github.com/spilliton/randumb
randumb.gemspec
Ruby
mit
201
master
1,324
# -*- encoding: utf-8 -*- $:.push File.expand_path("../lib", __FILE__) require "randumb/version" Gem::Specification.new do |s| s.name = "randumb" s.license = 'MIT' s.version = Randumb::VERSION s.platform = Gem::Platform::RUBY s.authors = ["Zachary Kloepping"] s.homepage = "https://...
github
spilliton/randumb
https://github.com/spilliton/randumb
Rakefile
Ruby
mit
201
master
238
# encoding: UTF-8 require 'bundler' Bundler::GemHelper.install_tasks require 'rake' require 'rake/testtask' task :default => [:test] desc "Run unit tests." task :test do ruby "test/randumb_test.rb" ruby "test/weighted_test.rb" end
github
spilliton/randumb
https://github.com/spilliton/randumb
lib/randumb.rb
Ruby
mit
201
master
340
require 'randumb/version' require 'randumb/syntax' require 'randumb/relation' # Mix it in class ActiveRecord::Relation include Randumb::ActiveRecord::Relation include Randumb::ActiveRecord::MethodMissingMagicks end class ActiveRecord::Base extend Randumb::ActiveRecord::Base extend Randumb::ActiveRecord::Metho...
github
spilliton/randumb
https://github.com/spilliton/randumb
lib/randumb/syntax.rb
Ruby
mit
201
master
2,891
module Randumb class Syntax class << self # builds the order clause to be appended in where clause def random_order_clause(opts={}) random_for(opts) end # builds the order clause to be appended in where clause def random_weighted_order_clause(ranking_column, opts={}) ...
github
spilliton/randumb
https://github.com/spilliton/randumb
lib/randumb/relation.rb
Ruby
mit
201
master
7,966
require 'active_support/core_ext/module/delegation' require 'active_record/relation' module Randumb # https://github.com/rails/rails/blob/master/activerecord/lib/active_record/relation/query_methods.rb module ActiveRecord module Relation # If the max_items argument is omitted, one random entity will be...
github
spilliton/randumb
https://github.com/spilliton/randumb
test/weighted_test.rb
Ruby
mit
201
master
4,716
$:.unshift '.'; require File.dirname(__FILE__) + '/test_helper' class WeightedTest < Minitest::Test should "raise exception when called with a non-existent column" do assert_raises(ArgumentError) do Artist.order_by_rand_weighted(:blah) end assert_raises(ArgumentError) do Artist.random_weight...
github
spilliton/randumb
https://github.com/spilliton/randumb
test/randumb_test.rb
Ruby
mit
201
master
9,681
$:.unshift '.'; require File.dirname(__FILE__) + '/test_helper' class RandumbTest < Minitest::Test def assert_equal_for_both_methods(expected, obj, *params) if expected.nil? assert_nil obj.send(:random, *params), "when calling random" assert_nil obj.send(:random_by_id_shuffle, *params), "when callin...
github
spilliton/randumb
https://github.com/spilliton/randumb
test/test_helper.rb
Ruby
mit
201
master
1,708
$LOAD_PATH << File.join(File.dirname(__FILE__), '..', 'lib') require 'rubygems' require "minitest/autorun" require 'shoulda' require 'factory_bot' require 'faker' require 'active_record' require 'active_support/dependencies' require 'randumb' MODELS_PATH = File.join(File.dirname(__FILE__), 'models') config = YAML::lo...
github
spilliton/randumb
https://github.com/spilliton/randumb
test/models/artist.rb
Ruby
mit
201
master
322
class Artist < ActiveRecord::Base has_many :albums if Gem::Version.new(ActiveRecord::VERSION::STRING) >= Gem::Version.new("3.2") default_scope { where("artists.deleted_at IS NULL") } else default_scope where("artists.deleted_at IS NULL") end scope :at_least_three_views, -> { where("views >= 3") } en...
github
spilliton/randumb
https://github.com/spilliton/randumb
test/models/factories.rb
Ruby
mit
201
master
268
FactoryBot.define do factory :artist do name { Faker::Lorem.words(3).join(' ') } views { Random.rand(50) } rating { Random.rand(100) / 100 } end factory :album do name { Faker::Lorem.words(3).join(' ') } views { Random.rand(50) } end end
github
whitequark/ast
https://github.com/whitequark/ast
ast.gemspec
Ruby
mit
200
master
811
Gem::Specification.new do |s| s.name = 'ast' s.version = '2.4.3' s.license = 'MIT' s.authors = ["whitequark"] s.email = ["whitequark@whitequark.org"] s.homepage = "https://whitequark.github.io/ast/" s.summary = %q{A library for working with Abstract Syntax Trees.} s.descr...
github
whitequark/ast
https://github.com/whitequark/ast
Rakefile
Ruby
mit
200
master
615
require 'bundler/gem_tasks' require 'bundler/setup' require 'rspec/core' require 'rspec/core/rake_task' task :default => :spec desc "Run test suite" RSpec::Core::RakeTask.new(:spec) do |t| t.verbose = true end PAGES_REPO = 'git@github.com:whitequark/ast' desc "Build and deploy documentation to GitHub pages" task ...
github
whitequark/ast
https://github.com/whitequark/ast
lib/ast.rb
Ruby
mit
200
master
613
# {AST} is a library for manipulating abstract syntax trees. # # It embraces immutability; each AST node is inherently frozen at # creation, and updating a child node requires recreating that node # and its every parent, recursively. # This is a design choice. It does create some pressure on # garbage collector, but co...
github
whitequark/ast
https://github.com/whitequark/ast
lib/ast/node.rb
Ruby
mit
200
master
8,106
# frozen_string_literal: true module AST # Node is an immutable class, instances of which represent abstract # syntax tree nodes. It combines semantic information (i.e. anything # that affects the algorithmic properties of a program) with # meta-information (line numbers or compiler intermediates). # # Not...
github
whitequark/ast
https://github.com/whitequark/ast
lib/ast/sexp.rb
Ruby
mit
200
master
949
module AST # This simple module is very useful in the cases where one needs # to define deeply nested ASTs from Ruby code, for example, in # tests. It should be used like this: # # describe YourLanguage do # include ::AST::Sexp # # it "should correctly parse expressions" do # Y...
github
whitequark/ast
https://github.com/whitequark/ast
lib/ast/processor.rb
Ruby
mit
200
master
399
module AST # This class includes {AST::Processor::Mixin}; however, it is # deprecated, since the module defines all of the behaviors that # the processor includes. Any new libraries should use # {AST::Processor::Mixin} instead of subclassing this. # # @deprecated Use {AST::Processor::Mixin} instead. clas...