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 | kickstarter/event-sourcing-rails-todo-app-demo | https://github.com/kickstarter/event-sourcing-rails-todo-app-demo | config/environments/test.rb | Ruby | mit | 87 | 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 | kickstarter/event-sourcing-rails-todo-app-demo | https://github.com/kickstarter/event-sourcing-rails-todo-app-demo | config/environments/development.rb | Ruby | mit | 87 | master | 1,755 | Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
# since you don't have to restart the web serv... |
github | kickstarter/event-sourcing-rails-todo-app-demo | https://github.com/kickstarter/event-sourcing-rails-todo-app-demo | config/environments/production.rb | Ruby | mit | 87 | master | 3,285 | Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# Code is not reloaded between requests.
config.cache_classes = true
# Eager load code on boot. This eager loads most of Rails and
# your application in memory, allowing both threaded web serve... |
github | kickstarter/event-sourcing-rails-todo-app-demo | https://github.com/kickstarter/event-sourcing-rails-todo-app-demo | app/models/lib/event_dispatcher.rb | Ruby | mit | 87 | master | 2,151 | # Dispatcher implementation used by Events::Dispatcher.
class Lib::EventDispatcher
# Register Reactors to Events.
# * Reactors registered with `trigger` will be triggered synchronously
# * Reactors registered with `async` will be triggered asynchronously via a Sidekiq Job
#
# Example:
#
# on BaseEvent, ... |
github | kickstarter/event-sourcing-rails-todo-app-demo | https://github.com/kickstarter/event-sourcing-rails-todo-app-demo | app/models/lib/base_event.rb | Ruby | mit | 87 | master | 2,892 | # This is the BaseEvent class that all Events inherit from.
# It takes care of serializing `data` and `metadata` via json
# It defines setters and accessors for the defined `data_attributes`
# After create, it calls `apply` to apply changes.
#
# Subclasses must define the `apply` method.
class Lib::BaseEvent < ActiveRe... |
github | kickstarter/event-sourcing-rails-todo-app-demo | https://github.com/kickstarter/event-sourcing-rails-todo-app-demo | app/models/lib/command.rb | Ruby | mit | 87 | master | 2,594 | # The Base command mixin that commands include.
#
# A Command has the following public api.
#
# ```
# MyCommand.call(user: ..., post: ...) # shorthand to initialize, validate and execute the command
# command = MyCommand.new(user: ..., post: ...)
# command.valid? # true or false
# command.errors # +> <ActiveMod... |
github | kickstarter/event-sourcing-rails-todo-app-demo | https://github.com/kickstarter/event-sourcing-rails-todo-app-demo | app/models/events/dispatcher.rb | Ruby | mit | 87 | master | 275 | # Subscribes Reactors to Events.
# * `trigger` will run the Reactor synchronously
# * `async` will queue up a ReactorJob to run the Reactor
class Events::Dispatcher < Lib::EventDispatcher
on Events::TodoList::Created, async: Reactors::TodoList::SendGettingStartedEmail
end |
github | kickstarter/event-sourcing-rails-todo-app-demo | https://github.com/kickstarter/event-sourcing-rails-todo-app-demo | app/models/events/todo_item/created.rb | Ruby | mit | 87 | master | 249 | # frozen_string_literal: true
class Events::TodoItem::Created < Events::TodoItem::BaseEvent
data_attributes :todo_list_id, :name
def apply(todo_item)
todo_item.todo_list_id = todo_list_id
todo_item.name = name
todo_item
end
end |
github | kickstarter/event-sourcing-rails-todo-app-demo | https://github.com/kickstarter/event-sourcing-rails-todo-app-demo | app/models/commands/todo_item/create.rb | Ruby | mit | 87 | master | 317 | # frozen_string_literal: true
module Commands
class TodoItem::Create
include Lib::Command
attributes :todo_list, :name, :metadata
private def build_event
Events::TodoItem::Created.new(
todo_list_id: todo_list.id,
name: name,
metadata: metadata
)
end
end
end |
github | kickstarter/event-sourcing-rails-todo-app-demo | https://github.com/kickstarter/event-sourcing-rails-todo-app-demo | app/models/commands/todo_list/update_name.rb | Ruby | mit | 87 | master | 379 | # frozen_string_literal: true
module Commands
class TodoList::UpdateName
include Lib::Command
attributes :todo_list, :name, :metadata
private def build_event
Events::TodoList::NameUpdated.new(
todo_list: todo_list,
name: name,
metadata: metadata
)
end
privat... |
github | kickstarter/event-sourcing-rails-todo-app-demo | https://github.com/kickstarter/event-sourcing-rails-todo-app-demo | app/models/commands/todo_list/create.rb | Ruby | mit | 87 | master | 269 | # frozen_string_literal: true
module Commands
class TodoList::Create
include Lib::Command
attributes :name, :metadata
private def build_event
Events::TodoList::Created.new(
name: name,
metadata: metadata
)
end
end
end |
github | hjanuschka/fastlane-plugin-aws_device_farm | https://github.com/hjanuschka/fastlane-plugin-aws_device_farm | Gemfile | Ruby | mit | 87 | master | 215 | source 'https://rubygems.org'
gemspec
plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile')
# rubocop:disable Security/Eval
eval(File.read(plugins_path), binding) if File.exist?(plugins_path) |
github | hjanuschka/fastlane-plugin-aws_device_farm | https://github.com/hjanuschka/fastlane-plugin-aws_device_farm | fastlane-plugin-aws_device_farm.gemspec | Ruby | mit | 87 | master | 1,111 | lib = File.expand_path('lib', __dir__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'fastlane/plugin/aws_device_farm/version'
Gem::Specification.new do |spec|
spec.name = 'fastlane-plugin-aws_device_farm'
spec.version = Fastlane::AwsDeviceFarm::VERSION
spec.version = "#{spec.ver... |
github | hjanuschka/fastlane-plugin-aws_device_farm | https://github.com/hjanuschka/fastlane-plugin-aws_device_farm | lib/fastlane/plugin/aws_device_farm.rb | Ruby | mit | 87 | master | 483 | require 'fastlane/plugin/aws_device_farm/version'
module Fastlane
module AwsDeviceFarm
# Return all .rb files inside the "actions" and "helper" directory
def self.all_classes
Dir[File.expand_path('**/{actions,helper}/*.rb', File.dirname(__FILE__))]
end
end
end
# By default we want to import all ... |
github | hjanuschka/fastlane-plugin-aws_device_farm | https://github.com/hjanuschka/fastlane-plugin-aws_device_farm | lib/fastlane/plugin/aws_device_farm/actions/aws_device_farm_action.rb | Ruby | mit | 87 | master | 23,976 | require 'aws-sdk'
module Fastlane
module Actions
# rubocop:disable Metrics/ClassLength
class AwsDeviceFarmAction < Action
def self.run(params)
Actions.verify_gem!('aws-sdk')
UI.message 'Preparing the upload to the device farm.'
# Instantiate the client.
@client = ::Aws:... |
github | hjanuschka/fastlane-plugin-aws_device_farm | https://github.com/hjanuschka/fastlane-plugin-aws_device_farm | lib/fastlane/plugin/aws_device_farm/actions/aws_device_farm_package.rb | Ruby | mit | 87 | master | 2,300 | module Fastlane
module Actions
class AwsDeviceFarmPackageAction < Action
def self.run(params)
derrived_data_dir = File.expand_path(params[:derrived_data_path])
packages_dir = "#{derrived_data_dir}/packages"
FileUtils.rm_rf packages_dir
Dir["#{derrived_data_dir}/Build/Products... |
github | hjanuschka/fastlane-plugin-aws_device_farm | https://github.com/hjanuschka/fastlane-plugin-aws_device_farm | lib/fastlane/plugin/aws_device_farm/helper/aws_device_farm_helper.rb | Ruby | mit | 87 | master | 2,147 | require 'rexml/document'
require 'fileutils'
require 'open-uri'
module Fastlane
module Helper
class AwsDeviceFarmHelper
# create Junit.xml
def self.create_junit_xml(test_results:, file_path:, file_prefix:)
doc = REXML::Document.new
doc << REXML::XMLDecl.new('1.0', 'UTF-8')
#... |
github | hjanuschka/fastlane-plugin-aws_device_farm | https://github.com/hjanuschka/fastlane-plugin-aws_device_farm | spec/spec_helper.rb | Ruby | mit | 87 | master | 384 | $LOAD_PATH.unshift File.expand_path('../lib', __dir__)
# This module is only used to check the environment is currently a testing env
module SpecHelper
end
require 'fastlane' # to import the Action super class
require 'fastlane/plugin/aws_device_farm' # import the actual plugin
Fastlane.load_actions # load other act... |
github | postmodern/rubygems-tasks | https://github.com/postmodern/rubygems-tasks | Gemfile | Ruby | mit | 87 | main | 241 | source 'https://rubygems.org'
gemspec
group :development do
gem 'rake'
gem 'rspec', '~> 3.0'
gem 'redcarpet', platform: :mri
gem 'kramdown'
gem 'yard', '~> 0.9'
gem 'yard-spellcheck', require: false
end |
github | postmodern/rubygems-tasks | https://github.com/postmodern/rubygems-tasks | Rakefile | Ruby | mit | 87 | main | 409 | require 'rubygems'
require 'rake'
lib_dir = File.expand_path('lib',File.dirname(__FILE__))
$LOAD_PATH << lib_dir unless $LOAD_PATH.include?(lib_dir)
require 'rubygems/tasks'
Gem::Tasks.new(
build: {gem: true, tar: true},
sign: {checksum: true, pgp: true}
)
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.n... |
github | postmodern/rubygems-tasks | https://github.com/postmodern/rubygems-tasks | rubygems-tasks.gemspec | Ruby | mit | 87 | main | 2,095 | # encoding: utf-8
require 'yaml'
Gem::Specification.new do |gem|
gemspec = YAML.load_file('gemspec.yml')
gem.name = gemspec.fetch('name')
gem.version = gemspec.fetch('version') do
lib_dir = File.join(File.dirname(__FILE__),'lib')
$LOAD_PATH << lib_dir unless $LOAD_PATH.in... |
github | postmodern/rubygems-tasks | https://github.com/postmodern/rubygems-tasks | spec/console_spec.rb | Ruby | mit | 87 | main | 2,676 | require 'spec_helper'
require 'rake_context'
require 'rubygems/tasks/console'
describe Gem::Tasks::Console do
describe "#console" do
include_context "rake"
let(:default_options) { %w[-Ilib -rrubygems/tasks] }
let(:custom_command) { 'ripl' }
let(:custom_options) { %w[-Ivendor -rfoo] }... |
github | postmodern/rubygems-tasks | https://github.com/postmodern/rubygems-tasks | spec/sign_spec.rb | Ruby | mit | 87 | main | 1,265 | require 'spec_helper'
require 'rake_context'
require 'rubygems/tasks/sign'
describe Gem::Tasks::Sign do
include_context "rake"
describe "#initialize" do
context "when given no keyword arguments" do
it "must not initialize #checksum by default" do
expect(subject.checksum).to be(nil)
end
... |
github | postmodern/rubygems-tasks | https://github.com/postmodern/rubygems-tasks | spec/tasks_spec.rb | Ruby | mit | 87 | main | 2,013 | require 'spec_helper'
require 'rake_context'
require 'rubygems/tasks'
describe Gem::Tasks do
include_context "rake"
describe "#initialize" do
context "when given no keyword arguments" do
describe '#build' do
subject { super().build }
it { is_expected.to be_a(Gem::Tasks::Build) }
... |
github | postmodern/rubygems-tasks | https://github.com/postmodern/rubygems-tasks | spec/push_spec.rb | Ruby | mit | 87 | main | 998 | require 'spec_helper'
require 'rake_context'
require 'rubygems/tasks/push'
describe Gem::Tasks::Push do
describe "#push" do
include_context "rake"
let(:path) { 'pkg/foo-1.2.3.gem' }
context "defaults" do
it "must use `gem push`" do
expect(subject).to receive(:run).with('gem', 'push', pat... |
github | postmodern/rubygems-tasks | https://github.com/postmodern/rubygems-tasks | spec/spec_helper.rb | Ruby | mit | 87 | main | 727 | require 'rspec'
require 'fileutils'
require 'tmpdir'
# clear the $RUBYCONSOLE env variable
ENV.delete('RUBYCONSOLE')
RSpec.configure do |rspec|
rspec.before(:suite) do
PROJECTS_DIR = Dir.mktmpdir('rubygems-tasks')
Dir[File.join(File.dirname(__FILE__),'projects','*')].each do |src|
dest = File.join(PR... |
github | postmodern/rubygems-tasks | https://github.com/postmodern/rubygems-tasks | spec/install_spec.rb | Ruby | mit | 87 | main | 441 | require 'spec_helper'
require 'rake_context'
require 'rubygems/tasks/install'
describe Gem::Tasks::Install do
describe "#install" do
let(:path) { 'pkg/foo-1.2.3.gem' }
it "must use `gem install -q`" do
if defined?(Bundler)
expect(Bundler).to receive(:with_original_env).and_yield()
end
... |
github | postmodern/rubygems-tasks | https://github.com/postmodern/rubygems-tasks | spec/project_spec.rb | Ruby | mit | 87 | main | 4,192 | require 'spec_helper'
require 'rubygems/tasks/project'
describe Gem::Tasks::Project do
let(:rubygems_project_dir) { File.join(PROJECTS_DIR,'rubygems-project') }
let(:rubygems_project) { described_class.new(rubygems_project_dir) }
let(:rubygems_multi_project_dir) do
File.join(PROJECTS_DIR,'rubygems-mult... |
github | postmodern/rubygems-tasks | https://github.com/postmodern/rubygems-tasks | spec/scm_spec.rb | Ruby | mit | 87 | main | 1,790 | require 'spec_helper'
require 'rake_context'
require 'rubygems/tasks/scm'
describe Gem::Tasks::SCM do
include_context "rake"
describe "#initialize" do
context "when given no keyword arguments" do
it "must initialize #status by default" do
expect(subject.status).to be_a(Gem::Tasks::SCM::Status)
... |
github | postmodern/rubygems-tasks | https://github.com/postmodern/rubygems-tasks | spec/build_spec.rb | Ruby | mit | 87 | main | 1,724 | require 'spec_helper'
require 'rake_context'
require 'rubygems/tasks/build'
describe Gem::Tasks::Build do
include_context "rake"
describe "#initialize" do
context "when given no keyword arguments" do
it "must initialize #gem by default" do
expect(subject.gem).to be_a(Gem::Tasks::Build::Gem)
... |
github | postmodern/rubygems-tasks | https://github.com/postmodern/rubygems-tasks | spec/scm/tag_spec.rb | Ruby | mit | 87 | main | 2,787 | require 'spec_helper'
require 'rake_context'
require 'rubygems/tasks/scm/tag'
describe Gem::Tasks::SCM::Tag do
include_context "rake"
let(:version) { '1.2.3' }
describe "#version_tag" do
context "when #format is #{described_class}::DEFAULT_FORMAT" do
it "must have a 'v' prefix" do
expect(sub... |
github | postmodern/rubygems-tasks | https://github.com/postmodern/rubygems-tasks | spec/scm/push_spec.rb | Ruby | mit | 87 | main | 942 | require 'spec_helper'
require 'rake_context'
require 'rubygems/tasks/scm/push'
describe Gem::Tasks::SCM::Push do
describe "#push!" do
context "when the project's SCM type is :git" do
it "must run `git push --tags`" do
allow(subject.project).to receive(:scm).and_return(:git)
expect(subject)... |
github | postmodern/rubygems-tasks | https://github.com/postmodern/rubygems-tasks | spec/scm/status_spec.rb | Ruby | mit | 87 | main | 1,100 | require 'spec_helper'
require 'rake_context'
require 'rubygems/tasks/scm/status'
describe Gem::Tasks::SCM::Status do
include_context "rake"
describe "#status" do
context "when the project's SCM type is :git" do
it "must run `git status --untracked-files=no`" do
allow(subject.project).to receive... |
github | postmodern/rubygems-tasks | https://github.com/postmodern/rubygems-tasks | spec/projects/bundler-project/bundler-project.gemspec | Ruby | mit | 87 | main | 731 | # -*- encoding: utf-8 -*-
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'bundler-project/version'
Gem::Specification.new do |gem|
gem.authors = ["Postmodern"]
gem.email = ["postmodern.mod3@gmail.com"]
gem.description = %q{An example Rub... |
github | postmodern/rubygems-tasks | https://github.com/postmodern/rubygems-tasks | spec/projects/rubygems-project/rubygems-project.gemspec | Ruby | mit | 87 | main | 730 | # -*- encoding: utf-8 -*-
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'rubygems/project/version'
Gem::Specification.new do |gem|
gem.name = "rubygems-project"
gem.version = Rubygems::Project::VERSION
gem.authors = ["Postmodern"]
... |
github | postmodern/rubygems-tasks | https://github.com/postmodern/rubygems-tasks | spec/projects/rubygems-multi-project/rubygems-project-lite.gemspec | Ruby | mit | 87 | main | 659 | # -*- encoding: utf-8 -*-
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'rubygems/project/version'
Gem::Specification.new do |gem|
gem.name = "rubygems-project-lite"
gem.version = Rubygems::Project::VERSION
gem.authors = ["Postmode... |
github | postmodern/rubygems-tasks | https://github.com/postmodern/rubygems-tasks | spec/sign/pgp_spec.rb | Ruby | mit | 87 | main | 433 | require 'spec_helper'
require 'rake_context'
require 'rubygems/tasks/sign/pgp'
describe Gem::Tasks::Sign::PGP do
describe "#sign" do
include_context "rake"
let(:path) { File.join('pkg','foo-1.2.3.gem') }
it "must run `gpg --sign --detach-sign --armor ...`" do
expect(subject).to receive(:run).wit... |
github | postmodern/rubygems-tasks | https://github.com/postmodern/rubygems-tasks | lib/rubygems/tasks.rb | Ruby | mit | 87 | main | 4,156 | # frozen_string_literal: true
require_relative 'tasks/console'
require_relative 'tasks/build'
require_relative 'tasks/install'
require_relative 'tasks/scm'
require_relative 'tasks/push'
require_relative 'tasks/release'
require_relative 'tasks/sign'
require 'rake/tasklib'
module Gem
#
# Defines basic Rake tasks f... |
github | postmodern/rubygems-tasks | https://github.com/postmodern/rubygems-tasks | lib/rubygems/tasks/scm.rb | Ruby | mit | 87 | main | 1,093 | # frozen_string_literal: true
require_relative 'scm/status'
require_relative 'scm/tag'
require_relative 'scm/push'
module Gem
class Tasks
class SCM
# The {Status scm:status} task.
#
# @return [Status, nil]
#
# @since 0.3.0
attr_reader :status
# The {Tag scm:tag} task.... |
github | postmodern/rubygems-tasks | https://github.com/postmodern/rubygems-tasks | lib/rubygems/tasks/push.rb | Ruby | mit | 87 | main | 1,864 | # frozen_string_literal: true
require_relative 'task'
module Gem
class Tasks
#
# The `push` task.
#
class Push < Task
# The rubygems host to push gems to.
#
# @return [String, nil]
attr_accessor :host
# The rubygems API key.
#
# @return [String, nil]
... |
github | postmodern/rubygems-tasks | https://github.com/postmodern/rubygems-tasks | lib/rubygems/tasks/sign.rb | Ruby | mit | 87 | main | 843 | # frozen_string_literal: true
require_relative 'sign/checksum'
require_relative 'sign/pgp'
module Gem
class Tasks
class Sign
# The {Checksum sign:checksum} task.
#
# @return [Checksum, nil]
#
# @since 0.3.0
attr_reader :checksum
# The {PGP sign:pgp} task.
#
... |
github | postmodern/rubygems-tasks | https://github.com/postmodern/rubygems-tasks | lib/rubygems/tasks/printing.rb | Ruby | mit | 87 | main | 2,192 | # frozen_string_literal: true
module Gem
class Tasks
#
# Provides helper methods for printing messages.
#
# @api semipublic
#
module Printing
# ANSI 'bright' color code
ANSI_BRIGHT = "\e[1m"
# ANSI 'clear' color code
ANSI_CLEAR = "\e[0m"
# ANSI 'green' color c... |
github | postmodern/rubygems-tasks | https://github.com/postmodern/rubygems-tasks | lib/rubygems/tasks/console.rb | Ruby | mit | 87 | main | 2,273 | # frozen_string_literal: true
require_relative 'task'
module Gem
class Tasks
#
# The `console` task.
#
class Console < Task
# The default Interactive Ruby Console
DEFAULT_CONSOLE = 'irb'
# The default command to run
DEFAULT_COMMAND = (ENV['RUBYCONSOLE'] || DEFAULT_CONSOLE)
... |
github | postmodern/rubygems-tasks | https://github.com/postmodern/rubygems-tasks | lib/rubygems/tasks/build.rb | Ruby | mit | 87 | main | 1,235 | # frozen_string_literal: true
require_relative 'build/tar'
require_relative 'build/gem'
require_relative 'build/zip'
module Gem
class Tasks
#
# Collection of all `build:*` tasks.
#
# * {Build::Gem build:gem}
# * {Build::Tar build:tar}
# * {Build::Zip build:zip}
#
class Build
#... |
github | postmodern/rubygems-tasks | https://github.com/postmodern/rubygems-tasks | lib/rubygems/tasks/project.rb | Ruby | mit | 87 | main | 3,218 | # frozen_string_literal: true
require 'set'
module Gem
class Tasks
#
# @api private
#
class Project
# Supported SCMs and their control directories.
SCM_DIRS = {
git: '.git',
hg: '.hg',
svn: '.svn'
}
# The `pkg/` directory.
PKG_DIR = 'pkg'
... |
github | postmodern/rubygems-tasks | https://github.com/postmodern/rubygems-tasks | lib/rubygems/tasks/release.rb | Ruby | mit | 87 | main | 853 | # frozen_string_literal: true
require_relative 'task'
module Gem
class Tasks
#
# The `release` task.
#
class Release < Task
#
# Initializes the `release` task.
#
def initialize
super()
yield self if block_given?
define
end
#
# Defi... |
github | postmodern/rubygems-tasks | https://github.com/postmodern/rubygems-tasks | lib/rubygems/tasks/task.rb | Ruby | mit | 87 | main | 3,495 | # frozen_string_literal: true
require_relative 'project'
require_relative 'printing'
require 'rake/tasklib'
module Gem
class Tasks
class Task < Rake::TaskLib
include Printing
#
# Project metadata.
#
# @return [Project]
#
attr_reader :project
#
# Initiali... |
github | postmodern/rubygems-tasks | https://github.com/postmodern/rubygems-tasks | lib/rubygems/tasks/install.rb | Ruby | mit | 87 | main | 1,174 | # frozen_string_literal: true
require_relative 'task'
module Gem
class Tasks
#
# The `install` task.
#
class Install < Task
#
# Initializes the `install` task.
#
def initialize
super()
yield self if block_given?
define
end
#
# Defi... |
github | postmodern/rubygems-tasks | https://github.com/postmodern/rubygems-tasks | lib/rubygems/tasks/sign/checksum.rb | Ruby | mit | 87 | main | 2,715 | # frozen_string_literal: true
require_relative 'task'
require 'digest'
module Gem
class Tasks
class Sign
#
# The `sign:checksum` task.
#
class Checksum < Task
# Enables or disables MD5 checksums.
#
# @return [Boolean]
attr_writer :md5
# Enables ... |
github | postmodern/rubygems-tasks | https://github.com/postmodern/rubygems-tasks | lib/rubygems/tasks/sign/task.rb | Ruby | mit | 87 | main | 1,266 | # frozen_string_literal: true
require_relative '../task'
require 'digest'
module Gem
class Tasks
class Sign
class Task < Tasks::Task
#
# Defines signing tasks for the various packages.
#
# @param [Symbol] name
# The name for the `sign:` task.
#
d... |
github | postmodern/rubygems-tasks | https://github.com/postmodern/rubygems-tasks | lib/rubygems/tasks/sign/pgp.rb | Ruby | mit | 87 | main | 829 | # frozen_string_literal: true
require_relative 'task'
module Gem
class Tasks
class Sign
#
# The `sign:pgp` task.
#
class PGP < Task
#
# Initializes the `sign` task.
#
def initialize
super()
yield self if block_given?
define
... |
github | postmodern/rubygems-tasks | https://github.com/postmodern/rubygems-tasks | lib/rubygems/tasks/build/tar.rb | Ruby | mit | 87 | main | 883 | # frozen_string_literal: true
require_relative 'task'
module Gem
class Tasks
class Build
#
# The `build:tar` task.
#
class Tar < Task
#
# Initializes the `build:tar` task.
#
def initialize
super()
yield self if block_given?
... |
github | postmodern/rubygems-tasks | https://github.com/postmodern/rubygems-tasks | lib/rubygems/tasks/build/zip.rb | Ruby | mit | 87 | main | 865 | # frozen_string_literal: true
require_relative 'task'
module Gem
class Tasks
class Build
#
# The `build:zip` task.
#
class Zip < Task
#
# Initializes the `build:zip` task.
#
def initialize
super()
yield self if block_given?
... |
github | postmodern/rubygems-tasks | https://github.com/postmodern/rubygems-tasks | lib/rubygems/tasks/build/task.rb | Ruby | mit | 87 | main | 1,466 | # frozen_string_literal: true
require_relative '../task'
module Gem
class Tasks
class Build
class Task < Tasks::Task
#
# @param [String] path
#
# @param [Gem::Specification] gemspec
#
# @abstract
#
def build(path,gemspec)
end
... |
github | postmodern/rubygems-tasks | https://github.com/postmodern/rubygems-tasks | lib/rubygems/tasks/build/gem.rb | Ruby | mit | 87 | main | 1,334 | # frozen_string_literal: true
require_relative 'task'
if Gem::VERSION > '2.' then require 'rubygems/package'
else require 'rubygems/builder'
end
module Gem
class Tasks
class Build
#
# The `build:gem` task.
#
class Gem < Task
#
# Initializes the `b... |
github | postmodern/rubygems-tasks | https://github.com/postmodern/rubygems-tasks | lib/rubygems/tasks/scm/tag.rb | Ruby | mit | 87 | main | 4,431 | # frozen_string_literal: true
require_relative '../task'
module Gem
class Tasks
class SCM
#
# The `scm:tag` task.
#
class Tag < Task
# Default format for versions
DEFAULT_FORMAT = 'v%s'
# The format for version tags.
#
# @return [String, Proc]
... |
github | postmodern/rubygems-tasks | https://github.com/postmodern/rubygems-tasks | lib/rubygems/tasks/scm/push.rb | Ruby | mit | 87 | main | 1,150 | # frozen_string_literal: true
require_relative '../task'
module Gem
class Tasks
class SCM
#
# The `scm:push` task.
#
class Push < Task
#
# Initializes the `scm:push` task.
#
def initialize
super()
yield self if block_given?
... |
github | postmodern/rubygems-tasks | https://github.com/postmodern/rubygems-tasks | lib/rubygems/tasks/scm/status.rb | Ruby | mit | 87 | main | 1,746 | # frozen_string_literal: true
require_relative '../task'
module Gem
class Tasks
class SCM
#
# The `scm:status` task.
#
class Status < Task
#
# Initializes the `status` task.
#
def initialize
super()
yield self if block_given?
... |
github | eki-177/abyme | https://github.com/eki-177/abyme | Rakefile | Ruby | mit | 87 | master | 1,256 | # require "bundler/gem_tasks"
require "rspec/core/rake_task"
# require 'rails/dummy/tasks'
RSpec::Core::RakeTask.new(:spec)
task :default => :spec
# APP_RAKEFILE = File.expand_path("spec/dummy/Rakefile", __dir__)
# load 'rails/tasks/engine.rake'
# load 'rails/tasks/statistics.rake'
# Bundler::GemHelper.install_tasks... |
github | eki-177/abyme | https://github.com/eki-177/abyme | abyme.gemspec | Ruby | mit | 87 | master | 2,224 | lib = File.expand_path("lib", __dir__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require "abyme/version"
Gem::Specification.new do |spec|
spec.name = "abyme"
spec.version = Abyme::VERSION::STRING
spec.authors = ["Romain Sanson", "Louis Sommer"]
spec.email = ["louis.so... |
github | eki-177/abyme | https://github.com/eki-177/abyme | lib/abyme.rb | Ruby | mit | 87 | master | 236 | require "abyme/version"
require 'abyme/view_helpers'
require 'abyme/engine'
require 'abyme/controller'
require 'abyme/action_view_extensions/builder'
module Abyme
class Error < StandardError; end
autoload :Model, 'abyme/model'
end |
github | eki-177/abyme | https://github.com/eki-177/abyme | lib/generators/abyme/stimulus/stimulus_generator.rb | Ruby | mit | 87 | master | 543 | require 'rails/generators'
module Abyme
module Generators
class StimulusGenerator < Rails::Generators::Base
source_root File.expand_path('templates', __dir__)
def add_to_stimulus
insert_into_file(stimulus_file_path, "\nimport { AbymeController } from 'abyme';\n")
insert_into_file(sti... |
github | eki-177/abyme | https://github.com/eki-177/abyme | lib/generators/abyme/controller/controller_generator.rb | Ruby | mit | 87 | master | 616 | require 'rails/generators'
module Abyme
module Generators
class ControllerGenerator < Rails::Generators::NamedBase
source_root File.expand_path('templates', __dir__)
def insert_abyme_attributes_in_strong_params
return unless File.exists? controller_file_path
insert_into_file(
... |
github | eki-177/abyme | https://github.com/eki-177/abyme | lib/generators/abyme/view/view_generator.rb | Ruby | mit | 87 | master | 1,966 | require "rails/generators"
module Abyme
module Generators
class ViewGenerator < Rails::Generators::Base
source_root File.expand_path("templates", __dir__)
argument :association, type: :string, required: true, banner: "association association"
argument :attributes, type: :array, default: [], ba... |
github | eki-177/abyme | https://github.com/eki-177/abyme | lib/generators/abyme/model/model_generator.rb | Ruby | mit | 87 | master | 2,041 | require 'rails/generators'
module Abyme
module Generators
class ModelGenerator < Rails::Generators::NamedBase
source_root File.expand_path('templates', __dir__)
argument :association, type: :string, required: true, banner: "association association"
argument :attributes, type: :array, default: ... |
github | eki-177/abyme | https://github.com/eki-177/abyme | lib/generators/abyme/resource/resource_generator.rb | Ruby | mit | 87 | master | 642 | require 'rails/generators'
module Abyme
module Generators
class ResourceGenerator < Rails::Generators::NamedBase
source_root File.expand_path('templates', __dir__)
argument :association, type: :string, required: true, banner: "association association"
argument :attributes, type: :array, defaul... |
github | eki-177/abyme | https://github.com/eki-177/abyme | lib/abyme/abyme_builder.rb | Ruby | mit | 87 | master | 1,547 | module Abyme
class AbymeBuilder < ActionView::Base
include ActionView
# If a block is given to the #abymize helper
# it will instanciate a new AbymeBuilder
# and pass to it the association name (Symbol)
# the form object, lookup_context optionaly a partial path
# then yield itself to the bloc... |
github | eki-177/abyme | https://github.com/eki-177/abyme | lib/abyme/view_helpers.rb | Ruby | mit | 87 | master | 10,534 | require_relative "abyme_builder"
module Abyme
module ViewHelpers
# ABYME_FOR
# this helper will generate the top level wrapper markup
# with the bare minimum html attributes (data-controller="abyme")
# it takes the Symbolized name of the association (plural) and the form object
# then you can pa... |
github | eki-177/abyme | https://github.com/eki-177/abyme | lib/abyme/model.rb | Ruby | mit | 87 | master | 3,472 | module Abyme
module Model
module ClassMethods
def abymize(association, permit: nil, reject: nil, class_name: nil, **options)
default_options = {reject_if: :all_blank, allow_destroy: true}
nested_attributes_options = default_options.merge(options)
accepts_nested_attributes_for associa... |
github | eki-177/abyme | https://github.com/eki-177/abyme | lib/abyme/engine.rb | Ruby | mit | 87 | master | 310 | module Abyme
class Engine < ::Rails::Engine
isolate_namespace Abyme
config.after_initialize do
ActiveSupport.on_load :action_view do
include Abyme::ViewHelpers
end
ActiveSupport.on_load :action_controller do
include Abyme::Controller
end
end
end
end |
github | eki-177/abyme | https://github.com/eki-177/abyme | lib/abyme/controller.rb | Ruby | mit | 87 | master | 284 | module Abyme
module Controller
def abyme_attributes
return [] if resource_class.nil?
resource_class.abyme_attributes
end
private
def resource_class
self.class.name.match(/(.*)(Controller)/)[1].singularize.safe_constantize
end
end
end |
github | eki-177/abyme | https://github.com/eki-177/abyme | lib/abyme/action_view_extensions/builder.rb | Ruby | mit | 87 | master | 348 | module Abyme
module ActionViewExtensions
module Builder
def abyme_for(association, options = {}, &block)
@template.abyme_for(association, self, options, &block)
end
alias :abymize :abyme_for
end
end
end
module ActionView::Helpers
class FormBuilder
include Abyme::ActionViewE... |
github | eki-177/abyme | https://github.com/eki-177/abyme | spec/spec_helper.rb | Ruby | mit | 87 | master | 4,836 | # This file was generated by the `rails generate rspec:install` command. Conventionally, all
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
# The generated `.rspec` file contains `--require spec_helper` which will cause
# this file to always be loaded, without a need to explicitly require ... |
github | eki-177/abyme | https://github.com/eki-177/abyme | spec/rails_helper.rb | Ruby | mit | 87 | master | 2,843 | # This file is copied to spec/ when you run 'rails generate rspec:install'
require "simplecov"
require "simplecov-lcov"
SimpleCov.formatter = SimpleCov::Formatter::LcovFormatter
SimpleCov::Formatter::LcovFormatter.config do |c|
c.report_with_single_file = true
c.single_report_path = "coverage/lcov.info"
end
Simp... |
github | eki-177/abyme | https://github.com/eki-177/abyme | spec/dummy/app/models/task.rb | Ruby | mit | 87 | master | 437 | class Task < ApplicationRecord
include Abyme::Model
belongs_to :project
has_many :comments, inverse_of: :task, dependent: :destroy
abymize :comments, permit: :all_attributes
has_many :attachments, as: :attachable
abymize :attachments, reject: [:name]
validates :title, presence: true
validates :descr... |
github | eki-177/abyme | https://github.com/eki-177/abyme | spec/dummy/app/models/project.rb | Ruby | mit | 87 | master | 696 | class Project < ApplicationRecord
include Abyme::Model
has_many :tasks, inverse_of: :project, dependent: :destroy
abymize :tasks, permit: [:description, :title]
has_many :admin_tasks, class_name: "Admin::Task"
abymize :admin_tasks, permit: [:description, :title], class_name: "Admin::Task"
has_many :comme... |
github | eki-177/abyme | https://github.com/eki-177/abyme | spec/dummy/app/models/admin/test.rb | Ruby | mit | 87 | master | 266 | module Admin
class Test < ApplicationRecord
include Abyme::Model
has_many :comments, through: :tasks
has_many :participants
abymize :participants, permit: [:email, :name]
has_many :meetings
has_many :attachments, as: :attachable
end
end |
github | eki-177/abyme | https://github.com/eki-177/abyme | spec/dummy/app/models/admin/project.rb | Ruby | mit | 87 | master | 277 | module Admin
class Admin::Project < ApplicationRecord
has_many :tasks, inverse_of: :project, dependent: :destroy
has_many :comments, through: :tasks
has_many :participants
validates :title, presence: true
validates :description, presence: true
end
end |
github | eki-177/abyme | https://github.com/eki-177/abyme | spec/dummy/app/controllers/tasks_controller.rb | Ruby | mit | 87 | master | 368 | class TasksController < ApplicationController
def index
@tasks = Task.all
@task = Task.new
end
def new
@task = Task.new
end
def create
@task = Task.new(task_params)
@task.save ? redirect_to(tasks_path) : render(:new)
end
private
def task_params
params.require(:task).permit(ab... |
github | eki-177/abyme | https://github.com/eki-177/abyme | spec/dummy/app/controllers/projects_controller.rb | Ruby | mit | 87 | master | 635 | class ProjectsController < ApplicationController
def index
@projects = Project.all
@project = Project.new
end
def new
@project = Project.new
@collection = [1, 2, 3]
end
def create
@project = Project.new(project_params)
@project.save ? redirect_to(projects_path) : render(:new)
end
d... |
github | eki-177/abyme | https://github.com/eki-177/abyme | spec/dummy/app/controllers/admin/super_admin/projects_controller.rb | Ruby | mit | 87 | master | 752 | module Admin
module SuperAdmin
class ProjectsController < ApplicationController
def index
@projects = Project.all
@project = Project.new
end
def new
@project = Project.new
end
def create
@project = Project.new(project_params)
@project.save ? ... |
github | eki-177/abyme | https://github.com/eki-177/abyme | spec/dummy/db/schema.rb | Ruby | mit | 87 | master | 3,139 | # This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# This file is the source Rails uses to define your schema when running `bin/rai... |
github | eki-177/abyme | https://github.com/eki-177/abyme | spec/dummy/db/migrate/20210219153047_create_attachments.rb | Ruby | mit | 87 | master | 227 | class CreateAttachments < ActiveRecord::Migration[6.0]
def change
create_table :attachments do |t|
t.references :attachable, polymorphic: true, null: false
t.string :name
t.timestamps
end
end
end |
github | eki-177/abyme | https://github.com/eki-177/abyme | spec/dummy/db/migrate/20210623160659_create_admin_tasks.rb | Ruby | mit | 87 | master | 299 | class CreateAdminTasks < ActiveRecord::Migration[6.0]
def change
create_table :admin_tasks do |t|
t.string :title
t.string :description
t.references :project, index: true
t.timestamps
end
add_foreign_key :admin_tasks, :projects, column: :project_id
end
end |
github | eki-177/abyme | https://github.com/eki-177/abyme | spec/dummy/db/migrate/20201009214839_create_participants.rb | Ruby | mit | 87 | master | 227 | class CreateParticipants < ActiveRecord::Migration[6.0]
def change
create_table :participants do |t|
t.string :email
t.references :project, null: false, foreign_key: true
t.timestamps
end
end
end |
github | eki-177/abyme | https://github.com/eki-177/abyme | spec/dummy/db/migrate/20201006141154_create_comments.rb | Ruby | mit | 87 | master | 218 | class CreateComments < ActiveRecord::Migration[6.0]
def change
create_table :comments do |t|
t.string :content
t.references :task, null: false, foreign_key: true
t.timestamps
end
end
end |
github | eki-177/abyme | https://github.com/eki-177/abyme | spec/dummy/db/migrate/20210219152453_create_meetings.rb | Ruby | mit | 87 | master | 249 | class CreateMeetings < ActiveRecord::Migration[6.0]
def change
create_table :meetings do |t|
t.string :start_time
t.string :end_time
t.references :project, null: false, foreign_key: true
t.timestamps
end
end
end |
github | eki-177/abyme | https://github.com/eki-177/abyme | spec/dummy/db/migrate/20201006141122_create_tasks.rb | Ruby | mit | 87 | master | 262 | class CreateTasks < ActiveRecord::Migration[6.0]
def change
create_table :tasks do |t|
t.string :title
t.text :description
t.string :status
t.references :project, null: false, foreign_key: true
t.timestamps
end
end
end |
github | eki-177/abyme | https://github.com/eki-177/abyme | spec/dummy/config/routes.rb | Ruby | mit | 87 | master | 284 | Rails.application.routes.draw do
# For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html
resources :projects, only: %i[index show new create edit update destroy]
resources :tasks, only: [:new, :create]
root to: "projects#new"
end |
github | eki-177/abyme | https://github.com/eki-177/abyme | spec/dummy/config/application.rb | Ruby | mit | 87 | master | 968 | 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_view/railtie"
require "sprockets/railtie"
# Require the gems listed in Gemfile, including any gems
# y... |
github | eki-177/abyme | https://github.com/eki-177/abyme | spec/dummy/config/initializers/simple_form.rb | Ruby | mit | 87 | master | 7,227 | # frozen_string_literal: true
#
# Uncomment this and change the path if necessary to include your own
# components.
# See https://github.com/heartcombo/simple_form#custom-components to know
# more about custom components.
# Dir[Rails.root.join('lib/components/**/*.rb')].each { |f| require f }
#
# Use this setup block ... |
github | eki-177/abyme | https://github.com/eki-177/abyme | spec/dummy/config/environments/test.rb | Ruby | mit | 87 | master | 1,578 | # 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 suite and is wiped
# and recreated between test runs. Don't rely on the data there!
Rails.application.configure do
# Settings... |
github | eki-177/abyme | https://github.com/eki-177/abyme | spec/dummy/config/environments/production.rb | Ruby | mit | 87 | master | 4,355 | Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# Code is not reloaded between requests.
config.cache_classes = true
# Eager load code on boot. This eager loads most of Rails and
# your application in memory, allowing both threaded web serve... |
github | eki-177/abyme | https://github.com/eki-177/abyme | spec/dummy/config/environments/development.rb | Ruby | mit | 87 | master | 1,638 | Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
# since you don't have to restart the web serv... |
github | eki-177/abyme | https://github.com/eki-177/abyme | spec/models/task_spec.rb | Ruby | mit | 87 | master | 962 | require 'rails_helper'
RSpec.describe Task, type: :model do
describe '::abyme_params' do
# In Task : abymize :comments
it 'correctly builds a hash of authorized attributes for a single level of nesting' do
comments_attributes = [:content, :id, :_destroy, :task_id]
task_attributes = Task.abyme_attri... |
github | eki-177/abyme | https://github.com/eki-177/abyme | spec/models/project_spec.rb | Ruby | mit | 87 | master | 2,851 | require "rails_helper"
RSpec.describe Project, type: :model do
describe "::abyme_params" do
it "correctly builds a hash of authorized attributes with several levels of nesting" do
tasks_attributes = [:description, :title, :id, :_destroy]
comments_attributes = [:content, :id, :_destroy, :task_id]
... |
github | eki-177/abyme | https://github.com/eki-177/abyme | spec/generators/abyme/stimulus_generator_spec.rb | Ruby | mit | 87 | master | 824 | require "rails_helper"
require "generators/abyme/stimulus/stimulus_generator"
RSpec.describe Abyme::Generators::StimulusGenerator, type: :generator do
p File.expand_path("../dummy/", __dir__)
destination File.expand_path("../../dummy/", __dir__)
it "registers the Stimulus controller in controllers index" do
... |
github | eki-177/abyme | https://github.com/eki-177/abyme | spec/generators/abyme/resource_generator_spec.rb | Ruby | mit | 87 | master | 1,933 | require "rails_helper"
require "generators/abyme/resource/resource_generator"
RSpec.describe Abyme::Generators::ResourceGenerator, type: :generator do
destination File.expand_path("../../dummy/", __dir__)
before(:all) do
copy_test_model
copy_tests_controller
# For a parent model Test that has many att... |
github | eki-177/abyme | https://github.com/eki-177/abyme | spec/generators/abyme/model_generator_spec.rb | Ruby | mit | 87 | master | 2,666 | require 'rails_helper'
require 'generators/abyme/model/model_generator'
RSpec.describe Abyme::Generators::ModelGenerator, type: :generator do
destination File.expand_path("../../dummy/", __dir__)
before(:all) do
copy_test_model
end
context "with no arguments" do
before(:all) do
copy_test_model... |
github | eki-177/abyme | https://github.com/eki-177/abyme | spec/generators/abyme/controller_generator_spec.rb | Ruby | mit | 87 | master | 1,106 | require "rails_helper"
require "generators/abyme/controller/controller_generator"
RSpec.describe Abyme::Generators::ControllerGenerator, type: :generator do
p File.expand_path("../dummy/", __dir__)
destination File.expand_path("../../dummy/", __dir__)
arguments %w[tests]
before(:all) do
copy_tests_control... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.