Skip to content

Commit 471fb53

Browse files
committed
Add specs configuration
1 parent a172192 commit 471fb53

File tree

82 files changed

+1706
-4
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+1706
-4
lines changed

.gitignore

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
1-
_misc/
2-
Gemfile.lock
1+
*.gem
32
*.orig
43

4+
/.rspec_failures
5+
/Gemfile.lock
6+
7+
/_misc/
8+
/coverage/
9+
/spec/dummy/db/*.sqlite3*
10+
/spec/dummy/log/
11+
/spec/dummy/storage/
12+
/spec/dummy/tmp/

.rspec

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
--require rails_helper
2+
--format documentation
3+
--profile

activeadmin_dynamic_fields.gemspec

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,18 @@ Gem::Specification.new do |spec|
1414
spec.email = '[email protected]'
1515
spec.homepage = 'https://github.com/blocknotes/activeadmin_dynamic_fields'
1616

17-
spec.files = `git ls-files -z`.split("\x0")
17+
spec.files = Dir['{app,lib}/**/*', 'LICENSE.txt', 'Rakefile', 'README.md']
1818
spec.require_paths = ['lib']
1919

20-
spec.add_runtime_dependency 'activeadmin', '>= 1.0'
20+
spec.add_runtime_dependency 'activeadmin', '~> 2.0'
21+
22+
spec.add_development_dependency 'activestorage', '~> 6.0.3.2'
23+
spec.add_development_dependency 'capybara', '~> 3.33.0'
24+
spec.add_development_dependency 'pry', '~> 0.13.1'
25+
spec.add_development_dependency 'puma', '~> 4.3.5'
26+
spec.add_development_dependency 'rspec_junit_formatter', '~> 0.4.1'
27+
spec.add_development_dependency 'rspec-rails', '~> 4.0.1'
28+
spec.add_development_dependency 'selenium-webdriver', '~> 3.142.7'
29+
spec.add_development_dependency 'simplecov', '~> 0.19.0'
30+
spec.add_development_dependency 'sqlite3', '~> 1.4.2'
2131
end

bin/rails

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/usr/bin/env ruby
2+
# frozen_string_literal: true
3+
4+
#
5+
# This file was generated by Bundler.
6+
#
7+
# The application 'rails' is installed as part of a gem, and
8+
# this file is here to facilitate running it.
9+
#
10+
11+
require "pathname"
12+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
13+
Pathname.new(__FILE__).realpath)
14+
15+
bundle_binstub = File.expand_path("../bundle", __FILE__)
16+
17+
if File.file?(bundle_binstub)
18+
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
19+
load(bundle_binstub)
20+
else
21+
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
22+
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
23+
end
24+
end
25+
26+
require "rubygems"
27+
require "bundler/setup"
28+
29+
load Gem.bin_path("railties", "rails")

bin/rake

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/usr/bin/env ruby
2+
# frozen_string_literal: true
3+
4+
#
5+
# This file was generated by Bundler.
6+
#
7+
# The application 'rake' is installed as part of a gem, and
8+
# this file is here to facilitate running it.
9+
#
10+
11+
require "pathname"
12+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
13+
Pathname.new(__FILE__).realpath)
14+
15+
bundle_binstub = File.expand_path("../bundle", __FILE__)
16+
17+
if File.file?(bundle_binstub)
18+
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
19+
load(bundle_binstub)
20+
else
21+
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
22+
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
23+
end
24+
end
25+
26+
require "rubygems"
27+
require "bundler/setup"
28+
29+
load Gem.bin_path("rake", "rake")

bin/rspec

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/usr/bin/env ruby
2+
# frozen_string_literal: true
3+
4+
#
5+
# This file was generated by Bundler.
6+
#
7+
# The application 'rspec' is installed as part of a gem, and
8+
# this file is here to facilitate running it.
9+
#
10+
11+
require "pathname"
12+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
13+
Pathname.new(__FILE__).realpath)
14+
15+
bundle_binstub = File.expand_path("../bundle", __FILE__)
16+
17+
if File.file?(bundle_binstub)
18+
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
19+
load(bundle_binstub)
20+
else
21+
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
22+
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
23+
end
24+
end
25+
26+
require "rubygems"
27+
require "bundler/setup"
28+
29+
load Gem.bin_path("rspec-core", "rspec")

spec/dummy/.ruby-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ruby-2.7.1

spec/dummy/.tool-versions

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ruby 2.6.6

spec/dummy/Rakefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Add your own tasks in files placed in lib/tasks ending in .rake,
2+
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3+
4+
require_relative 'config/application'
5+
6+
Rails.application.load_tasks

spec/dummy/app/admin/authors.rb

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# frozen_string_literal: true
2+
3+
ActiveAdmin.register Author do
4+
menu priority: 1
5+
6+
permit_params :name, :email, :age, :avatar, profile_attributes: %i[id description _destroy]
7+
8+
index do
9+
selectable_column
10+
id_column
11+
column :name
12+
column :email
13+
column :created_at
14+
actions
15+
end
16+
17+
filter :name
18+
filter :created_at
19+
20+
show do
21+
attributes_table do
22+
row :name
23+
row :email
24+
row :age
25+
row :avatar do |record|
26+
image_tag url_for(record.avatar), style: 'max-width:800px;max-height:500px' if record.avatar.attached?
27+
end
28+
row :created_at
29+
row :updated_at
30+
row :profile
31+
end
32+
active_admin_comments
33+
end
34+
35+
form do |f|
36+
f.inputs do
37+
f.input :name
38+
f.input :email
39+
f.input :age
40+
f.input :avatar,
41+
as: :file,
42+
hint: (object.avatar.attached? ? "Current: #{object.avatar.filename}" : nil)
43+
end
44+
f.has_many :profile, allow_destroy: true do |ff|
45+
ff.input :description
46+
end
47+
f.actions
48+
end
49+
end

0 commit comments

Comments
 (0)