hydra-role-management 0.2.1 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.circleci/config.yml +88 -0
- data/.github_changelog_generator +2 -0
- data/.gitignore +3 -0
- data/.rspec +2 -0
- data/.rubocop.yml +51 -0
- data/CHANGELOG.md +151 -0
- data/CONTRIBUTING.md +69 -21
- data/Gemfile +42 -9
- data/LICENSE.md +14 -0
- data/README.md +63 -16
- data/Rakefile +15 -17
- data/SUPPORT.md +6 -0
- data/app/controllers/concerns/hydra/role_management/roles_behavior.rb +16 -13
- data/app/controllers/concerns/hydra/role_management/user_roles_behavior.rb +5 -2
- data/app/controllers/roles_controller.rb +3 -1
- data/app/controllers/user_roles_controller.rb +3 -2
- data/app/models/concerns/hydra/role_management/legacy_attribute_handling.rb +3 -0
- data/app/models/concerns/hydra/role_management/user_roles.rb +6 -4
- data/app/models/role.rb +10 -5
- data/app/views/roles/edit.html.erb +10 -10
- data/app/views/roles/index.html.erb +2 -2
- data/app/views/roles/new.html.erb +3 -3
- data/app/views/roles/show.html.erb +7 -7
- data/config/locales/role-management.en.yml +28 -0
- data/config/locales/role-management.es.yml +28 -0
- data/config/routes.rb +3 -2
- data/hydra-role-management.gemspec +22 -13
- data/lib/generators/roles/roles_generator.rb +40 -59
- data/lib/generators/roles/templates/hydra_role_management_rails3.rb +3 -1
- data/lib/generators/roles/templates/migrations/user_roles.rb +6 -4
- data/lib/hydra-role-management.rb +10 -3
- data/lib/hydra/role_management.rb +5 -2
- data/lib/hydra/role_management/version.rb +3 -1
- data/spec/controllers/roles_controller_spec.rb +39 -44
- data/spec/controllers/user_roles_controller_spec.rb +20 -20
- data/spec/lib/user_roles_spec.rb +21 -22
- data/spec/models/role_spec.rb +22 -21
- data/spec/routing/role_management_routes_spec.rb +29 -45
- data/spec/spec_helper.rb +14 -5
- data/spec/test_app_templates/app/models/sample.rb +8 -8
- data/spec/test_app_templates/app/models/solr_document.rb +3 -2
- data/spec/test_app_templates/config/initializers/hydra_config.rb +7 -6
- data/spec/test_app_templates/lib/generators/test_app_generator.rb +9 -12
- metadata +119 -13
- data/.travis.yml +0 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: a18af0a3d576ae69f57684ad43d907d83415877d25654b11da6385370242f3c8
|
4
|
+
data.tar.gz: 07fd2858acc275ad0b5e6fe9bdf49fbdf77ee07f74d739dc2e12a4f084d6918f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 54f3d82b070aa200abeb4b6b0feab03cc6f15b57d869c944ca99bbaf3dd569d8020e87665dd66cbe2feaab301ab1983107d93980a9cd6eec044f0d1cda3738a1
|
7
|
+
data.tar.gz: 0d91a4d3a19f8cd7edaf5bfb515bd2c0d26dd9128fdd83c23af4524fee2e56bc88d781760bb60a8b467cd2597487064da967acb1f87cf8ed1584b1ce346fdb87
|
@@ -0,0 +1,88 @@
|
|
1
|
+
---
|
2
|
+
version: 2.1
|
3
|
+
orbs:
|
4
|
+
samvera: samvera/circleci-orb@0
|
5
|
+
jobs:
|
6
|
+
test:
|
7
|
+
parameters:
|
8
|
+
ruby_version:
|
9
|
+
type: string
|
10
|
+
bundler_version:
|
11
|
+
type: string
|
12
|
+
default: 1.17.3
|
13
|
+
rails_version:
|
14
|
+
type: string
|
15
|
+
executor:
|
16
|
+
name: 'samvera/ruby_fcrepo_solr'
|
17
|
+
ruby_version: << parameters.ruby_version >>
|
18
|
+
environment:
|
19
|
+
RAILS_VERSION: << parameters.rails_version >>
|
20
|
+
NOKOGIRI_USE_SYSTEM_LIBRARIES: true
|
21
|
+
ENGINE_CART_RAILS_OPTIONS: --skip-git --skip-bundle --skip-listen --skip-spring --skip-yarn --skip-keeps --skip-action-cable --skip-coffee --skip-puma --skip-test
|
22
|
+
steps:
|
23
|
+
- samvera/cached_checkout
|
24
|
+
- samvera/bundle_for_gem:
|
25
|
+
ruby_version: << parameters.ruby_version >>
|
26
|
+
bundler_version: << parameters.bundler_version >>
|
27
|
+
project: hydra-role-management
|
28
|
+
- samvera/rubocop
|
29
|
+
- samvera/engine_cart_generate:
|
30
|
+
cache_key: v1-internal-test-app-{{ checksum "hydra-role-management.gemspec" }}-{{ checksum "spec/test_app_templates/lib/generators/test_app_generator.rb" }}-{{ checksum "lib/generators/roles/roles_generator.rb" }}-<< parameters.rails_version >>-<< parameters.ruby_version >>
|
31
|
+
- samvera/bundle_for_gem:
|
32
|
+
ruby_version: << parameters.ruby_version >>
|
33
|
+
bundler_version: << parameters.bundler_version >>
|
34
|
+
project: hydra-role-management
|
35
|
+
- samvera/parallel_rspec
|
36
|
+
- persist_to_workspace:
|
37
|
+
root: ~/
|
38
|
+
paths:
|
39
|
+
- project/*
|
40
|
+
- project/**/*
|
41
|
+
|
42
|
+
workflows:
|
43
|
+
ci:
|
44
|
+
jobs:
|
45
|
+
- test:
|
46
|
+
name: ruby2-7_rails6-0
|
47
|
+
ruby_version: 2.7.0
|
48
|
+
rails_version: 6.0.2
|
49
|
+
- test:
|
50
|
+
name: ruby2-6_rails6-0
|
51
|
+
ruby_version: 2.6.5
|
52
|
+
rails_version: 6.0.2
|
53
|
+
- test:
|
54
|
+
name: ruby2-5_rails6-0
|
55
|
+
ruby_version: 2.5.7
|
56
|
+
rails_version: 6.0.2
|
57
|
+
- test:
|
58
|
+
name: ruby2-7_rails5-2
|
59
|
+
ruby_version: 2.7.0
|
60
|
+
rails_version: 5.2.4
|
61
|
+
- test:
|
62
|
+
name: ruby2-6_rails5-2
|
63
|
+
ruby_version: 2.6.5
|
64
|
+
rails_version: 5.2.4
|
65
|
+
- test:
|
66
|
+
name: ruby2-5_rails5-2
|
67
|
+
ruby_version: 2.5.7
|
68
|
+
rails_version: 5.2.4
|
69
|
+
- test:
|
70
|
+
name: ruby2-4_rails5-2
|
71
|
+
ruby_version: 2.4.9
|
72
|
+
rails_version: 5.2.4
|
73
|
+
- test:
|
74
|
+
name: ruby2-7_rails5-1
|
75
|
+
ruby_version: 2.7.0
|
76
|
+
rails_version: 5.1.7
|
77
|
+
- test:
|
78
|
+
name: ruby2-6_rails5-1
|
79
|
+
ruby_version: 2.6.5
|
80
|
+
rails_version: 5.1.7
|
81
|
+
- test:
|
82
|
+
name: ruby2-5_rails5-1
|
83
|
+
ruby_version: 2.5.7
|
84
|
+
rails_version: 5.1.7
|
85
|
+
- test:
|
86
|
+
name: ruby2-4_rails5-1
|
87
|
+
ruby_version: 2.4.9
|
88
|
+
rails_version: 5.1.7
|
data/.gitignore
CHANGED
data/.rspec
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,51 @@
|
|
1
|
+
AllCops:
|
2
|
+
TargetRubyVersion: 2.4
|
3
|
+
|
4
|
+
Bundler/DuplicatedGem:
|
5
|
+
Exclude:
|
6
|
+
- 'Gemfile'
|
7
|
+
|
8
|
+
Metrics/BlockLength:
|
9
|
+
Exclude:
|
10
|
+
- 'spec/controllers/roles_controller_spec.rb'
|
11
|
+
- 'spec/controllers/user_roles_controller_spec.rb'
|
12
|
+
- 'spec/lib/user_roles_spec.rb'
|
13
|
+
- 'spec/models/role_spec.rb'
|
14
|
+
- 'spec/routing/role_management_routes_spec.rb'
|
15
|
+
- hydra-role-management.gemspec
|
16
|
+
|
17
|
+
Metrics/LineLength:
|
18
|
+
Exclude:
|
19
|
+
- ''
|
20
|
+
- 'lib/generators/roles/roles_generator.rb'
|
21
|
+
- 'spec/controllers/roles_controller_spec.rb'
|
22
|
+
- 'spec/controllers/user_roles_controller_spec.rb'
|
23
|
+
- 'spec/lib/user_roles_spec.rb'
|
24
|
+
- 'spec/routing/role_management_routes_spec.rb'
|
25
|
+
- 'spec/test_app_templates/config/initializers/hydra_config.rb'
|
26
|
+
|
27
|
+
Metrics/MethodLength:
|
28
|
+
Exclude:
|
29
|
+
- 'lib/generators/roles/roles_generator.rb'
|
30
|
+
|
31
|
+
Metrics/PerceivedComplexity:
|
32
|
+
Exclude:
|
33
|
+
- 'lib/generators/roles/roles_generator.rb'
|
34
|
+
|
35
|
+
Naming/FileName:
|
36
|
+
Exclude:
|
37
|
+
- 'Gemfile'
|
38
|
+
- 'hydra-role-management.gemspec'
|
39
|
+
- 'lib/hydra-role-management.rb'
|
40
|
+
|
41
|
+
Rails/HasAndBelongsToMany:
|
42
|
+
Exclude:
|
43
|
+
- 'app/models/concerns/hydra/role_management/user_roles.rb'
|
44
|
+
- 'app/models/role.rb'
|
45
|
+
|
46
|
+
RSpec/DescribeClass:
|
47
|
+
Exclude:
|
48
|
+
- 'spec/routing/role_management_routes_spec.rb'
|
49
|
+
|
50
|
+
Style/Documentation:
|
51
|
+
Enabled: false
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,151 @@
|
|
1
|
+
# Changelog
|
2
|
+
|
3
|
+
## [1.0.3](https://github.com/samvera/hydra-role-management/tree/1.0.3) (2020-06-10)
|
4
|
+
|
5
|
+
[Full Changelog](https://github.com/samvera/hydra-role-management/compare/v1.0.2...1.0.3)
|
6
|
+
|
7
|
+
**Closed issues:**
|
8
|
+
|
9
|
+
- Add support for Rails 6.0.z releases [#56](https://github.com/samvera/hydra-role-management/issues/56)
|
10
|
+
- Add support for Ruby 2.7.z releases [#55](https://github.com/samvera/hydra-role-management/issues/55)
|
11
|
+
|
12
|
+
**Merged pull requests:**
|
13
|
+
|
14
|
+
- Adding Ruby 2.7.z and Rails 6.y.z to the CircleCI build configuration [#58](https://github.com/samvera/hydra-role-management/pull/58) ([randalldfloyd](https://github.com/randalldfloyd))
|
15
|
+
|
16
|
+
## [v1.0.2](https://github.com/samvera/hydra-role-management/tree/v1.0.2) (2019-09-24)
|
17
|
+
|
18
|
+
[Full Changelog](https://github.com/samvera/hydra-role-management/compare/v1.0.1...v1.0.2)
|
19
|
+
|
20
|
+
**Implemented enhancements:**
|
21
|
+
|
22
|
+
- Generate a changelog [#49](https://github.com/samvera/hydra-role-management/issues/49)
|
23
|
+
|
24
|
+
**Closed issues:**
|
25
|
+
|
26
|
+
- Json 1.8 dependency is incompatible with bundler 2.x [#53](https://github.com/samvera/hydra-role-management/issues/53)
|
27
|
+
|
28
|
+
**Merged pull requests:**
|
29
|
+
|
30
|
+
- Prep for 1.0.2 release [#54](https://github.com/samvera/hydra-role-management/pull/54) ([bess](https://github.com/bess))
|
31
|
+
- Allow for later json versions [#52](https://github.com/samvera/hydra-role-management/pull/52) ([bess](https://github.com/bess))
|
32
|
+
|
33
|
+
## [v1.0.1](https://github.com/samvera/hydra-role-management/tree/v1.0.1) (2019-09-13)
|
34
|
+
|
35
|
+
[Full Changelog](https://github.com/samvera/hydra-role-management/compare/v1.0.0...v1.0.1)
|
36
|
+
|
37
|
+
**Implemented enhancements:**
|
38
|
+
|
39
|
+
- Migrate from Waffle.io to GitHub Projects [#46](https://github.com/samvera/hydra-role-management/issues/46)
|
40
|
+
|
41
|
+
**Closed issues:**
|
42
|
+
|
43
|
+
- Test against Rails release 5.1.7 and Ruby releases 2.6.3, 2.5.5, and 2.4.6 [#47](https://github.com/samvera/hydra-role-management/issues/47)
|
44
|
+
- Use CircleCI for continuous integration [#44](https://github.com/samvera/hydra-role-management/issues/44)
|
45
|
+
- Link to the contributing guidelines in the README [#39](https://github.com/samvera/hydra-role-management/issues/39)
|
46
|
+
- Test using Ruby releases 2.5.1 and 2.4.4 (also, test using Rails 5.2.0, 5.1.6, and 5.0.7) [#38](https://github.com/samvera/hydra-role-management/issues/38)
|
47
|
+
- Replace "Hydra" with "Samvera" in CONTRIBUTING.md [#37](https://github.com/samvera/hydra-role-management/issues/37)
|
48
|
+
- Improve test coverage to 100% [#36](https://github.com/samvera/hydra-role-management/issues/36)
|
49
|
+
- Integrate RuboCop for enforcing styling guidelines [#34](https://github.com/samvera/hydra-role-management/issues/34)
|
50
|
+
- Email as User id [#21](https://github.com/samvera/hydra-role-management/issues/21)
|
51
|
+
- roles generator messes up routes file [#9](https://github.com/samvera/hydra-role-management/issues/9)
|
52
|
+
|
53
|
+
**Merged pull requests:**
|
54
|
+
|
55
|
+
- Releases version 1.0.1 [#51](https://github.com/samvera/hydra-role-management/pull/51) ([jrgriffiniii](https://github.com/jrgriffiniii))
|
56
|
+
- Update CircleCI Ruby and Rails versions [#50](https://github.com/samvera/hydra-role-management/pull/50) ([botimer](https://github.com/botimer))
|
57
|
+
- Updates the CircleCI configuration to test against Rails release 5.1.7 and Ruby releases 2.6.3, 2.5.5, and 2.4.6 [#48](https://github.com/samvera/hydra-role-management/pull/48) ([jrgriffiniii](https://github.com/jrgriffiniii))
|
58
|
+
- Integrates CircleCI for continuous integration [#45](https://github.com/samvera/hydra-role-management/pull/45) ([jrgriffiniii](https://github.com/jrgriffiniii))
|
59
|
+
- Updating the dependencies to support bundler 2.0.x releases and to require engine_cart 2.1.x releases [#43](https://github.com/samvera/hydra-role-management/pull/43) ([jrgriffiniii](https://github.com/jrgriffiniii))
|
60
|
+
- Updating the Travis CI build matrix to use Ruby 2.5.1 and 2.4.4 along with Rails 5.2.1, 5.1.6, and 5.0.7 [#41](https://github.com/samvera/hydra-role-management/pull/41) ([jrgriffiniii](https://github.com/jrgriffiniii))
|
61
|
+
- Update docs according to templates [#40](https://github.com/samvera/hydra-role-management/pull/40) ([botimer](https://github.com/botimer))
|
62
|
+
- Integrating Bixby and RuboCop [#35](https://github.com/samvera/hydra-role-management/pull/35) ([jrgriffiniii](https://github.com/jrgriffiniii))
|
63
|
+
- Ensures that more complex Devise routes are not broken by the insertion of mount Hydra::RoleManagement::Engine => '/' [#33](https://github.com/samvera/hydra-role-management/pull/33) ([jrgriffiniii](https://github.com/jrgriffiniii))
|
64
|
+
- Use user.id instead of user in the path for the "Remove User" delete ... [#32](https://github.com/samvera/hydra-role-management/pull/32) ([coblej](https://github.com/coblej))
|
65
|
+
|
66
|
+
## [v1.0.0](https://github.com/samvera/hydra-role-management/tree/v1.0.0) (2017-11-02)
|
67
|
+
|
68
|
+
[Full Changelog](https://github.com/samvera/hydra-role-management/compare/v1.0...v1.0.0)
|
69
|
+
|
70
|
+
## [v1.0](https://github.com/samvera/hydra-role-management/tree/v1.0) (2017-11-02)
|
71
|
+
|
72
|
+
[Full Changelog](https://github.com/samvera/hydra-role-management/compare/v0.2.2...v1.0)
|
73
|
+
|
74
|
+
**Closed issues:**
|
75
|
+
|
76
|
+
- This gem is incompatible with Rails 5.1.2 migrations [#27](https://github.com/samvera/hydra-role-management/issues/27)
|
77
|
+
|
78
|
+
**Merged pull requests:**
|
79
|
+
|
80
|
+
- Tagging version 1.0 [#31](https://github.com/samvera/hydra-role-management/pull/31) ([bess](https://github.com/bess))
|
81
|
+
- Update build matrix and README [#30](https://github.com/samvera/hydra-role-management/pull/30) ([bess](https://github.com/bess))
|
82
|
+
- Add coveralls and travis badges [#29](https://github.com/samvera/hydra-role-management/pull/29) ([bess](https://github.com/bess))
|
83
|
+
- version user_roles migration template [#28](https://github.com/samvera/hydra-role-management/pull/28) ([dunn](https://github.com/dunn))
|
84
|
+
- Remove i18n-tasks for testing [#26](https://github.com/samvera/hydra-role-management/pull/26) ([elrayle](https://github.com/elrayle))
|
85
|
+
- Use translations for labels [#24](https://github.com/samvera/hydra-role-management/pull/24) ([elrayle](https://github.com/elrayle))
|
86
|
+
- Update engine_cart to 1.x [#23](https://github.com/samvera/hydra-role-management/pull/23) ([mjgiarlo](https://github.com/mjgiarlo))
|
87
|
+
- Stop spamming IRC with Travis builds [#22](https://github.com/samvera/hydra-role-management/pull/22) ([mjgiarlo](https://github.com/mjgiarlo))
|
88
|
+
|
89
|
+
## [v0.2.2](https://github.com/samvera/hydra-role-management/tree/v0.2.2) (2015-08-14)
|
90
|
+
|
91
|
+
[Full Changelog](https://github.com/samvera/hydra-role-management/compare/v0.2.1...v0.2.2)
|
92
|
+
|
93
|
+
**Closed issues:**
|
94
|
+
|
95
|
+
- License missing from gemspec [#7](https://github.com/samvera/hydra-role-management/issues/7)
|
96
|
+
|
97
|
+
**Merged pull requests:**
|
98
|
+
|
99
|
+
- Remove outdated cancan fix. [#20](https://github.com/samvera/hydra-role-management/pull/20) ([rotated8](https://github.com/rotated8))
|
100
|
+
- Fix indenting on the lines generated into the User class [#19](https://github.com/samvera/hydra-role-management/pull/19) ([jcoyne](https://github.com/jcoyne))
|
101
|
+
- Added Apache 2.0 License. Fixes #7 [#18](https://github.com/samvera/hydra-role-management/pull/18) ([jcoyne](https://github.com/jcoyne))
|
102
|
+
|
103
|
+
## [v0.2.1](https://github.com/samvera/hydra-role-management/tree/v0.2.1) (2014-12-18)
|
104
|
+
|
105
|
+
[Full Changelog](https://github.com/samvera/hydra-role-management/compare/v0.2.0...v0.2.1)
|
106
|
+
|
107
|
+
**Merged pull requests:**
|
108
|
+
|
109
|
+
- bumps version to '0.2.1' [#17](https://github.com/samvera/hydra-role-management/pull/17) ([mkorcy](https://github.com/mkorcy))
|
110
|
+
- Upgrade issues [#16](https://github.com/samvera/hydra-role-management/pull/16) ([mkorcy](https://github.com/mkorcy))
|
111
|
+
|
112
|
+
## [v0.2.0](https://github.com/samvera/hydra-role-management/tree/v0.2.0) (2014-06-25)
|
113
|
+
|
114
|
+
[Full Changelog](https://github.com/samvera/hydra-role-management/compare/v0.1.0...v0.2.0)
|
115
|
+
|
116
|
+
**Closed issues:**
|
117
|
+
|
118
|
+
- Decouple from hydra-head [#12](https://github.com/samvera/hydra-role-management/issues/12)
|
119
|
+
- don't depend on devise-guests [#10](https://github.com/samvera/hydra-role-management/issues/10)
|
120
|
+
|
121
|
+
**Merged pull requests:**
|
122
|
+
|
123
|
+
- Upgrade to boostrap_form (instead of bootstrap_forms) [#14](https://github.com/samvera/hydra-role-management/pull/14) ([val99erie](https://github.com/val99erie))
|
124
|
+
- Remove dependency on hydra-head. Fixes #12 [#13](https://github.com/samvera/hydra-role-management/pull/13) ([jcoyne](https://github.com/jcoyne))
|
125
|
+
- Don't check guest? unless DeviseGuests is installed. [#11](https://github.com/samvera/hydra-role-management/pull/11) ([jcoyne](https://github.com/jcoyne))
|
126
|
+
- Support drawing routes on a path other than /roles [#8](https://github.com/samvera/hydra-role-management/pull/8) ([mbklein](https://github.com/mbklein))
|
127
|
+
|
128
|
+
## [v0.1.0](https://github.com/samvera/hydra-role-management/tree/v0.1.0) (2013-09-24)
|
129
|
+
|
130
|
+
[Full Changelog](https://github.com/samvera/hydra-role-management/compare/v0.0.2...v0.1.0)
|
131
|
+
|
132
|
+
**Implemented enhancements:**
|
133
|
+
|
134
|
+
- Add documentation about needed cancan abilities [#2](https://github.com/samvera/hydra-role-management/issues/2)
|
135
|
+
|
136
|
+
**Merged pull requests:**
|
137
|
+
|
138
|
+
- Rails4 support [#6](https://github.com/samvera/hydra-role-management/pull/6) ([acurley](https://github.com/acurley))
|
139
|
+
- Redirect to edit when user can't edit all roles but can edit the current role [#5](https://github.com/samvera/hydra-role-management/pull/5) ([cjcolvar](https://github.com/cjcolvar))
|
140
|
+
- Allow renaming roles and deleting roles [#4](https://github.com/samvera/hydra-role-management/pull/4) ([cjcolvar](https://github.com/cjcolvar))
|
141
|
+
- Testing notes in README; newline before User model injection; require bootstrap_forms [#1](https://github.com/samvera/hydra-role-management/pull/1) ([cjcolvar](https://github.com/cjcolvar))
|
142
|
+
|
143
|
+
## [v0.0.2](https://github.com/samvera/hydra-role-management/tree/v0.0.2) (2013-04-18)
|
144
|
+
|
145
|
+
[Full Changelog](https://github.com/samvera/hydra-role-management/compare/v0.0.1...v0.0.2)
|
146
|
+
|
147
|
+
## [v0.0.1](https://github.com/samvera/hydra-role-management/tree/v0.0.1) (2013-04-18)
|
148
|
+
|
149
|
+
[Full Changelog](https://github.com/samvera/hydra-role-management/compare/0ab8d8ace4200cc7058e0cf1de77db6bb531ddf6...v0.0.1)
|
150
|
+
|
151
|
+
* _This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)_
|
data/CONTRIBUTING.md
CHANGED
@@ -1,14 +1,24 @@
|
|
1
1
|
# How to Contribute
|
2
2
|
|
3
|
-
We want your help to make
|
4
|
-
|
3
|
+
We want your help to make the Samvera community great. There are a few guidelines
|
4
|
+
that we need contributors to follow so that we can have a chance of
|
5
|
+
keeping on top of things.
|
5
6
|
|
6
|
-
##
|
7
|
+
## Code of Conduct
|
7
8
|
|
8
|
-
|
9
|
-
|
9
|
+
The Samvera Community is dedicated to providing a welcoming and positive
|
10
|
+
experience for all its members, whether they are at a formal gathering, in
|
11
|
+
a social setting, or taking part in activities online. Please see our
|
12
|
+
[Code of Conduct](CODE_OF_CONDUCT.md) for more information.
|
10
13
|
|
11
|
-
|
14
|
+
## Samvera Community Intellectual Property Licensing and Ownership
|
15
|
+
|
16
|
+
All code contributors must have an Individual Contributor License Agreement
|
17
|
+
(iCLA) on file with the Samvera Steering Group. If the contributor works for
|
18
|
+
an institution, the institution must have a Corporate Contributor License
|
19
|
+
Agreement (cCLA) on file.
|
20
|
+
|
21
|
+
https://wiki.duraspace.org/display/samvera/Samvera+Community+Intellectual+Property+Licensing+and+Ownership
|
12
22
|
|
13
23
|
You should also add yourself to the `CONTRIBUTORS.md` file in the root of the project.
|
14
24
|
|
@@ -16,8 +26,10 @@ You should also add yourself to the `CONTRIBUTORS.md` file in the root of the pr
|
|
16
26
|
|
17
27
|
* Reporting Issues
|
18
28
|
* Making Changes
|
29
|
+
* Documenting Code
|
30
|
+
* Committing Changes
|
19
31
|
* Submitting Changes
|
20
|
-
* Merging Changes
|
32
|
+
* Reviewing and Merging Changes
|
21
33
|
|
22
34
|
### Reporting Issues
|
23
35
|
|
@@ -38,8 +50,24 @@ You should also add yourself to the `CONTRIBUTORS.md` file in the root of the pr
|
|
38
50
|
* Then checkout the new branch with `git checkout fix/master/my_contribution`.
|
39
51
|
* Please avoid working directly on the `master` branch.
|
40
52
|
* You may find the [hub suite of commands](https://github.com/defunkt/hub) helpful
|
53
|
+
* Make sure you have added sufficient tests and documentation for your changes.
|
54
|
+
* Test functionality with RSpec; Test features / UI with Capybara.
|
55
|
+
* Run _all_ the tests to assure nothing else was accidentally broken.
|
56
|
+
|
57
|
+
### Documenting Code
|
58
|
+
|
59
|
+
* All new public methods, modules, and classes should include inline documentation in [YARD](http://yardoc.org/).
|
60
|
+
* Documentation should seek to answer the question "why does this code exist?"
|
61
|
+
* Document private / protected methods as desired.
|
62
|
+
* If you are working in a file with no prior documentation, do try to document as you gain understanding of the code.
|
63
|
+
* If you don't know exactly what a bit of code does, it is extra likely that it needs to be documented. Take a stab at it and ask for feedback in your pull request. You can use the 'blame' button on GitHub to identify the original developer of the code and @mention them in your comment.
|
64
|
+
* This work greatly increases the usability of the code base and supports the on-ramping of new committers.
|
65
|
+
* We will all be understanding of one another's time constraints in this area.
|
66
|
+
* [Getting started with YARD](http://www.rubydoc.info/gems/yard/file/docs/GettingStarted.md)
|
67
|
+
|
68
|
+
### Committing changes
|
69
|
+
|
41
70
|
* Make commits of logical units.
|
42
|
-
* Your commit should include a high level description of your work in HISTORY.textile
|
43
71
|
* Check for unnecessary whitespace with `git diff --check` before committing.
|
44
72
|
* Make sure your commit messages are [well formed](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html).
|
45
73
|
* If you created an issue, you can close it by including "Closes #issue" in your commit message. See [Github's blog post for more details](https://github.com/blog/1386-closing-issues-via-commit-messages)
|
@@ -60,7 +88,9 @@ You should also add yourself to the `CONTRIBUTORS.md` file in the root of the pr
|
|
60
88
|
|
61
89
|
class PostsController
|
62
90
|
def index
|
63
|
-
|
91
|
+
respond_to do |wants|
|
92
|
+
wants.html { render 'index' }
|
93
|
+
end
|
64
94
|
end
|
65
95
|
end
|
66
96
|
|
@@ -78,36 +108,54 @@ You should also add yourself to the `CONTRIBUTORS.md` file in the root of the pr
|
|
78
108
|
|
79
109
|
### Submitting Changes
|
80
110
|
|
81
|
-
[Detailed Walkthrough of One Pull Request per Commit](http://ndlib.github.io/practices/one-commit-per-pull-request/)
|
82
|
-
|
83
111
|
* Read the article ["Using Pull Requests"](https://help.github.com/articles/using-pull-requests) on GitHub.
|
84
112
|
* Make sure your branch is up to date with its parent branch (i.e. master)
|
85
113
|
* `git checkout master`
|
86
114
|
* `git pull --rebase`
|
87
115
|
* `git checkout <your-branch>`
|
88
116
|
* `git rebase master`
|
89
|
-
* It is
|
90
|
-
*
|
91
|
-
*
|
92
|
-
*
|
117
|
+
* It is a good idea to run your tests again.
|
118
|
+
* If you've made more than one commit take a moment to consider whether squashing commits together would help improve their logical grouping.
|
119
|
+
* [Detailed Walkthrough of One Pull Request per Commit](http://ndlib.github.io/practices/one-commit-per-pull-request/)
|
120
|
+
* `git rebase --interactive master` ([See Github help](https://help.github.com/articles/interactive-rebase))
|
93
121
|
* Squashing your branch's changes into one commit is "good form" and helps the person merging your request to see everything that is going on.
|
94
122
|
* Push your changes to a topic branch in your fork of the repository.
|
95
123
|
* Submit a pull request from your fork to the project.
|
96
124
|
|
97
|
-
### Merging Changes
|
125
|
+
### Reviewing and Merging Changes
|
126
|
+
|
127
|
+
We adopted [Github's Pull Request Review](https://help.github.com/articles/about-pull-request-reviews/) for our repositories.
|
128
|
+
Common checks that may occur in our repositories:
|
129
|
+
|
130
|
+
1. Travis CI - where our automated tests are running
|
131
|
+
2. Approval Required - Github enforces at least one person approve a pull request. Also, all reviewers that have chimed in must approve.
|
132
|
+
|
133
|
+
If one or more of the required checks failed (or are incomplete), the code should not be merged (and the UI will not allow it). If all of the checks have passed, then anyone on the project (including the pull request submitter) may merge the code.
|
134
|
+
|
135
|
+
*Example: Carolyn submits a pull request, Justin reviews the pull request and approves. However, Justin is still waiting on other checks (Travis CI is usually the culprit), so he does not merge the pull request. Eventually, all of the checks pass. At this point, Carolyn or anyone else may merge the pull request.*
|
136
|
+
|
137
|
+
#### Things to Consider When Reviewing
|
138
|
+
|
139
|
+
First, the person contributing the code is putting themselves out there. Be mindful of what you say in a review.
|
140
|
+
|
141
|
+
* Ask clarifying questions
|
142
|
+
* State your understanding and expectations
|
143
|
+
* Provide example code or alternate solutions, and explain why
|
144
|
+
|
145
|
+
This is your chance for a mentoring moment of another developer. Take time to give an honest and thorough review of what has changed. Things to consider:
|
98
146
|
|
99
|
-
* It is considered "poor from" to merge your own request.
|
100
|
-
* Please take the time to review the changes and get a sense of what is being changed. Things to consider:
|
101
147
|
* Does the commit message explain what is going on?
|
102
148
|
* Does the code changes have tests? _Not all changes need new tests, some changes are refactorings_
|
149
|
+
* Do new or changed methods, modules, and classes have documentation?
|
103
150
|
* Does the commit contain more than it should? Are two separate concerns being addressed in one commit?
|
151
|
+
* Does the description of the new/changed specs match your understanding of what the spec is doing?
|
104
152
|
* Did the Travis tests complete successfully?
|
105
|
-
|
106
|
-
|
153
|
+
|
154
|
+
If you are uncertain, bring other contributors into the conversation by assigning them as a reviewer.
|
107
155
|
|
108
156
|
# Additional Resources
|
109
157
|
|
110
158
|
* [General GitHub documentation](http://help.github.com/)
|
111
|
-
* [GitHub pull request documentation](
|
159
|
+
* [GitHub pull request documentation](https://help.github.com/articles/about-pull-requests/)
|
112
160
|
* [Pro Git](http://git-scm.com/book) is both a free and excellent book about Git.
|
113
161
|
* [A Git Config for Contributing](http://ndlib.github.io/practices/my-typical-per-project-git-config/)
|