-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Marten Klitzke
committed
Dec 1, 2018
1 parent
324bbd1
commit 55b86ae
Showing
37 changed files
with
928 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
# https://github.com/bbatsov/rubocop/blob/master/config/default.yml | ||
AllCops: | ||
Exclude: | ||
- 'node_modules/**/*' | ||
- 'db/**/*' | ||
- 'tmp/**/*' | ||
- 'vendor/**/*' | ||
- 'bin/**/*' | ||
- 'log/**/*' | ||
- 'Brewfile' | ||
- 'Rakefile' | ||
|
||
Rails: | ||
Enabled: true | ||
|
||
Style/Documentation: | ||
Enabled: false # for now | ||
|
||
Style/Lambda: | ||
Enabled: false | ||
|
||
Style/RaiseArgs: | ||
Enabled: false | ||
|
||
Naming/FileName: | ||
Enabled: false | ||
|
||
# User.all.map do |user| | ||
# [user.name, user.children.map(&:names)] | ||
# end.flatten.map do |name| | ||
# name.capitalize | ||
# end.join(", ") | ||
Style/MultilineBlockChain: | ||
Enabled: false | ||
|
||
# [ | ||
# "foo", | ||
# "bar", | ||
# ] | ||
Style/TrailingCommaInArrayLiteral: | ||
Enabled: false | ||
|
||
Style/TrailingCommaInHashLiteral: | ||
Enabled: false | ||
|
||
Layout/RescueEnsureAlignment: | ||
Enabled: false | ||
|
||
Style/AccessModifierDeclarations: | ||
EnforcedStyle: inline | ||
|
||
Metrics/LineLength: | ||
Enabled: false | ||
|
||
Metrics/ClassLength: | ||
Enabled: false | ||
|
||
Metrics/MethodLength: | ||
Max: 40 | ||
|
||
Metrics/BlockLength: | ||
Enabled: false | ||
|
||
Metrics/AbcSize: | ||
Enabled: false | ||
|
||
Metrics/PerceivedComplexity: | ||
Enabled: false | ||
|
||
Style/ParallelAssignment: | ||
Enabled: false | ||
|
||
Metrics/CyclomaticComplexity: | ||
Max: 10 | ||
|
||
# `fail` is seldom/never seen in Ruby code. | ||
# https://github.com/bbatsov/ruby-style-guide/issues/233 | ||
Style/SignalException: | ||
EnforcedStyle: only_raise | ||
|
||
# Would complain about `new_record?` otherwise | ||
Style/TrivialAccessors: | ||
ExactNameMatch: true | ||
|
||
Rails/Delegate: | ||
Exclude: | ||
- lib/**/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
2.3.1 | ||
2.5.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'bundler/setup' | ||
Bundler::GemHelper.install_tasks | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,28 @@ | ||
# coding: utf-8 | ||
lib = File.expand_path('../lib', __FILE__) | ||
# frozen_string_literal: true | ||
|
||
lib = File.expand_path('lib', __dir__) | ||
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) | ||
require 'dynamic_fields_for_rails/version' | ||
|
||
Gem::Specification.new do |spec| | ||
spec.name = "dynamic_fields_for_rails" | ||
spec.name = 'dynamic_fields_for_rails' | ||
spec.version = DynamicFieldsForRails::VERSION | ||
spec.authors = ["Marten Klitzke"] | ||
spec.email = ["[email protected]"] | ||
spec.authors = ['Marten Klitzke'] | ||
spec.email = ['[email protected]'] | ||
spec.description = 'Dynamic fields helper for Rails.' | ||
spec.summary = 'Helper for nested forms with dynamic fields.' | ||
spec.homepage = "https://github.com/mortik/dynamic_fields_for_rails" | ||
spec.license = "MIT" | ||
spec.homepage = 'https://github.com/mortik/dynamic_fields_for_rails' | ||
spec.license = 'MIT' | ||
|
||
spec.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR) | ||
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) } | ||
spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) | ||
spec.require_paths = ["lib"] | ||
spec.require_paths = ['lib'] | ||
|
||
spec.add_development_dependency "bundler", "~> 1.3" | ||
spec.add_development_dependency "rake", '~> 0' | ||
spec.add_development_dependency "mocha", '~> 0' | ||
spec.add_development_dependency "sqlite3", '~> 0' | ||
spec.add_development_dependency 'bundler', '~> 1.3' | ||
spec.add_development_dependency 'mocha', '~> 1' | ||
spec.add_development_dependency 'rake', '~> 12' | ||
spec.add_development_dependency 'sqlite3', '~> 1' | ||
|
||
spec.add_dependency "rails", '>= 3.0.0', '< 6.0.0' | ||
spec.add_dependency 'rails', '>= 3.0.0', '< 6.0.0' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,20 @@ | ||
require "dynamic_fields_for_rails/version" | ||
# frozen_string_literal: true | ||
|
||
require 'dynamic_fields_for_rails/version' | ||
|
||
# rubocop:disable Style/ClassVars | ||
module DynamicFieldsForRails | ||
class Engine < Rails::Engine | ||
end | ||
|
||
mattr_accessor :add_css_classes | ||
@@add_css_classes = "add_fields" | ||
@@add_css_classes = 'add_fields' | ||
|
||
mattr_accessor :delete_css_classes | ||
@@delete_css_classes = "remove_fields" | ||
@@delete_css_classes = 'remove_fields' | ||
|
||
def self.setup | ||
yield self | ||
end | ||
end | ||
# rubocop:enable Style/ClassVars |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
module DynamicFieldsForRails | ||
VERSION = "0.7.0".freeze | ||
VERSION = '0.7.0' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
# frozen_string_literal: true | ||
|
||
# Add your own tasks in files placed in lib/tasks ending in .rake, | ||
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. | ||
|
||
require File.expand_path('../config/application', __FILE__) | ||
require File.expand_path('config/application', __dir__) | ||
require 'rake' | ||
|
||
Dummy::Application.load_tasks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
class ApplicationController < ActionController::Base | ||
protect_from_forgery | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
# frozen_string_literal: true | ||
|
||
module ApplicationHelper | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
class ApplicationRecord < ActiveRecord::Base | ||
self.abstract_class = true | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
class Child < ActiveRecord::Base | ||
# frozen_string_literal: true | ||
|
||
class Child < ApplicationRecord | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
class Parent < ActiveRecord::Base | ||
# frozen_string_literal: true | ||
|
||
class Parent < ApplicationRecord | ||
has_many :children | ||
accepts_nested_attributes_for :children, allow_destroy: true | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'rubygems' | ||
gemfile = File.expand_path('../../../../Gemfile', __FILE__) | ||
gemfile = File.expand_path('../../../Gemfile', __dir__) | ||
|
||
if File.exist?(gemfile) | ||
ENV['BUNDLE_GEMFILE'] = gemfile | ||
require 'bundler' | ||
Bundler.setup | ||
end | ||
|
||
$LOAD_PATH.unshift File.expand_path('../../../../lib', __FILE__) | ||
$LOAD_PATH.unshift File.expand_path('../../../lib', __dir__) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
# frozen_string_literal: true | ||
|
||
# Load the rails application | ||
require File.expand_path('../application', __FILE__) | ||
require File.expand_path('application', __dir__) | ||
|
||
# Initialize the rails application | ||
Dummy::Application.initialize! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.