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 | DavyJonesLocker/ember-appkit-rails | https://github.com/DavyJonesLocker/ember-appkit-rails | lib/generators/ember/view_generator.rb | Ruby | mit | 238 | master | 698 | require 'generators/ember/generator_helpers'
module Ember
module Generators
class ViewGenerator < ::Rails::Generators::NamedBase
include Ember::Generators::GeneratorHelpers
source_root File.expand_path("../../templates", __FILE__)
desc "Creates a new Ember.js view and associated template."
... |
github | DavyJonesLocker/ember-appkit-rails | https://github.com/DavyJonesLocker/ember-appkit-rails | lib/generators/ember/resource_generator.rb | Ruby | mit | 238 | master | 1,311 | require 'generators/ember/generator_helpers'
module Ember
module Generators
class ResourceGenerator < ::Rails::Generators::NamedBase
include Ember::Generators::GeneratorHelpers
source_root File.expand_path("../../templates", __FILE__)
desc "Creates a new Ember.js router, controller, view and ... |
github | DavyJonesLocker/ember-appkit-rails | https://github.com/DavyJonesLocker/ember-appkit-rails | lib/generators/ember/component_generator.rb | Ruby | mit | 238 | master | 1,009 | require 'generators/ember/generator_helpers'
module Ember
module Generators
class ComponentGenerator < ::Rails::Generators::NamedBase
include Ember::Generators::GeneratorHelpers
source_root File.expand_path("../../templates", __FILE__)
desc "Creates a new Ember.js component and component temp... |
github | DavyJonesLocker/ember-appkit-rails | https://github.com/DavyJonesLocker/ember-appkit-rails | lib/ember/appkit/rails.rb | Ruby | mit | 238 | master | 543 | require 'jquery-rails'
require 'ember/source'
require 'es6_module_transpiler/rails'
require 'active_model_serializers'
require 'sprockets/railtie'
require 'ember/source'
require 'ember/data/source'
require 'handlebars/source'
module Ember
module Appkit
module Rails; end
end
end
require 'ember/appkit/rails/eng... |
github | DavyJonesLocker/ember-appkit-rails | https://github.com/DavyJonesLocker/ember-appkit-rails | lib/ember/appkit/rails/walker.rb | Ruby | mit | 238 | master | 2,978 | require 'parser/current'
class Walker < AST::Processor
attr_accessor :found_nodes, :namespace_type
def initialize(resource, path, api_version)
@resource = resource
@file = File.open(path, 'r+')
@content = @file.read
@ast = Parser::CurrentRuby.parse(@content)
@api_version = api_version
@fou... |
github | DavyJonesLocker/ember-appkit-rails | https://github.com/DavyJonesLocker/ember-appkit-rails | lib/ember/appkit/rails/engine.rb | Ruby | mit | 238 | master | 3,872 | class Ember::Appkit::Rails::Engine < ::Rails::Engine
config.ember = ActiveSupport::OrderedOptions.new
config.ember.paths = ActiveSupport::OrderedOptions.new
config.ember.namespaces = ActiveSupport::OrderedOptions.new
config.ember.prefix_patterns = ActiveSupport::OrderedOptions.new
config.ember.paths.app = 'a... |
github | DavyJonesLocker/ember-appkit-rails | https://github.com/DavyJonesLocker/ember-appkit-rails | lib/ember/appkit/rails/sprockets.rb | Ruby | mit | 238 | master | 206 | module Ember::Appkit::Rails::Sprockets; end
require 'ember/appkit/rails/sprockets/context'
require 'ember/appkit/rails/sprockets/processed_asset'
require 'ember/appkit/rails/sprockets/directive_processor' |
github | DavyJonesLocker/ember-appkit-rails | https://github.com/DavyJonesLocker/ember-appkit-rails | lib/ember/appkit/rails/template.rb | Ruby | mit | 238 | master | 2,424 | require 'sprockets'
require 'sprockets/engines'
require 'barber'
class Ember::Appkit::Rails::Template < Tilt::Template
def self.default_mime_type
'application/javascript'
end
def prepare; end
def evaluate(scope, locals, &block)
raw = handlebars?(scope)
if raw
template = data
else
... |
github | DavyJonesLocker/ember-appkit-rails | https://github.com/DavyJonesLocker/ember-appkit-rails | lib/ember/appkit/rails/active_support/dependencies.rb | Ruby | mit | 238 | master | 294 | module ActiveSupport::Dependencies
def autoloadable_module?(path_suffix)
autoload_paths.each do |load_path|
path = File.join(load_path, path_suffix)
return load_path if File.directory?(path) && Dir.glob(File.join(path, '**/*.rb')).present?
end
return false
end
end |
github | DavyJonesLocker/ember-appkit-rails | https://github.com/DavyJonesLocker/ember-appkit-rails | lib/ember/appkit/rails/sprockets/context.rb | Ruby | mit | 238 | master | 361 | require 'sprockets/context'
module Ember::Appkit::Rails::Sprockets::Context
def asset_requirable?(path)
return false if path.to_s.match(File.join(::Rails.root, 'app/assets/javascripts')) || path.to_s.match(File.join(::Rails.root, 'lib/assets/javascripts'))
super
end
end
Sprockets::Context.send(:prepend, E... |
github | DavyJonesLocker/ember-appkit-rails | https://github.com/DavyJonesLocker/ember-appkit-rails | lib/ember/appkit/rails/sprockets/processed_asset.rb | Ruby | mit | 238 | master | 680 | require 'sprockets/processed_asset'
module Ember::Appkit::Rails::Sprockets::ProcessedAsset
def initialize(environment, logical_path, pathname)
super
_make_ember_application_template_stale(pathname)
end
def init_with(environment, coder)
super
_make_ember_application_template_stale(coder['pathna... |
github | DavyJonesLocker/ember-appkit-rails | https://github.com/DavyJonesLocker/ember-appkit-rails | lib/ember/appkit/rails/sprockets/directive_processor.rb | Ruby | mit | 238 | master | 320 | require 'sprockets/directive_processor'
module Ember::Appkit::Rails::Sprockets::DirectiveProcessor
def process_require_environment_from_directive(path)
context.require_asset(File.join(path, ::Rails.env))
end
end
Sprockets::DirectiveProcessor.send(:include, Ember::Appkit::Rails::Sprockets::DirectiveProcessor) |
github | DavyJonesLocker/ember-appkit-rails | https://github.com/DavyJonesLocker/ember-appkit-rails | lib/ember/appkit/rails/teaspoon/suite.rb | Ruby | mit | 238 | master | 230 | module Ember::Appkit::Rails::Teaspoon::Suite
def asset_from_file(filename)
super.gsub(/(\.js\.es6|.es6)$/, '.js')
end
end
Teaspoon::Suite.send(:prepend, Ember::Appkit::Rails::Teaspoon::Suite) if defined?(Teaspoon::Suite) |
github | DavyJonesLocker/ember-appkit-rails | https://github.com/DavyJonesLocker/ember-appkit-rails | test/test_helper.rb | Ruby | mit | 238 | master | 529 | # Configure Rails Environment
ENV["RAILS_ENV"] = "test"
require 'byebug'
require File.expand_path("../dummy/config/environment.rb", __FILE__)
require "rails/test_help"
require 'capybara/rails'
require 'capybara/poltergeist'
require 'minitest/pride'
Capybara.current_driver = :poltergeist
Rails.backtrace_cleaner.remo... |
github | DavyJonesLocker/ember-appkit-rails | https://github.com/DavyJonesLocker/ember-appkit-rails | test/integration/engine_test.rb | Ruby | mit | 238 | master | 1,685 | require 'test_helper'
class EngineTest < ActionDispatch::IntegrationTest
test 'app/assets/javascripts is not in asset load path' do
refute Rails.application.config.assets.paths.include?(File.join(Rails.root, 'app/assets/javascripts'))
end
test 'config/serializers is added to autoload_path' do
assert Rai... |
github | DavyJonesLocker/ember-appkit-rails | https://github.com/DavyJonesLocker/ember-appkit-rails | test/integration/autoload_modules_test.rb | Ruby | mit | 238 | master | 623 | require 'test_helper'
class AutoloadModulesTest < ActionDispatch::IntegrationTest
include IntegrationTestSupport
test 'does not auto create modules for directories that do not have ruby files' do
FileUtils.mkdir(File.join(Rails.root, 'app/models/not_a_module'))
assert_raise NameError do
NotAModule
... |
github | DavyJonesLocker/ember-appkit-rails | https://github.com/DavyJonesLocker/ember-appkit-rails | test/integration/navigation_test.rb | Ruby | mit | 238 | master | 388 | require 'test_helper'
class NavigationTest < ActionDispatch::IntegrationTest
include IntegrationTestSupport
test 'can render default landing page' do
visit '/'
assert page.has_text? "Welcome to Ember on Rails!"
end
test 'can using simple "ember magic"' do
visit '/'
fill_in 'sampleInput', with... |
github | DavyJonesLocker/ember-appkit-rails | https://github.com/DavyJonesLocker/ember-appkit-rails | test/support/generator_test_support.rb | Ruby | mit | 238 | master | 3,093 | require 'pathname'
module GeneratorTestSupport
# def run_generator(args=self.default_arguments, config={})
# args += ['--skip-bundle'] unless args.include? '--dev'
# self.generator_class.start(args, config.reverse_merge(destination_root: destination_root))
# end
def prepare_destination
super
tm... |
github | DavyJonesLocker/ember-appkit-rails | https://github.com/DavyJonesLocker/ember-appkit-rails | test/support/integration_test_support.rb | Ruby | mit | 238 | master | 251 | require 'pathname'
require 'generators/ember/bootstrap_generator'
module IntegrationTestSupport
def setup
Dir.chdir 'test/dummy' do
silence_stream(STDOUT) do
Ember::Generators::BootstrapGenerator.start
end
end
end
end |
github | DavyJonesLocker/ember-appkit-rails | https://github.com/DavyJonesLocker/ember-appkit-rails | test/generators/view_generator_test.rb | Ruby | mit | 238 | master | 1,357 | require 'test_helper'
require 'generators/ember/view_generator'
class ViewGeneratorTest < Rails::Generators::TestCase
include GeneratorTestSupport
tests Ember::Generators::ViewGenerator
destination File.join(Rails.root, "tmp", "generator_test_output")
setup :prepare_destination
test "create view with temp... |
github | DavyJonesLocker/ember-appkit-rails | https://github.com/DavyJonesLocker/ember-appkit-rails | test/generators/route_generator_test.rb | Ruby | mit | 238 | master | 426 | require 'test_helper'
require 'generators/ember/route_generator'
class RouteGeneratorTest < Rails::Generators::TestCase
include GeneratorTestSupport
tests Ember::Generators::RouteGenerator
destination File.join(Rails.root, "tmp", "generator_test_output")
setup :prepare_destination
test "Assert files are p... |
github | DavyJonesLocker/ember-appkit-rails | https://github.com/DavyJonesLocker/ember-appkit-rails | test/generators/scaffold_override_test.rb | Ruby | mit | 238 | master | 4,031 | require 'test_helper'
class ScaffoldOverrideTest < Rails::Generators::TestCase
include GeneratorTestSupport
tests Rails::Generators::ScaffoldGenerator
destination File.join(Rails.root, "tmp")
setup :prepare_destination, :copy_routes, :copy_router, :reset_api_version
test "create template without ember" do
... |
github | DavyJonesLocker/ember-appkit-rails | https://github.com/DavyJonesLocker/ember-appkit-rails | test/generators/helper_generator_test.rb | Ruby | mit | 238 | master | 408 | require 'test_helper'
require 'generators/ember/helper_generator'
class HelperGeneratorTest < Rails::Generators::TestCase
include GeneratorTestSupport
tests Ember::Generators::HelperGenerator
destination File.join(Rails.root, 'tmp')
setup :prepare_destination
test 'Generates helper correctly' do
run_g... |
github | DavyJonesLocker/ember-appkit-rails | https://github.com/DavyJonesLocker/ember-appkit-rails | test/generators/bootstrap_generator_test.rb | Ruby | mit | 238 | master | 3,763 | require 'test_helper'
require 'generators/ember/bootstrap_generator'
class BootstrapGeneratorTest < Rails::Generators::TestCase
include GeneratorTestSupport
tests Ember::Generators::BootstrapGenerator
destination File.join(Rails.root, "tmp", "generator_test_output")
setup :prepare_destination, :copy_applicat... |
github | DavyJonesLocker/ember-appkit-rails | https://github.com/DavyJonesLocker/ember-appkit-rails | test/generators/template_generator_test.rb | Ruby | mit | 238 | master | 623 | require 'test_helper'
require 'generators/ember/template_generator'
class TemplateGeneratorTest < Rails::Generators::TestCase
include GeneratorTestSupport
tests Ember::Generators::TemplateGenerator
destination File.join(Rails.root, "tmp")
setup :prepare_destination
test "generates template" do
run_gen... |
github | DavyJonesLocker/ember-appkit-rails | https://github.com/DavyJonesLocker/ember-appkit-rails | test/generators/controller_generator_test.rb | Ruby | mit | 238 | master | 1,055 | require 'test_helper'
require 'generators/ember/controller_generator'
class ControllerGeneratorTest < Rails::Generators::TestCase
include GeneratorTestSupport
tests Ember::Generators::ControllerGenerator
destination File.join(Rails.root, "tmp", "generator_test_output")
setup :prepare_destination
test "arr... |
github | DavyJonesLocker/ember-appkit-rails | https://github.com/DavyJonesLocker/ember-appkit-rails | test/generators/serializer_override_test.rb | Ruby | mit | 238 | master | 549 | require 'test_helper'
class SerializerOverrideTest < Rails::Generators::TestCase
include GeneratorTestSupport
tests Rails::Generators::SerializerGenerator
destination File.join(Rails.root, "tmp")
setup :prepare_destination
test "create serializer under config/serializers" do
run_generator ["post"]
... |
github | DavyJonesLocker/ember-appkit-rails | https://github.com/DavyJonesLocker/ember-appkit-rails | test/generators/scaffold_generator_test.rb | Ruby | mit | 238 | master | 3,327 | require 'test_helper'
require 'generators/ember/scaffold_generator'
class ScaffoldGeneratorTest < Rails::Generators::TestCase
include GeneratorTestSupport
tests Ember::Generators::ScaffoldGenerator
destination File.join(Rails.root, "tmp", "generator_test_output")
setup :prepare_destination, :copy_router
te... |
github | DavyJonesLocker/ember-appkit-rails | https://github.com/DavyJonesLocker/ember-appkit-rails | test/generators/install_generator_test.rb | Ruby | mit | 238 | master | 4,776 | require 'test_helper'
require 'generators/ember/install_generator'
require 'vcr'
class InstallGeneratorTest < Rails::Generators::TestCase
tests Ember::Generators::InstallGenerator
destination File.join(Rails.root, "tmp", "generator_test_output")
setup :prepare_destination, :set_test_environment
def copy_dire... |
github | DavyJonesLocker/ember-appkit-rails | https://github.com/DavyJonesLocker/ember-appkit-rails | test/generators/resource_override_test.rb | Ruby | mit | 238 | master | 805 | require 'test_helper'
class ResourceOverrideTest < Rails::Generators::TestCase
include GeneratorTestSupport
tests Rails::Generators::ResourceGenerator
destination File.join(Rails.root, "tmp")
setup :prepare_destination, :copy_router, :copy_routes
test "create template without ember" do
run_generator ["... |
github | DavyJonesLocker/ember-appkit-rails | https://github.com/DavyJonesLocker/ember-appkit-rails | test/generators/resource_generator_test.rb | Ruby | mit | 238 | master | 1,187 | require 'test_helper'
require 'generators/ember/resource_generator'
class ResourceGeneratorTest < Rails::Generators::TestCase
include GeneratorTestSupport
tests Ember::Generators::ResourceGenerator
destination File.join(Rails.root, "tmp")
setup :prepare_destination, :copy_router
test "create template" do
... |
github | DavyJonesLocker/ember-appkit-rails | https://github.com/DavyJonesLocker/ember-appkit-rails | test/generators/component_generator_test.rb | Ruby | mit | 238 | master | 1,721 | require 'test_helper'
require 'generators/ember/component_generator'
class ComponentGeneratorTest < Rails::Generators::TestCase
include GeneratorTestSupport
tests Ember::Generators::ComponentGenerator
destination File.join(Rails.root, "tmp", "generator_test_output")
setup :prepare_destination
test "defaul... |
github | DavyJonesLocker/ember-appkit-rails | https://github.com/DavyJonesLocker/ember-appkit-rails | test/generators/model_generator_test.rb | Ruby | mit | 238 | master | 1,890 | require 'test_helper'
require 'generators/ember/model_generator'
class ModelGeneratorTest < Rails::Generators::TestCase
include GeneratorTestSupport
tests Ember::Generators::ModelGenerator
destination File.join(Rails.root, "tmp", "generator_test_output")
setup :prepare_destination
test "create model" do
... |
github | grosser/test_after_commit | https://github.com/grosser/test_after_commit | test_after_commit.gemspec | Ruby | mit | 238 | master | 723 | name = "test_after_commit"
require "./lib/#{name}/version"
Gem::Specification.new name, TestAfterCommit::VERSION do |s|
s.summary = "makes after_commit callbacks testable in Rails 3+ with transactional_fixtures"
s.authors = ["Michael Grosser"]
s.email = "michael@grosser.it"
s.homepage = "https://github.com/gro... |
github | grosser/test_after_commit | https://github.com/grosser/test_after_commit | lib/test_after_commit.rb | Ruby | mit | 238 | master | 728 | require 'test_after_commit/version'
if ActiveRecord::VERSION::MAJOR >= 5
raise 'after_commit testing is baked into rails 5, you no longer need test_after_commit gem'
end
if ActiveRecord::VERSION::MAJOR >= 4
require 'test_after_commit/with_transaction_state'
ActiveRecord::Base.send(:prepend, TestAfterCommit::Wit... |
github | grosser/test_after_commit | https://github.com/grosser/test_after_commit | lib/test_after_commit/database_statements.rb | Ruby | mit | 238 | master | 1,875 | module TestAfterCommit::DatabaseStatements
def transaction(*)
@test_open_transactions ||= 0
skip_emulation = ActiveRecord::Base.connection.open_transactions.zero?
run_callbacks = false
result = nil
rolled_back = false
super do
begin
@test_open_transactions += 1
if Active... |
github | grosser/test_after_commit | https://github.com/grosser/test_after_commit | lib/test_after_commit/with_transaction_state.rb | Ruby | mit | 238 | master | 233 | # disable parts of the sync code that starts looping
module TestAfterCommit
module WithTransactionState
def sync_with_transaction_state
@reflects_state ||= []
@reflects_state[0] = true
super
end
end
end |
github | grosser/test_after_commit | https://github.com/grosser/test_after_commit | spec/database.rb | Ruby | mit | 238 | master | 4,129 | # setup database
require 'active_record'
if ActiveRecord::VERSION::MAJOR > 3
require "rails/observers/activerecord/active_record"
end
if ActiveRecord::VERSION::STRING >= "4.2.0"
ActiveRecord::Base.raise_in_transactional_callbacks = true
end
ActiveRecord::Base.establish_connection(
:adapter => 'sqlite3',
:da... |
github | grosser/test_after_commit | https://github.com/grosser/test_after_commit | spec/test_after_commit_spec.rb | Ruby | mit | 238 | master | 6,819 | require 'spec_helper'
describe TestAfterCommit do
before do
CarObserver.recording = false
Car.called.clear
end
after do
TestAfterCommit.enabled = true unless ENV["REAL"]
end
it "has a VERSION" do
TestAfterCommit::VERSION.should =~ /^[\.\da-z]+$/
end
it "fires on create" do
Car.crea... |
github | grosser/test_after_commit | https://github.com/grosser/test_after_commit | spec/spec_helper.rb | Ruby | mit | 238 | master | 1,456 | require 'bundler/setup'
require File.expand_path '../database', __FILE__
I18n.enforce_available_locales = false
def rails3?
ActiveRecord::VERSION::MAJOR == 3
end
def rails4?
ActiveRecord::VERSION::MAJOR >= 4
end
def rails42?
rails4? && ActiveRecord::VERSION::MINOR >= 2
end
require 'test_after_commit'
if ENV['... |
github | michaeleisel/barber | https://github.com/michaeleisel/barber | xcode_barber.gemspec | Ruby | mit | 238 | master | 1,357 | require_relative 'lib/xcode_barber/version'
Gem::Specification.new do |spec|
spec.name = "xcode_barber"
spec.version = XcodeBarber::VERSION
spec.authors = ["Michael Eisel"]
spec.email = ["michael.eisel@gmail.com"]
spec.summary = %q{Trims Xcode dependencies}
spec.descript... |
github | michaeleisel/barber | https://github.com/michaeleisel/barber | lib/xcode_barber.rb | Ruby | mit | 238 | master | 6,755 | # require "xcode_barber/version"
require 'set'
require 'slop'
require 'xcodeproj'
module XcodeBarber
class Error < StandardError; end
def collect_args(testing)
deps_help = 'The path to the directory containing the .swiftdeps files for this project. To find it, go to your build directory (usually either ~/Libr... |
github | clemens/later_dude | https://github.com/clemens/later_dude | later_dude.gemspec | Ruby | mit | 238 | master | 953 | Gem::Specification.new do |s|
s.name = %q{later_dude}
s.version = "0.3.1"
s.authors = ["Clemens Kofler"]
s.description = %q{LaterDude is a small calendar helper plugin for Rails with i18n support.}
s.summary = %q{Small calendar helper plugin for Rails with i18n support}
s.email = %q{clemens@railway.at}
s... |
github | clemens/later_dude | https://github.com/clemens/later_dude | Rakefile | Ruby | mit | 238 | master | 272 | require 'rake'
require 'rake/testtask'
require 'rdoc/task'
desc 'Test the later_dude gem.'
Rake::TestTask.new(:test) do |t|
t.libs << 'lib'
t.libs << 'test'
t.pattern = 'test/*_test.rb'
t.verbose = true
end
desc 'Default: run unit tests.'
task :default => :test |
github | clemens/later_dude | https://github.com/clemens/later_dude | lib/later_dude/calendar.rb | Ruby | mit | 238 | master | 7,568 | require 'action_view'
require 'action_view/helpers'
require 'action_view/helpers/capture_helper'
require 'action_view/helpers/tag_helper'
require 'action_view/helpers/url_helper'
begin
require 'active_support/core_ext/date/acts_like'
require 'active_support/core_ext/date_time/acts_like'
require 'active_support/c... |
github | clemens/later_dude | https://github.com/clemens/later_dude | lib/later_dude/railtie.rb | Ruby | mit | 238 | master | 203 | require 'later_dude/calendar_helper'
module LaterDude
class Railtie < Rails::Railtie
initializer "later_dude.view_helpers" do
ActionView::Base.send :include, CalendarHelper
end
end
end |
github | clemens/later_dude | https://github.com/clemens/later_dude | test/calendar_helper_test.rb | Ruby | mit | 238 | master | 920 | require 'test_helper'
class CalendarHelperTest < ActiveSupport::TestCase
setup do
@helper = Object.new
class << @helper
include LaterDude::CalendarHelper
end
end
test "requires year and month" do
assert_raises(ArgumentError) { @helper.calendar_for }
assert_raises(ArgumentError) { @help... |
github | clemens/later_dude | https://github.com/clemens/later_dude | test/calendar_test.rb | Ruby | mit | 238 | master | 14,276 | require 'test_helper'
I18n.load_path += Dir[File.expand_path('fixtures/locales', File.dirname(__FILE__)) + '/*.yml']
# TODO: figure out why I have to reference Calendar via its module ...
class CalendarTest < ActiveSupport::TestCase
# some constants for increased readability
FULL_DAY_NAMES = I18n.translate(:'da... |
github | rsim/mondrian-olap | https://github.com/rsim/mondrian-olap | mondrian-olap.gemspec | Ruby | mit | 237 | master | 1,182 | # encoding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'mondrian/olap/version'
Gem::Specification.new do |gem|
gem.name = "mondrian-olap"
gem.version = ::Mondrian::OLAP::VERSION
gem.authors = ["Raimonds Simanovskis"]
gem... |
github | rsim/mondrian-olap | https://github.com/rsim/mondrian-olap | Rakefile | Ruby | mit | 237 | master | 916 | require "bundler/gem_tasks"
desc "Run tests (default)"
task :default => :test
require 'rdoc/task'
RDoc::Task.new do |rdoc|
version = File.exist?('VERSION') ? File.read('VERSION').chomp : ""
rdoc.rdoc_dir = 'doc'
rdoc.title = "mondrian-olap #{version}"
rdoc.rdoc_files.include('README*')
rdoc.rdoc_files.incl... |
github | rsim/mondrian-olap | https://github.com/rsim/mondrian-olap | Gemfile | Ruby | mit | 237 | master | 572 | source 'https://rubygems.org'
ruby RUBY_VERSION, engine: 'jruby', engine_version: JRUBY_VERSION
gemspec
gem 'rake', '~> 13.3.0'
gem 'minitest', '~> 5.25'
gem 'minitest-hooks', '~> 1.5'
gem 'minitest-reporters', '~> 1.7'
gem 'rdoc', '~> 6.14.0'
gem 'jdbc-mysql', '~> 8.0.30'
gem 'jdbc-postgres', '~> 42.7.8'
gem 'activ... |
github | rsim/mondrian-olap | https://github.com/rsim/mondrian-olap | test/connection_role_test.rb | Ruby | mit | 237 | master | 7,302 | # frozen_string_literal: true
require_relative "test_helper"
describe "Connection role" do
describe "create connection" do
before(:all) do
@all_roles = [
@role_name = role_name = 'California manager',
@role_name2 = role_name2 = 'Dummy, with comma',
@simple_role_name = simple_role_... |
github | rsim/mondrian-olap | https://github.com/rsim/mondrian-olap | test/connection_test.rb | Ruby | mit | 237 | master | 4,286 | # frozen_string_literal: true
require_relative "test_helper"
describe "Connection" do
describe "create" do
before do
@olap = Mondrian::OLAP::Connection.new(CONNECTION_PARAMS_WITH_CATALOG)
end
it "should not be connected before connection" do
assert_equal false, @olap.connected?
end
... |
github | rsim/mondrian-olap | https://github.com/rsim/mondrian-olap | test/test_helper.rb | Ruby | mit | 237 | master | 557 | # frozen_string_literal: true
require_relative 'support/database_setup'
require 'minitest/autorun'
require 'minitest/reporters'
require 'minitest/hooks/default'
require 'pry'
Minitest::Reporters.use! Minitest::Reporters::DefaultReporter.new(color: true)
class Minitest::Spec
def assert_like(expected, actual, msg =... |
github | rsim/mondrian-olap | https://github.com/rsim/mondrian-olap | test/query_test.rb | Ruby | mit | 237 | master | 53,910 | # frozen_string_literal: true
require_relative "test_helper"
describe "Query" do
def qt(name)
ActiveRecord::Base.connection.quote_table_name(name.to_s)
end
before(:all) do
@olap = Mondrian::OLAP::Connection.create(CONNECTION_PARAMS_WITH_CATALOG)
@sql = ActiveRecord::Base.connection
@query_stri... |
github | rsim/mondrian-olap | https://github.com/rsim/mondrian-olap | test/schema_definition_test.rb | Ruby | mit | 237 | master | 60,245 | # frozen_string_literal: true
require_relative "test_helper"
describe "Schema definition" do
describe "elements" do
before do
@schema = Mondrian::OLAP::Schema.new
end
describe "root element" do
it "should render to XML" do
assert_like <<~XML,
<?xml version="1.0" encoding=... |
github | rsim/mondrian-olap | https://github.com/rsim/mondrian-olap | test/cube_cache_control_test.rb | Ruby | mit | 237 | master | 10,119 | # frozen_string_literal: true
require_relative "test_helper"
describe "Cube" do
before(:all) do
@schema = Mondrian::OLAP::Schema.define do
measures_caption 'Measures caption'
cube 'Sales' do
description 'Sales description'
caption 'Sales caption'
annotations foo: 'bar'
... |
github | rsim/mondrian-olap | https://github.com/rsim/mondrian-olap | test/mondrian_test.rb | Ruby | mit | 237 | master | 33,322 | # frozen_string_literal: true
require_relative "test_helper"
describe "Mondrian features" do
before(:all) do
@schema = Mondrian::OLAP::Schema.define do
cube 'Sales' do
table 'sales'
dimension 'Gender', foreign_key: 'customer_id' do
hierarchy has_all: true, primary_key: 'id' do
... |
github | rsim/mondrian-olap | https://github.com/rsim/mondrian-olap | test/rake_tasks.rb | Ruby | mit | 237 | master | 17,883 | # frozen_string_literal: true
# encoding: utf-8
require 'rake/testtask'
Rake::TestTask.new(:test) do |t|
t.libs << 'test'
t.pattern = 'test/**/*_test.rb'
t.warning = false
end
namespace :test do
%w(mysql jdbc_mysql postgresql oracle sqlserver vertica snowflake clickhouse mariadb).each do |driver|
desc "R... |
github | rsim/mondrian-olap | https://github.com/rsim/mondrian-olap | test/cube_test.rb | Ruby | mit | 237 | master | 18,610 | # frozen_string_literal: true
require_relative "test_helper"
describe "Cube" do
before(:all) do
@schema = Mondrian::OLAP::Schema.define do
measures_caption 'Measures caption'
cube 'Sales' do
description 'Sales description'
caption 'Sales caption'
annotations foo: 'bar'
... |
github | rsim/mondrian-olap | https://github.com/rsim/mondrian-olap | test/support/database_setup.rb | Ruby | mit | 237 | master | 17,272 | # frozen_string_literal: true
require "bundler/setup"
require 'logger'
require 'active_record'
require 'activerecord-jdbc-adapter'
# Autoload corresponding JDBC driver during require 'jdbc/...'
Java::JavaLang::System.setProperty("jdbc.driver.autoload", "true")
MONDRIAN_DRIVER = ENV['MONDRIAN_DRIVER'] || 'mysql'
env... |
github | rsim/mondrian-olap | https://github.com/rsim/mondrian-olap | lib/mondrian/olap.rb | Ruby | mit | 237 | master | 974 | # frozen_string_literal: true
require 'java'
require 'nokogiri'
{
# Do not register MondrianOlap4jDriver
"mondrian.olap4j.registerDriver" => false,
# Do not register log3j2 MBean
"log4j2.disable.jmx" => true
}.each do |key, value|
if java.lang.System.getProperty(key).nil?
java.lang.System.setProperty(ke... |
github | rsim/mondrian-olap | https://github.com/rsim/mondrian-olap | lib/mondrian/olap/schema_element.rb | Ruby | mit | 237 | master | 6,092 | # frozen_string_literal: true
module Mondrian
module OLAP
class SchemaElement
def initialize(name = nil, attributes = {}, parent = nil, &block)
# If just attributes hash provided
if name.is_a?(Hash) && attributes == {}
attributes = name
name = nil
end
@at... |
github | rsim/mondrian-olap | https://github.com/rsim/mondrian-olap | lib/mondrian/olap/schema_udf.rb | Ruby | mit | 237 | master | 9,539 | # frozen_string_literal: true
require 'jruby/core_ext'
module Mondrian
module OLAP
class Schema < SchemaElement
def user_defined_cell_formatter(name, &block)
CellFormatter.new(name, &block)
end
module ScriptElements
private
def ruby(*options, &block)
udf_cl... |
github | rsim/mondrian-olap | https://github.com/rsim/mondrian-olap | lib/mondrian/olap/connection.rb | Ruby | mit | 237 | master | 20,500 | # frozen_string_literal: true
module Mondrian
module OLAP
class Connection
def self.create(params)
connection = new(params)
connection.connect
connection
end
attr_reader :raw_connection, :raw_mondrian_connection, :raw_catalog, :raw_schema,
:raw_schema_... |
github | rsim/mondrian-olap | https://github.com/rsim/mondrian-olap | lib/mondrian/olap/error.rb | Ruby | mit | 237 | master | 3,253 | # frozen_string_literal: true
module Mondrian
module OLAP
NATIVE_ERROR_REGEXP = /^(org\.olap4j\.|mondrian\.|java\.lang\.reflect\.UndeclaredThrowableException\: Mondrian Error\:)/
class Error < StandardError
# root_cause will be nil if there is no cause for wrapped native error.
# root_cause_mes... |
github | rsim/mondrian-olap | https://github.com/rsim/mondrian-olap | lib/mondrian/olap/schema.rb | Ruby | mit | 237 | master | 23,335 | # frozen_string_literal: true
require 'mondrian/olap/schema_element'
module Mondrian
module OLAP
# See http://mondrian.pentaho.com/documentation/schema.php for more detailed description of Mondrian Schema elements.
class Schema < SchemaElement
def initialize(name = nil, attributes = {}, parent = nil, ... |
github | rsim/mondrian-olap | https://github.com/rsim/mondrian-olap | lib/mondrian/olap/cube.rb | Ruby | mit | 237 | master | 13,524 | # frozen_string_literal: true
require 'forwardable'
module Mondrian
module OLAP
module Annotated
private
def annotations_for(raw_element)
@annotations ||= begin
annotated = raw_element.unwrap(Java::MondrianOlap::Annotated.java_class)
annotations_hash = annotated.getAnnot... |
github | rsim/mondrian-olap | https://github.com/rsim/mondrian-olap | lib/mondrian/olap/query.rb | Ruby | mit | 237 | master | 13,447 | # frozen_string_literal: true
module Mondrian
module OLAP
class Query
def self.from(connection, cube_name)
query = self.new(connection)
query.cube_name = cube_name
query
end
attr_accessor :cube_name
def initialize(connection)
@connection = connection
... |
github | rsim/mondrian-olap | https://github.com/rsim/mondrian-olap | lib/mondrian/olap/result.rb | Ruby | mit | 237 | master | 25,326 | # frozen_string_literal: true
require 'bigdecimal'
module Mondrian
module OLAP
class Result
def initialize(connection, raw_cell_set, options = {})
@connection = connection
@raw_cell_set = raw_cell_set
@profiling_handler = options[:profiling_handler]
@total_duration = option... |
github | infinum/dox | https://github.com/infinum/dox | Rakefile | Ruby | mit | 237 | master | 209 | # frozen_string_literal: true
require 'bundler/gem_tasks'
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec)
require 'rubocop/rake_task'
RuboCop::RakeTask.new
task default: [:spec, :rubocop] |
github | infinum/dox | https://github.com/infinum/dox | dox.gemspec | Ruby | mit | 237 | master | 1,366 | lib = File.expand_path('lib', __dir__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'dox/version'
Gem::Specification.new do |spec|
spec.name = 'dox'
spec.version = Dox::VERSION
spec.authors = ['Melita Kokot', 'Vedran Hrnčić', 'Marko Ćilimković']
spec.email = ['me... |
github | infinum/dox | https://github.com/infinum/dox | Gemfile | Ruby | mit | 237 | master | 398 | source 'https://rubygems.org'
# Specify your gem's dependencies in dox.gemspec
gemspec
rails_version = ENV['RAILS_VERSION'] || '7.2.0'
gem 'activesupport', "~> #{rails_version}"
gem 'bundler'
gem 'codeclimate-test-reporter'
gem 'json'
gem 'ostruct'
gem 'pry-nav'
gem 'pry-rails'
gem 'pry-stack_explorer'
gem 'rake'
g... |
github | infinum/dox | https://github.com/infinum/dox | spec/config_spec.rb | Ruby | mit | 237 | master | 1,893 | describe Dox::Config do
subject { described_class }
let(:config) { subject.new }
describe '#descriptions_location=' do
it 'raises an error when the folder does not exist' do
expect do
config.descriptions_location = 'spec/mydir'
end.to raise_error(Dox::Errors::FolderNotFoundError, 'spec/m... |
github | infinum/dox | https://github.com/infinum/dox | spec/redocly_adapter_spec.rb | Ruby | mit | 237 | master | 1,040 | RSpec.describe Dox::RedoclyAdapter do
let(:config) do
instance_double(Dox::Config, title: 'Fallback Title', redoc_version: nil)
end
let(:adapter) { described_class.new }
let(:spec) { { 'openapi' => '3.0.0', 'paths' => {} } }
before do
allow(Dox).to receive(:config).and_return(config)
end
describ... |
github | infinum/dox | https://github.com/infinum/dox | spec/html_renderer_spec.rb | Ruby | mit | 237 | master | 4,646 | RSpec.describe Dox::HtmlRenderer do
include DirectoryHelper
let(:output_dir) { Dir.mktmpdir('dox_test') }
let(:output_path) { File.join(output_dir, 'index.html') }
let(:config) do
instance_double(Dox::Config, title: 'Fallback Title', redoc_version: nil)
end
before do
allow(Dox).to receive(:config)... |
github | infinum/dox | https://github.com/infinum/dox | spec/formatter_spec.rb | Ruby | mit | 237 | master | 7,239 | require_relative 'fixtures/dox_test_classes'
describe Dox::Formatter do
include DirectoryHelper
include OutputHelper
subject { described_class }
let(:docs_output) { StringIO.new }
let(:formatter) { subject.new(docs_output) }
let(:get_pokemon_data) do
{
meta: {
apidoc: true,
dox... |
github | infinum/dox | https://github.com/infinum/dox | spec/spec_helper.rb | Ruby | mit | 237 | master | 282 | require 'simplecov'
SimpleCov.start
require 'dox'
require 'pathname'
require 'pry'
$LOAD_PATH.unshift File.expand_path('../lib', __dir__)
root_path = Pathname.new(File.expand_path('../', File.dirname(__FILE__)))
Dir[root_path.join('spec/support/**/*.rb')].each { |f| require f } |
github | infinum/dox | https://github.com/infinum/dox | spec/dsl_spec.rb | Ruby | mit | 237 | master | 2,408 | require_relative 'fixtures/dox_dsl_test_classes'
describe Dox::DSL::Documentation do
describe '.api' do
let(:expected_output) do
{
apidoc: true,
resource_desc: nil,
resource_group_desc: 'Pokemons group desc',
resource_group_name: 'Pokemons',
resource_name: 'Pokemons'... |
github | infinum/dox | https://github.com/infinum/dox | spec/util/http_spec.rb | Ruby | mit | 237 | master | 228 | RSpec.describe Dox::Util::Http do
describe '.verb?' do
it 'checks for valid HTTP verbs' do
stub_const('Dox::Util::Http::VERB', ['VERB'])
expect(described_class.verb?('invalid')).to eq(false)
end
end
end |
github | infinum/dox | https://github.com/infinum/dox | spec/dsl/resource_group_spec.rb | Ruby | mit | 237 | master | 1,501 | describe Dox::DSL::ResourceGroup do
subject { described_class }
GROUP_NAME = 'Pokemons'.freeze
GROUP_DESC = 'All pokemons'.freeze
let(:options) do
proc do
desc GROUP_DESC
end
end
let(:options_with_name) do
proc do
name GROUP_NAME
desc GROUP_DESC
end
end
describe '#i... |
github | infinum/dox | https://github.com/infinum/dox | spec/dsl/resource_spec.rb | Ruby | mit | 237 | master | 2,623 | describe Dox::DSL::Resource do
subject { described_class }
RESOURCE_NAME = 'Pokemons'.freeze
RESOURCE_GROUP = 'Pokemons'.freeze
RESOURCE_DESC = 'Returns list of Pokemons'.freeze
let(:options) do
proc do
group RESOURCE_GROUP
desc RESOURCE_DESC
end
end
let(:options_without_group) do
... |
github | infinum/dox | https://github.com/infinum/dox | spec/dsl/action_spec.rb | Ruby | mit | 237 | master | 1,859 | describe Dox::DSL::Action do
subject { described_class }
ACTION_NAME = 'Get pokemons'.freeze
ACTION_PARAMS = { id: 1 }.freeze
ACTION_VERB = 'GET'.freeze
ACTION_PATH = '/pokemons'.freeze
ACTION_DESC = 'Returns list of Pokemons'.freeze
let(:options) do
proc do
verb ACTION_VERB
path ACTION_... |
github | infinum/dox | https://github.com/infinum/dox | spec/entities/resource_group_spec.rb | Ruby | mit | 237 | master | 537 | describe Dox::Entities::ResourceGroup do
subject { described_class }
let(:details) do
{
resource_group_name: 'Pokemons',
resource_group_desc: 'Pokemons'
}
end
let(:resource_group) { subject.new(details) }
describe '#name' do
it { expect(resource_group.name).to eq(details[:resource_g... |
github | infinum/dox | https://github.com/infinum/dox | spec/entities/example_spec.rb | Ruby | mit | 237 | master | 2,631 | describe Dox::Entities::Example do
subject { described_class }
let(:response_body) { { hello: 'world' }.to_json }
let(:content_type) { 'application/json' }
let(:example_desc) { 'Dummy' }
let(:example_name) { 'Dum' }
let(:query_params) { { 'color' => 'blue' } }
let(:path_params) { { 'id' => 11 } }
let(:... |
github | infinum/dox | https://github.com/infinum/dox | spec/entities/resource_spec.rb | Ruby | mit | 237 | master | 480 | describe Dox::Entities::Resource do
subject { described_class }
let(:details) do
{
resource_name: 'Pokemons',
resource_desc: 'Pokemons'
}
end
let(:resource) { subject.new(details) }
describe '#name' do
it { expect(resource.name).to eq(details[:resource_name]) }
end
describe '#d... |
github | infinum/dox | https://github.com/infinum/dox | spec/entities/action_spec.rb | Ruby | mit | 237 | master | 3,785 | describe Dox::Entities::Action do
subject { described_class }
let(:action_name) { 'Get pokemons' }
let(:request) do
double(:request, method: 'HEAD',
path_parameters: { 'id' => 1 },
path: '/pokemons/1',
filtered_parameters: {},
... |
github | infinum/dox | https://github.com/infinum/dox | spec/formatters/plain_spec.rb | Ruby | mit | 237 | master | 570 | describe Dox::Formatters::Plain do
subject { described_class.new(http_env).format }
let(:http_env) { double(:request_or_response, body: body) }
describe '#format' do
context 'when encoding UTF_8' do
let(:body) { 'body' }
it { is_expected.to eq 'body' }
end
context 'when encoding not UT... |
github | infinum/dox | https://github.com/infinum/dox | spec/formatters/xml_spec.rb | Ruby | mit | 237 | master | 558 | describe Dox::Formatters::Xml do
subject { described_class.new(http_env).format.chomp }
let(:http_env) { double(:request_or_response, body: body) }
describe '#format' do
let(:body) do
<<~HEREDOC
<?xml version='1.0' encoding='ISO-8859-15'?>
<node>
<subnode>
<object... |
github | infinum/dox | https://github.com/infinum/dox | spec/formatters/json_spec.rb | Ruby | mit | 237 | master | 986 | describe Dox::Formatters::Json do
subject { described_class.new(http_env).format }
let(:http_env) { double(:request_or_response, body: body) }
describe '#format' do
context 'when valid JSON' do
let(:body) do
{
data: {
attributes: {
name: 'John Doe'
... |
github | infinum/dox | https://github.com/infinum/dox | spec/formatters/multipart_spec.rb | Ruby | mit | 237 | master | 911 | describe Dox::Formatters::Multipart do
subject { described_class.new(http_env).format }
let(:http_env) { double(:request_or_response, body: body) }
describe '#format' do
let(:body) { File.open('spec/fixtures/example.json') }
let(:formatted_response) do
<<~HEREDOC.chomp
{
"data": ... |
github | infinum/dox | https://github.com/infinum/dox | spec/printers/document_printer_spec.rb | Ruby | mit | 237 | master | 1,592 | describe Dox::Printers::DocumentPrinter do
include DirectoryHelper
include OutputHelper
subject { described_class }
let(:passed_example) { double(:passed_example) }
let(:output) { double(:output) }
let(:printer) { subject.new(output) }
let(:schema_request_folder_path) { File.join(File.dirname(__FILE__),... |
github | infinum/dox | https://github.com/infinum/dox | spec/printers/resource_group_printer_spec.rb | Ruby | mit | 237 | master | 1,052 | describe Dox::Printers::ResourceGroupPrinter do
subject { described_class }
let(:details) do
{
resource_group_name: 'Pokemons',
resource_group_desc: 'Pokemons desc'
}
end
let(:resource_group) { Dox::Entities::ResourceGroup.new(details) }
let(:hash) do
{ 'x-tagGroups' => [] }
end
... |
github | infinum/dox | https://github.com/infinum/dox | spec/printers/action_printer_spec.rb | Ruby | mit | 237 | master | 2,218 | describe Dox::Printers::ActionPrinter do
subject { described_class }
let(:request) do
double(:request, method: 'GET',
path_parameters: { 'id' => 1 },
path: '/pokemons/1',
filtered_parameters: {},
env: {})
end
let(:params) d... |
github | infinum/dox | https://github.com/infinum/dox | spec/printers/example_response_printer_spec.rb | Ruby | mit | 237 | master | 3,862 | describe Dox::Printers::ExampleResponsePrinter do
subject { described_class }
let(:content_type) { 'application/json' }
let(:req_headers) { { 'X-Auth-Token' => '877da7da7fbc16216e', 'Accept' => content_type } }
let(:res_headers) { { 'Content-Type' => content_type, 'Content-Encoding' => 'gzip', 'cache-control' ... |
github | infinum/dox | https://github.com/infinum/dox | spec/printers/resource_printer_spec.rb | Ruby | mit | 237 | master | 1,613 | describe Dox::Printers::ResourcePrinter do
subject { described_class }
let(:details) do
{
resource_name: 'Pokemons',
resource_desc: 'pokemons.md',
resource_group_name: 'Beings'
}
end
let(:resource) { Dox::Entities::Resource.new(details) }
let(:hash) do
{ 'x-tagGroups' => [name:... |
github | infinum/dox | https://github.com/infinum/dox | spec/printers/example_request_printer_spec.rb | Ruby | mit | 237 | master | 2,209 | describe Dox::Printers::ExampleRequestPrinter do
subject { described_class }
let(:content_type) { 'application/json' }
let(:req_headers) { { 'X-Auth-Token' => '877da7da7fbc16216e', 'Accept' => content_type } }
let(:res_headers) { { 'Content-Type' => content_type, 'Content-Encoding' => 'gzip', 'cache-control' =... |
github | infinum/dox | https://github.com/infinum/dox | spec/support/helper/directory.rb | Ruby | mit | 237 | master | 229 | module DirectoryHelper
def root_path
Pathname(root_dir)
end
def fixtures_path
root_path.join('spec', 'fixtures')
end
private
def root_dir
File.expand_path('../../../', File.dirname(__FILE__))
end
end |
github | infinum/dox | https://github.com/infinum/dox | lib/dox.rb | Ruby | mit | 237 | master | 1,906 | require 'active_support/concern'
require 'active_support/core_ext/hash/keys'
require 'active_support/core_ext/object/blank'
require 'active_support/core_ext/object/to_query'
require 'active_support/core_ext/string'
require 'forwardable'
require 'dox/config'
require 'dox/dsl/attr_proxy'
require 'dox/dsl/action'
require... |
github | infinum/dox | https://github.com/infinum/dox | lib/dox/redocly_adapter.rb | Ruby | mit | 237 | master | 842 | module Dox
class RedoclyAdapter
DEFAULT_REDOC_VERSION = '2.5.1'.freeze
def build_html(title, spec)
<<~HTML
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>#{title}</title>
<meta name="viewport" content="width=device-width, initial-scale... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.