Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: tomichj/invitation
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0.1.0
Choose a base ref
...
head repository: tomichj/invitation
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing with 1,154 additions and 736 deletions.
  1. +2 −0 .gitignore
  2. +24 −0 .rubocop.yml
  3. +1 −1 .ruby-version
  4. +20 −8 .travis.yml
  5. +15 −0 Appraisals
  6. +119 −2 CHANGELOG.md
  7. +59 −0 CONTRIBUTING.md
  8. +0 −1 Gemfile
  9. +0 −159 Gemfile.lock
  10. +57 −6 README.md
  11. +22 −2 Rakefile
  12. +88 −93 app/controllers/invitation/invites_controller.rb
  13. +36 −0 app/forms/invitation/invite_form.rb
  14. +2 −1 app/mailers/invite_mailer.rb
  15. +15 −4 app/models/invite.rb
  16. +0 −1 app/views/invites/new.html.erb
  17. +25 −0 config/locales/invitation.pt-BR.yml
  18. +7 −0 gemfiles/4.2.gemfile
  19. +7 −0 gemfiles/5.0.gemfile
  20. +7 −0 gemfiles/5.2.gemfile
  21. +7 −0 gemfiles/6.0.gemfile
  22. +15 −11 invitation.gemspec
  23. +4 −1 lib/generators/invitation/controllers/controllers_generator.rb
  24. +13 −8 lib/generators/invitation/helpers.rb
  25. +9 −26 lib/generators/invitation/install/install_generator.rb
  26. +1 −1 lib/generators/invitation/install/templates/db/migrate/create_invites.rb
  27. +2 −2 lib/generators/invitation/install/templates/invitation.rb
  28. +1 −5 lib/generators/invitation/routes/routes_generator.rb
  29. +1 −2 lib/generators/invitation/views/views_generator.rb
  30. +1 −0 lib/invitation.rb
  31. +53 −11 lib/invitation/configuration.rb
  32. +13 −3 lib/invitation/engine.rb
  33. +33 −37 lib/invitation/invitable.rb
  34. +16 −19 lib/invitation/user.rb
  35. +6 −16 lib/invitation/user_registration.rb
  36. +1 −1 lib/invitation/version.rb
  37. +0 −4 lib/tasks/invitation_tasks.rake
  38. +0 −167 spec/controllers/invites_controller_spec.rb
  39. +0 −28 spec/dummy/README.rdoc
  40. +4 −0 spec/dummy/app/controllers/companies_controller.rb
  41. +0 −4 spec/dummy/app/controllers/company_controller.rb
  42. +8 −0 spec/dummy/app/views/companies/show.html.erb
  43. +1 −1 spec/dummy/bin/rails
  44. +17 −12 spec/dummy/bin/setup
  45. +29 −0 spec/dummy/bin/update
  46. +5 −1 spec/dummy/config/application.rb
  47. +2 −2 spec/dummy/config/environments/test.rb
  48. +2 −1 spec/dummy/config/initializers/invitation.rb
  49. +1 −4 spec/dummy/config/routes.rb
  50. +5 −7 spec/dummy/db/schema.rb
  51. +1 −1 spec/factories/companies.rb
  52. +4 −7 spec/factories/invites.rb
  53. +1 −2 spec/factories/projects.rb
  54. +2 −6 spec/factories/users.rb
  55. +33 −0 spec/features/create_invite_spec.rb
  56. +29 −0 spec/features/new_invite_spec.rb
  57. +4 −6 spec/mailers/invite_mailer_spec.rb
  58. +45 −26 spec/models/configuration_spec.rb
  59. +2 −6 spec/models/invitable_spec.rb
  60. +19 −5 spec/models/invite_spec.rb
  61. +2 −3 spec/models/user_registration_spec.rb
  62. +1 −5 spec/models/user_spec.rb
  63. +33 −0 spec/requests/invite_existing_user_spec.rb
  64. +49 −0 spec/requests/invite_one_user_spec.rb
  65. +50 −0 spec/requests/invite_two_users_spec.rb
  66. +50 −0 spec/requests/multiple_invites_spec.rb
  67. +41 −17 spec/spec_helper.rb
  68. +32 −0 spec/support/requests/request_helpers.rb
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -7,3 +7,5 @@ spec/dummy/db/*.sqlite3-journal
spec/dummy/log/*.log
spec/dummy/tmp/
spec/dummy/.sass-cache
/.idea/
*emfile.lock
24 changes: 24 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
AllCops:
Exclude:
- 'bin/rails'
- 'spec/dummy/**/*'
- 'lib/generators/invitation/install/templates/db/migrate/**/*'

Metrics/LineLength:
Max: 120

Documentation:
Exclude:
- 'lib/generators/**/*'

Metrics/MethodLength:
Exclude:
- 'app/controllers/invitation/invites_controller.rb'

Metrics/AbcSize:
Exclude:
- 'app/controllers/invitation/invites_controller.rb'

Lint/IneffectiveAccessModifier:
Exclude:
- 'lib/generators/invitation/**/*'
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.3.0
2.6.0
28 changes: 20 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,26 @@
language: ruby
cache: bundler

language:
- ruby

rvm:
- 2.1.8
- 2.2.4
- 2.3.0
- 2.2.2
- 2.3.3
- 2.6.0

#branches:
# only:
# - master

gemfile:
- gemfiles/4.2.gemfile
- gemfiles/5.0.gemfile
- gemfiles/5.2.gemfile
- gemfiles/6.0.gemfile

branches:
only:
- master
#install:
# - 'bin/setup'

sudo: false

script: bundle exec rspec --color --format documentation
#script: bundle exec rspec --color --format documentation
15 changes: 15 additions & 0 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
appraise "4.2" do
gem "rails", "~> 4.2.0"
end

appraise "5.0" do
gem "rails", "~> 5.0.0"
end

appraise "5.2" do
gem "rails", "~> 5.2.0"
end

appraise "6.0" do
gem "rails", "~> 6.0.0"
end
121 changes: 119 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,121 @@
# Invitation Changelog


## [0.6.1] - October 1, 2019

### Fix: generator support for rails 6.0
- fixed migration_version in generators to support rails 5 and above
- Appraisal entry and gemfile for Rails 6.0.0
- bumped gemspec to include rails 6.0.0
- switched from factory_girl to factory_bot

[0.6.1]: https://github.com/tomichj/invitation/compare/0.6.0...0.6.1


## [0.6.0] - May 1, 2019

### Feature: support for rails 6.0
- added Appraisal entry and gemfile for 6.0.0rc1
- bumped gemspec to include rails 6.0.0rc1
- bumped version

[0.6.0]: https://github.com/tomichj/invitation/compare/0.5.1...0.6.0


## [0.5.1] - June 7, 2018

### Feature: support for rails 5.2
- added Appraisal entry and gemfile for 5.2
- added rakefile tasks for build and release
- bumped gemspec to include rails 5.2
- bumped version
- added sqlite3.represent_boolean_as_integer = true to dummy app for specs
- specs now test for http status 201 instead of :success and :created,
:success was deprecated, switched to 201 for brevity and longevity of test

[0.5.1]: https://github.com/tomichj/invitation/compare/0.5.0...0.5.1


## [0.5.0] - March 12, 2018

### API change
- `InviteForm` extracted from invites_controller.rb, added at `app/forms/invitation/invite_form.rb`
- `controllers_generator.rb` now has three targets: `create_controllers`, `create_mailers`, and `create_forms`
- deleted empty `lib/tasks/invitation_tasks.rake`

[0.5.0]: https://github.com/tomichj/invitation/compare/0.4.5...0.5.0


## [0.4.5] - March 9, 2018

### Bugfix:
- migration versioned for Rails >= 5

[0.4.5]: https://github.com/tomichj/invitation/compare/0.4.4...0.4.5


## [0.4.4] - September 30, 2017
- recipient association optional for Rails >= 5

[0.4.4]: https://github.com/tomichj/invitation/compare/0.4.3...0.4.4


## [0.4.3] - July 1, 2017

### API change
- configuration.user_model now accepts the user class (with a warning), or the user class name (a String)

[0.4.3]: https://github.com/tomichj/invitation/compare/0.4.2...0.4.3


## [0.4.2] - July 1, 2017

### API change
- accept a string for configuration.user_model and constantize it

[0.4.2]: https://github.com/tomichj/invitation/compare/0.4.1...0.4.2


## [0.4.1] - April 26, 2017

### Bugfix:
- added case_insensitive_email to template used by install generator

[0.4.1]: https://github.com/tomichj/invitation/compare/0.4...0.4.1


## [0.4] - April 26, 2017

### Feature:
- added case_sensitive_email configuration option.

[0.4]: https://github.com/tomichj/invitation/compare/0.3...0.4


## [0.3] - March 26, 2017

### Feature:
- Added support for Rails 5.1

[0.3]: https://github.com/tomichj/invitation/compare/0.2...0.3


## [0.2] - October 17, 2016

### Feature:
- adding pt-BR locale file and fixing an init bug.

[0.2]: https://github.com/tomichj/invitation/compare/0.1.1...0.2


## [0.1.1] - April 21, 2016

### Internal changes:
- invites controller now users a Form object, form accepts :email or :emails, builds one invite per email address.

[0.1.1]: https://github.com/tomichj/invitation/compare/0.1.0...0.1.1


## [0.1.0] - April 18, 2016

* `invites#create` supports :email or emails:[] in request, via html or json.
@@ -10,7 +126,7 @@
* fixed invitation view generator packaging
* significantly more tests

[0.0.3]: https://github.com/tomichj/invitation/compare/0.0.2...0.1.0
[0.1.0]: https://github.com/tomichj/invitation/compare/0.0.2...0.1.0


## [0.0.2] - April 11, 2016
@@ -24,4 +140,5 @@

## 0.0.1 - April 9, 2016

Initial release.
Initial release.

59 changes: 59 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Contributing

I love pull requests. I'm trying to keep it as easy as possible to contribute changes. There
are just a couple of guidelines to follow to help me stay on top of things.


## Let's talk

Whether you're fixing a bug or adding a feature, feel free to talk to me first on
[twitter](https://twitter.com/JustinTomich). We can make sure the change isn't already
underway somewhere else.


## Getting started

* Make sure you have a [GitHub account](https://github.com/signup/free)
* Open a [New Issue](https://github.com/tomichj/invitation/issues) on github for your change,
assuming one does not already exist. If one already exists, join the conversation.
* Fork the repository on GitHub.

## Setup

Clone the repo:

`git clone https://github.com/<your-username>/invitation`

CD into your clone and run bundler install:

`cd invitation && bundle install`

Make sure the tests pass:

`rake`

Make your change. Add tests for your change. Make sure the tests pass:

`rake`

I use `rubocop` to maintain ruby coding style. Install and run it like so:

```sh
gem install rubocop
rubocop
```

Once you resolve any issues rubocop finds, you're ready to go. Push your fork and
[submit a pull request](https://github.com/tomichj/invitation/compare/).

The ball is now in my court. I'll try to comment on your pull request within a couple of business days
(hopefully the same day).

Things you can do to increase the speed of acceptance:

* talk to me ahead of time
* write tests
* follow the [ruby style guide](https://github.com/bbatsov/ruby-style-guide)
* write a good [commit message](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)

Thanks very much!
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -12,4 +12,3 @@ gemspec

# To use a debugger
# gem 'byebug', group: [:development, :test]

Loading