Skip to content

Commit

Permalink
Merge pull request #3 from joshsoftware/gem_configuration_setup
Browse files Browse the repository at this point in the history
Gem configuration setup
  • Loading branch information
Shwetakale authored Feb 16, 2020
2 parents 347545d + 17c6935 commit 1b23628
Show file tree
Hide file tree
Showing 18 changed files with 452 additions and 58 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ capybara-*.html
*.orig
rerun.txt
pickle-email-*.html
config/database.yml

# Ignore all logfiles and tempfiles.
/log/*
Expand Down Expand Up @@ -65,4 +66,4 @@ yarn-debug.log*

# Ignore uploaded files in development
/storage/*
!/storage/.keep
!/storage/.keep
66 changes: 66 additions & 0 deletions .overcommit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Use this file to configure the Overcommit hooks you wish to use. This will
# extend the default configuration defined in:
# https://github.com/sds/overcommit/blob/master/config/default.yml
#
# At the topmost level of this YAML file is a key representing type of hook
# being run (e.g. pre-commit, commit-msg, etc.). Within each type you can
# customize each hook, such as whether to only run it on certain files (via
# `include`), whether to only display output if it fails (via `quiet`), etc.
#
# For a complete list of hooks, see:
# https://github.com/sds/overcommit/tree/master/lib/overcommit/hook
#
# For a complete list of options that you can use to customize hooks, see:
# https://github.com/sds/overcommit#configuration
#
# Uncomment the following lines to make the configuration take effect.

#PreCommit:
# RuboCop:
# enabled: true
# on_warn: fail # Treat all warnings as failures
#
# TrailingWhitespace:
# enabled: true
# exclude:
# - '**/db/structure.sql' # Ignore trailing whitespace in generated files
#
#PostCheckout:
# ALL: # Special hook name that customizes all hooks of this type
# quiet: true # Change all post-checkout hooks to only display output on failure
#
# IndexTags:
# enabled: true # Generate a tags file with `ctags` each time HEAD changes


CommitMsg:
CapitalizedSubject:
enabled: true

EmptyMessage:
enabled: false

TrailingPeriod:
enabled: true

TextWidth:
enabled: false

PreCommit:
ALL:
on_warn: fail

AuthorEmail:
enabled: true

# AuthorName:
# enabled: true

MergeConflicts:
enabled: true

YamlSyntax:
enabled: true

BundleCheck:
enabled: true
15 changes: 15 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ gem 'jbuilder', '~> 2.7'
# gem 'redis', '~> 4.0'
# Use Active Model has_secure_password
# gem 'bcrypt', '~> 3.1.7'
gem 'simple_form'
gem 'devise', '~> 4.2'
gem 'cancancan'

# Use Active Storage variant
# gem 'image_processing', '~> 1.2'
Expand All @@ -31,6 +34,10 @@ gem 'bootsnap', '>= 1.4.2', require: false
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
gem 'database_cleaner'
gem 'factory_bot_rails', '~> 5.1', '>= 5.1.1'
# gem 'rails-controller-testing', '~> 0.0.3'
gem 'rspec-rails', '~> 4.0.0.beta3'
end

group :development do
Expand All @@ -47,8 +54,16 @@ group :test do
gem 'capybara', '>= 2.15'
gem 'selenium-webdriver'
# Easy installation and use of web drivers to run system tests with browsers
gem 'faker', '~> 1.6', '>= 1.6.6'
gem 'webdrivers'
gem 'simplecov', require: false
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]


gem 'rubocop', '~> 0.79.0', require: false
gem 'haml', '~> 5.1', '>= 5.1.2'
gem 'overcommit'
gem 'rails-i18n'
86 changes: 86 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,14 @@ GEM
zeitwerk (~> 2.2)
addressable (2.7.0)
public_suffix (>= 2.0.2, < 5.0)
ast (2.4.0)
bcrypt (3.1.13)
bindex (0.8.1)
bootsnap (1.4.5)
msgpack (~> 1.0)
builder (3.2.4)
byebug (11.1.1)
cancancan (3.0.2)
capybara (3.31.0)
addressable
mini_mime (>= 0.1.3)
Expand All @@ -74,12 +77,33 @@ GEM
childprocess (3.0.0)
concurrent-ruby (1.1.6)
crass (1.0.6)
database_cleaner (1.8.2)
devise (4.7.1)
bcrypt (~> 3.0)
orm_adapter (~> 0.1)
railties (>= 4.1.0)
responders
warden (~> 1.2.3)
diff-lcs (1.3)
docile (1.3.2)
erubi (1.9.0)
factory_bot (5.1.1)
activesupport (>= 4.2.0)
factory_bot_rails (5.1.1)
factory_bot (~> 5.1.0)
railties (>= 4.2.0)
faker (1.9.6)
i18n (>= 0.7)
ffi (1.12.2)
globalid (0.4.2)
activesupport (>= 4.2.0)
haml (5.1.2)
temple (>= 0.8.0)
tilt
i18n (1.8.2)
concurrent-ruby (~> 1.0)
iniparse (1.4.4)
jaro_winkler (1.5.4)
jbuilder (2.10.0)
activesupport (>= 5.0.0)
listen (3.1.5)
Expand All @@ -102,6 +126,13 @@ GEM
nio4r (2.5.2)
nokogiri (1.10.8)
mini_portile2 (~> 2.4.0)
orm_adapter (0.5.0)
overcommit (0.52.1)
childprocess (>= 0.6.3, < 4)
iniparse (~> 1.4)
parallel (1.19.1)
parser (2.7.0.2)
ast (~> 2.4.0)
pg (1.2.2)
public_suffix (4.0.3)
puma (4.3.1)
Expand Down Expand Up @@ -131,17 +162,49 @@ GEM
nokogiri (>= 1.6)
rails-html-sanitizer (1.3.0)
loofah (~> 2.3)
rails-i18n (6.0.0)
i18n (>= 0.7, < 2)
railties (>= 6.0.0, < 7)
railties (6.0.2.1)
actionpack (= 6.0.2.1)
activesupport (= 6.0.2.1)
method_source
rake (>= 0.8.7)
thor (>= 0.20.3, < 2.0)
rainbow (3.0.0)
rake (13.0.1)
rb-fsevent (0.10.3)
rb-inotify (0.10.1)
ffi (~> 1.0)
regexp_parser (1.6.0)
responders (3.0.0)
actionpack (>= 5.0)
railties (>= 5.0)
rspec-core (3.9.1)
rspec-support (~> 3.9.1)
rspec-expectations (3.9.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.9.0)
rspec-mocks (3.9.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.9.0)
rspec-rails (4.0.0.beta4)
actionpack (>= 4.2)
activesupport (>= 4.2)
railties (>= 4.2)
rspec-core (~> 3.9)
rspec-expectations (~> 3.9)
rspec-mocks (~> 3.9)
rspec-support (~> 3.9)
rspec-support (3.9.2)
rubocop (0.79.0)
jaro_winkler (~> 1.5.1)
parallel (~> 1.10)
parser (>= 2.7.0.1)
rainbow (>= 2.2.2, < 4.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 1.7)
ruby-progressbar (1.10.1)
ruby_dep (1.5.0)
rubyzip (2.2.0)
sass-rails (6.0.0)
Expand All @@ -157,6 +220,13 @@ GEM
selenium-webdriver (3.142.7)
childprocess (>= 0.5, < 4.0)
rubyzip (>= 1.2.2)
simple_form (5.0.2)
actionpack (>= 5.0)
activemodel (>= 5.0)
simplecov (0.18.2)
docile (~> 1.1)
simplecov-html (~> 0.11)
simplecov-html (0.12.0)
spring (2.1.0)
spring-watcher-listen (2.0.1)
listen (>= 2.7, < 4.0)
Expand All @@ -168,6 +238,7 @@ GEM
actionpack (>= 4.0)
activesupport (>= 4.0)
sprockets (>= 3.0.0)
temple (0.8.2)
thor (1.0.1)
thread_safe (0.3.6)
tilt (2.0.10)
Expand All @@ -176,6 +247,9 @@ GEM
turbolinks-source (5.2.0)
tzinfo (1.2.6)
thread_safe (~> 0.1)
unicode-display_width (1.6.1)
warden (1.2.8)
rack (>= 2.0.6)
web-console (4.0.1)
actionview (>= 6.0.0)
activemodel (>= 6.0.0)
Expand All @@ -202,14 +276,26 @@ PLATFORMS
DEPENDENCIES
bootsnap (>= 1.4.2)
byebug
cancancan
capybara (>= 2.15)
database_cleaner
devise (~> 4.2)
factory_bot_rails (~> 5.1, >= 5.1.1)
faker (~> 1.6, >= 1.6.6)
haml (~> 5.1, >= 5.1.2)
jbuilder (~> 2.7)
listen (>= 3.0.5, < 3.2)
overcommit
pg (>= 0.18, < 2.0)
puma (~> 4.1)
rails (~> 6.0.2, >= 6.0.2.1)
rails-i18n
rspec-rails (~> 4.0.0.beta3)
rubocop (~> 0.79.0)
sass-rails (>= 6)
selenium-webdriver
simple_form
simplecov
spring
spring-watcher-listen (~> 2.0.0)
turbolinks (~> 5)
Expand Down
34 changes: 34 additions & 0 deletions app/models/ability.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# frozen_string_literal: true

class Ability
include CanCan::Ability

def initialize(user)
# Define abilities for the passed in user here. For example:
#
# user ||= User.new # guest user (not logged in)
# if user.admin?
# can :manage, :all
# else
# can :read, :all
# end
#
# The first argument to `can` is the action you are giving the user
# permission to do.
# If you pass :manage it will apply to every action. Other common actions
# here are :read, :create, :update and :destroy.
#
# The second argument is the resource the user can perform the action on.
# If you pass :all it will apply to every resource. Otherwise pass a Ruby
# class of the resource.
#
# The third argument is an optional hash of conditions to further filter the
# objects.
# For example, here the user can only update published articles.
#
# can :update, Article, :published => true
#
# See the wiki for details:
# https://github.com/CanCanCommunity/cancancan/wiki/Defining-Abilities
end
end
Loading

0 comments on commit 1b23628

Please sign in to comment.