git_models 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.dependabot/config.yml +10 -0
- data/.github/workflows/gem_release.yml +37 -0
- data/.gitignore +61 -0
- data/.jenkins/Jenkinsfile +80 -0
- data/.jenkins/ruby_build_pod.yml +18 -0
- data/.rspec +3 -0
- data/.rubocop.yml +51 -0
- data/Appraisals +14 -0
- data/CHANGELOG.md +25 -0
- data/Gemfile +25 -0
- data/Gemfile.lock +237 -0
- data/README.md +6 -0
- data/Rakefile +28 -0
- data/app/models/concerns/branch.rb +55 -0
- data/app/models/concerns/commit.rb +44 -0
- data/app/models/concerns/repository.rb +28 -0
- data/app/models/concerns/user.rb +33 -0
- data/gemfiles/.bundle/config +2 -0
- data/gemfiles/rails_4.gemfile +26 -0
- data/gemfiles/rails_5.gemfile +26 -0
- data/gemfiles/rails_6.gemfile +26 -0
- data/git_models.gemspec +27 -0
- data/lib/git_models.rb +6 -0
- data/lib/git_models/test_helpers.rb +60 -0
- data/lib/git_models/version.rb +5 -0
- data/spec/dummy/Rakefile +6 -0
- data/spec/dummy/app/assets/config/manifest.js +3 -0
- data/spec/dummy/app/assets/javascripts/application.js +16 -0
- data/spec/dummy/app/assets/javascripts/cable.js +13 -0
- data/spec/dummy/app/assets/stylesheets/application.css +15 -0
- data/spec/dummy/app/controllers/application_controller.rb +4 -0
- data/spec/dummy/app/helpers/application_helper.rb +4 -0
- data/spec/dummy/app/models/application_record.rb +7 -0
- data/spec/dummy/app/models/branch.rb +8 -0
- data/spec/dummy/app/models/commit.rb +8 -0
- data/spec/dummy/app/models/repository.rb +8 -0
- data/spec/dummy/app/models/user.rb +8 -0
- data/spec/dummy/app/views/layouts/application.html.erb +15 -0
- data/spec/dummy/app/views/layouts/mailer.html.erb +13 -0
- data/spec/dummy/app/views/layouts/mailer.text.erb +1 -0
- data/spec/dummy/bin/bundle +3 -0
- data/spec/dummy/bin/rails +4 -0
- data/spec/dummy/bin/rake +4 -0
- data/spec/dummy/bin/setup +36 -0
- data/spec/dummy/bin/spring +16 -0
- data/spec/dummy/bin/update +31 -0
- data/spec/dummy/bin/yarn +11 -0
- data/spec/dummy/config.ru +7 -0
- data/spec/dummy/config/application.rb +25 -0
- data/spec/dummy/config/boot.rb +5 -0
- data/spec/dummy/config/credentials.yml.enc +1 -0
- data/spec/dummy/config/database.yml +27 -0
- data/spec/dummy/config/environment.rb +8 -0
- data/spec/dummy/config/environments/development.rb +63 -0
- data/spec/dummy/config/environments/production.rb +96 -0
- data/spec/dummy/config/environments/test.rb +55 -0
- data/spec/dummy/config/initializers/application_controller_renderer.rb +10 -0
- data/spec/dummy/config/initializers/assets.rb +16 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +9 -0
- data/spec/dummy/config/initializers/content_security_policy.rb +27 -0
- data/spec/dummy/config/initializers/cookies_serializer.rb +7 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +6 -0
- data/spec/dummy/config/initializers/inflections.rb +18 -0
- data/spec/dummy/config/initializers/mime_types.rb +6 -0
- data/spec/dummy/config/initializers/session_store.rb +5 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +16 -0
- data/spec/dummy/config/locales/en.yml +33 -0
- data/spec/dummy/config/puma.rb +39 -0
- data/spec/dummy/config/routes.rb +5 -0
- data/spec/dummy/config/spring.rb +8 -0
- data/spec/dummy/config/storage.yml +34 -0
- data/spec/dummy/db/migrate/20161123065534_create_users_table.rb +16 -0
- data/spec/dummy/db/migrate/20161123184217_create_commits_repositories_branches.rb +37 -0
- data/spec/dummy/db/schema.rb +53 -0
- data/spec/dummy/spec/models/branch_spec.rb +84 -0
- data/spec/dummy/spec/models/commit_spec.rb +60 -0
- data/spec/dummy/spec/models/user_spec.rb +64 -0
- data/spec/dummy/spec/spec_helper.rb +48 -0
- metadata +231 -0
@@ -0,0 +1,15 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>Dummy</title>
|
5
|
+
<%= csrf_meta_tags %>
|
6
|
+
<%= csp_meta_tag %>
|
7
|
+
|
8
|
+
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
|
9
|
+
<%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>
|
10
|
+
</head>
|
11
|
+
|
12
|
+
<body>
|
13
|
+
<%= yield %>
|
14
|
+
</body>
|
15
|
+
</html>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= yield %>
|
data/spec/dummy/bin/rake
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'fileutils'
|
3
|
+
include FileUtils
|
4
|
+
|
5
|
+
# path to your application root.
|
6
|
+
APP_ROOT = File.expand_path('..', __dir__)
|
7
|
+
|
8
|
+
def system!(*args)
|
9
|
+
system(*args) || abort("\n== Command #{args} failed ==")
|
10
|
+
end
|
11
|
+
|
12
|
+
chdir APP_ROOT do
|
13
|
+
# This script is a starting point to setup your application.
|
14
|
+
# Add necessary setup steps to this file.
|
15
|
+
|
16
|
+
puts '== Installing dependencies =='
|
17
|
+
system! 'gem install bundler --conservative'
|
18
|
+
system('bundle check') || system!('bundle install')
|
19
|
+
|
20
|
+
# Install JavaScript dependencies if using Yarn
|
21
|
+
# system('bin/yarn')
|
22
|
+
|
23
|
+
# puts "\n== Copying sample files =="
|
24
|
+
# unless File.exist?('config/database.yml')
|
25
|
+
# cp 'config/database.yml.sample', 'config/database.yml'
|
26
|
+
# end
|
27
|
+
|
28
|
+
puts "\n== Preparing database =="
|
29
|
+
system! 'bin/rails db:setup'
|
30
|
+
|
31
|
+
puts "\n== Removing old logs and tempfiles =="
|
32
|
+
system! 'bin/rails log:clear tmp:clear'
|
33
|
+
|
34
|
+
puts "\n== Restarting application server =="
|
35
|
+
system! 'bin/rails restart'
|
36
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
# This file loads spring without using Bundler, in order to be fast.
|
4
|
+
# It gets overwritten when you run the `spring binstub` command.
|
5
|
+
|
6
|
+
unless defined?(Spring)
|
7
|
+
require 'rubygems'
|
8
|
+
require 'bundler'
|
9
|
+
|
10
|
+
lockfile = Bundler::LockfileParser.new(Bundler.default_lockfile.read)
|
11
|
+
if spring = lockfile.specs.detect { |spec| spec.name == "spring" }
|
12
|
+
Gem.use_paths Gem.dir, Bundler.bundle_path.to_s, *Gem.path
|
13
|
+
gem 'spring', spring.version
|
14
|
+
require 'spring/binstub'
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'fileutils'
|
3
|
+
include FileUtils
|
4
|
+
|
5
|
+
# path to your application root.
|
6
|
+
APP_ROOT = File.expand_path('..', __dir__)
|
7
|
+
|
8
|
+
def system!(*args)
|
9
|
+
system(*args) || abort("\n== Command #{args} failed ==")
|
10
|
+
end
|
11
|
+
|
12
|
+
chdir APP_ROOT do
|
13
|
+
# This script is a way to update your development environment automatically.
|
14
|
+
# Add necessary update steps to this file.
|
15
|
+
|
16
|
+
puts '== Installing dependencies =='
|
17
|
+
system! 'gem install bundler --conservative'
|
18
|
+
system('bundle check') || system!('bundle install')
|
19
|
+
|
20
|
+
# Install JavaScript dependencies if using Yarn
|
21
|
+
# system('bin/yarn')
|
22
|
+
|
23
|
+
puts "\n== Updating database =="
|
24
|
+
system! 'bin/rails db:migrate'
|
25
|
+
|
26
|
+
puts "\n== Removing old logs and tempfiles =="
|
27
|
+
system! 'bin/rails log:clear tmp:clear'
|
28
|
+
|
29
|
+
puts "\n== Restarting application server =="
|
30
|
+
system! 'bin/rails restart'
|
31
|
+
end
|
data/spec/dummy/bin/yarn
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
APP_ROOT = File.expand_path('..', __dir__)
|
3
|
+
Dir.chdir(APP_ROOT) do
|
4
|
+
begin
|
5
|
+
exec "yarnpkg", *ARGV
|
6
|
+
rescue Errno::ENOENT
|
7
|
+
$stderr.puts "Yarn executable was not detected in the system."
|
8
|
+
$stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install"
|
9
|
+
exit 1
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative 'boot'
|
4
|
+
|
5
|
+
require 'rails/all'
|
6
|
+
require 'active_model/validations/presence'
|
7
|
+
|
8
|
+
# Require the gems listed in Gemfile, including any gems
|
9
|
+
# you've limited to :test, :development, or :production.
|
10
|
+
Bundler.require(*Rails.groups)
|
11
|
+
require 'git_models'
|
12
|
+
|
13
|
+
module Dummy
|
14
|
+
class Application < Rails::Application
|
15
|
+
if Rails::VERSION::MAJOR >= 5
|
16
|
+
# Initialize configuration defaults for originally generated Rails version.
|
17
|
+
config.load_defaults "#{Rails::VERSION::MAJOR}.#{Rails::VERSION::MINOR}"
|
18
|
+
end
|
19
|
+
|
20
|
+
# Settings in config/environments/* take precedence over those specified here.
|
21
|
+
# Application configuration can go into files in config/initializers
|
22
|
+
# -- all .rb files in that directory are automatically loaded after loading
|
23
|
+
# the framework and any gems in your application.
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
t8z4eFuU7T5YWiEsC9Bzk16tdVgcrBoRDkG9XzFOyApvhHAbLyQoE7yHfvPQ1E9492Z8fqDHhEQd5kfoPqkJytfllACFUQ5wlMxntGUSvDLp4+CTeRvwFUnN75tzW++Mje9DthDntFWfDe71YVAJ4RGDWIPt+c473RD4LLZ+yxKaKWoaOmESQYnDIS2SkbVsOrFp9MvzDM2Cteppri035Sgqoa6t7Z37kTgZUZQKi3bG3ZgSynp9sakeUq+NYz/2HBytSRAnwdCL+Wef6VziZMBObu66qmPMI7uyk5Lrmz6TJHfqF40TXdbogNIIWikKr6RYSpQ98uc+ouEEA23TlyD5N8j8eVGTQ/3d8PJXM4fpCTZvc56F77PJtRnnZv7RQO1oirk72UAdVQsgH8AfRn4docy16ABqj5rH--nth4fkWiYWvENdXl--c8sRRbICwGDQNoBfvMZpqg==
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# SQLite version 3.x
|
2
|
+
# gem install sqlite3
|
3
|
+
#
|
4
|
+
# Ensure the SQLite 3 gem is defined in your Gemfile
|
5
|
+
# gem 'sqlite3'
|
6
|
+
#
|
7
|
+
default: &default
|
8
|
+
adapter: sqlite3
|
9
|
+
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
|
10
|
+
timeout: 5000
|
11
|
+
|
12
|
+
development:
|
13
|
+
<<: *default
|
14
|
+
database: db/development.sqlite3
|
15
|
+
|
16
|
+
# Warning: The database defined as "test" will be erased and
|
17
|
+
# re-generated from your development database when you run "rake".
|
18
|
+
# Do not set this db to the same as development or production.
|
19
|
+
|
20
|
+
# Note: Put DATABASE_SUFFIX value into the test database name so Appraisal can run those tests in parallel
|
21
|
+
test:
|
22
|
+
<<: *default
|
23
|
+
database: db/test-<%= ENV['DATABASE_SUFFIX'] %>.sqlite3
|
24
|
+
|
25
|
+
production:
|
26
|
+
<<: *default
|
27
|
+
database: db/production.sqlite3
|
@@ -0,0 +1,63 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
Rails.application.configure do
|
4
|
+
# Settings specified here will take precedence over those in config/application.rb.
|
5
|
+
|
6
|
+
# In the development environment your application's code is reloaded on
|
7
|
+
# every request. This slows down response time but is perfect for development
|
8
|
+
# since you don't have to restart the web server when you make code changes.
|
9
|
+
config.cache_classes = false
|
10
|
+
|
11
|
+
# Do not eager load code on boot.
|
12
|
+
config.eager_load = false
|
13
|
+
|
14
|
+
# Show full error reports.
|
15
|
+
config.consider_all_requests_local = true
|
16
|
+
|
17
|
+
# Enable/disable caching. By default caching is disabled.
|
18
|
+
# Run rails dev:cache to toggle caching.
|
19
|
+
if Rails.root.join('tmp', 'caching-dev.txt').exist?
|
20
|
+
config.action_controller.perform_caching = true
|
21
|
+
|
22
|
+
config.cache_store = :memory_store
|
23
|
+
config.public_file_server.headers = {
|
24
|
+
'Cache-Control' => "public, max-age=#{2.days.to_i}"
|
25
|
+
}
|
26
|
+
else
|
27
|
+
config.action_controller.perform_caching = false
|
28
|
+
|
29
|
+
config.cache_store = :null_store
|
30
|
+
end
|
31
|
+
|
32
|
+
# Store uploaded files on the local file system (see config/storage.yml for options)
|
33
|
+
# config.active_storage.service = :local
|
34
|
+
|
35
|
+
# Don't care if the mailer can't send.
|
36
|
+
config.action_mailer.raise_delivery_errors = false
|
37
|
+
|
38
|
+
# config.action_mailer.perform_caching = false
|
39
|
+
|
40
|
+
# Print deprecation notices to the Rails logger.
|
41
|
+
config.active_support.deprecation = :log
|
42
|
+
|
43
|
+
# Raise an error on page load if there are pending migrations.
|
44
|
+
config.active_record.migration_error = :page_load
|
45
|
+
|
46
|
+
# Highlight code that triggered database queries in logs.
|
47
|
+
# config.active_record.verbose_query_logs = true
|
48
|
+
|
49
|
+
# Debug mode disables concatenation and preprocessing of assets.
|
50
|
+
# This option may cause significant delays in view rendering with a large
|
51
|
+
# number of complex assets.
|
52
|
+
config.assets.debug = true
|
53
|
+
|
54
|
+
# Suppress logger output for asset requests.
|
55
|
+
config.assets.quiet = true
|
56
|
+
|
57
|
+
# Raises error for missing translations
|
58
|
+
# config.action_view.raise_on_missing_translations = true
|
59
|
+
|
60
|
+
# Use an evented file watcher to asynchronously detect changes in source code,
|
61
|
+
# routes, locales, etc. This feature depends on the listen gem.
|
62
|
+
# config.file_watcher = ActiveSupport::EventedFileUpdateChecker
|
63
|
+
end
|
@@ -0,0 +1,96 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
Rails.application.configure do
|
4
|
+
# Settings specified here will take precedence over those in config/application.rb.
|
5
|
+
|
6
|
+
# Code is not reloaded between requests.
|
7
|
+
config.cache_classes = true
|
8
|
+
|
9
|
+
# Eager load code on boot. This eager loads most of Rails and
|
10
|
+
# your application in memory, allowing both threaded web servers
|
11
|
+
# and those relying on copy on write to perform better.
|
12
|
+
# Rake tasks automatically ignore this option for performance.
|
13
|
+
config.eager_load = true
|
14
|
+
|
15
|
+
# Full error reports are disabled and caching is turned on.
|
16
|
+
config.consider_all_requests_local = false
|
17
|
+
config.action_controller.perform_caching = true
|
18
|
+
|
19
|
+
# Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"]
|
20
|
+
# or in config/master.key. This key is used to decrypt credentials (and other encrypted files).
|
21
|
+
# config.require_master_key = true
|
22
|
+
|
23
|
+
# Disable serving static files from the `/public` folder by default since
|
24
|
+
# Apache or NGINX already handles this.
|
25
|
+
config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
|
26
|
+
|
27
|
+
# Compress JavaScripts and CSS.
|
28
|
+
config.assets.js_compressor = :uglifier
|
29
|
+
# config.assets.css_compressor = :sass
|
30
|
+
|
31
|
+
# Do not fallback to assets pipeline if a precompiled asset is missed.
|
32
|
+
config.assets.compile = false
|
33
|
+
|
34
|
+
# `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
|
35
|
+
|
36
|
+
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
|
37
|
+
# config.action_controller.asset_host = 'http://assets.example.com'
|
38
|
+
|
39
|
+
# Specifies the header that your server uses for sending files.
|
40
|
+
# config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
|
41
|
+
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
|
42
|
+
|
43
|
+
# Store uploaded files on the local file system (see config/storage.yml for options)
|
44
|
+
config.active_storage.service = :local
|
45
|
+
|
46
|
+
# Mount Action Cable outside main process or domain
|
47
|
+
# config.action_cable.mount_path = nil
|
48
|
+
# config.action_cable.url = 'wss://example.com/cable'
|
49
|
+
# config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ]
|
50
|
+
|
51
|
+
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
52
|
+
# config.force_ssl = true
|
53
|
+
|
54
|
+
# Use the lowest log level to ensure availability of diagnostic information
|
55
|
+
# when problems arise.
|
56
|
+
config.log_level = :debug
|
57
|
+
|
58
|
+
# Prepend all log lines with the following tags.
|
59
|
+
config.log_tags = [ :request_id ]
|
60
|
+
|
61
|
+
# Use a different cache store in production.
|
62
|
+
# config.cache_store = :mem_cache_store
|
63
|
+
|
64
|
+
# Use a real queuing backend for Active Job (and separate queues per environment)
|
65
|
+
# config.active_job.queue_adapter = :resque
|
66
|
+
# config.active_job.queue_name_prefix = "dummy_#{Rails.env}"
|
67
|
+
|
68
|
+
config.action_mailer.perform_caching = false
|
69
|
+
|
70
|
+
# Ignore bad email addresses and do not raise email delivery errors.
|
71
|
+
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
|
72
|
+
# config.action_mailer.raise_delivery_errors = false
|
73
|
+
|
74
|
+
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
75
|
+
# the I18n.default_locale when a translation cannot be found).
|
76
|
+
config.i18n.fallbacks = true
|
77
|
+
|
78
|
+
# Send deprecation notices to registered listeners.
|
79
|
+
config.active_support.deprecation = :notify
|
80
|
+
|
81
|
+
# Use default logging formatter so that PID and timestamp are not suppressed.
|
82
|
+
config.log_formatter = ::Logger::Formatter.new
|
83
|
+
|
84
|
+
# Use a different logger for distributed setups.
|
85
|
+
# require 'syslog/logger'
|
86
|
+
# config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')
|
87
|
+
|
88
|
+
if ENV["RAILS_LOG_TO_STDOUT"].present?
|
89
|
+
logger = ActiveSupport::Logger.new(STDOUT)
|
90
|
+
logger.formatter = config.log_formatter
|
91
|
+
config.logger = ActiveSupport::TaggedLogging.new(logger)
|
92
|
+
end
|
93
|
+
|
94
|
+
# Do not dump schema after migrations.
|
95
|
+
config.active_record.dump_schema_after_migration = false
|
96
|
+
end
|