active_record_api-rest 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,74 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, gender identity and expression, level of experience,
9
+ nationality, personal appearance, race, religion, or sexual identity and
10
+ orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at samuel.birk@gmail.com. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at [http://contributor-covenant.org/version/1/4][version]
72
+
73
+ [homepage]: http://contributor-covenant.org
74
+ [version]: http://contributor-covenant.org/version/1/4/
data/Gemfile ADDED
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ gemspec
6
+
7
+ group :development, :test do
8
+ gem 'database_cleaner'
9
+ gem 'faker'
10
+ gem 'json_spec'
11
+ gem 'pg'
12
+ gem 'pry'
13
+ gem 'pry-byebug'
14
+ gem 'simplecov'
15
+ gem 'webmock'
16
+ end
data/Gemfile.lock ADDED
@@ -0,0 +1,214 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ active_record_api-rest (0.0.1)
5
+ active_attr
6
+ active_model_serializers
7
+ cancancan
8
+ rails (>= 5.0)
9
+
10
+ GEM
11
+ remote: https://rubygems.org/
12
+ specs:
13
+ actioncable (5.2.0)
14
+ actionpack (= 5.2.0)
15
+ nio4r (~> 2.0)
16
+ websocket-driver (>= 0.6.1)
17
+ actionmailer (5.2.0)
18
+ actionpack (= 5.2.0)
19
+ actionview (= 5.2.0)
20
+ activejob (= 5.2.0)
21
+ mail (~> 2.5, >= 2.5.4)
22
+ rails-dom-testing (~> 2.0)
23
+ actionpack (5.2.0)
24
+ actionview (= 5.2.0)
25
+ activesupport (= 5.2.0)
26
+ rack (~> 2.0)
27
+ rack-test (>= 0.6.3)
28
+ rails-dom-testing (~> 2.0)
29
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
30
+ actionview (5.2.0)
31
+ activesupport (= 5.2.0)
32
+ builder (~> 3.1)
33
+ erubi (~> 1.4)
34
+ rails-dom-testing (~> 2.0)
35
+ rails-html-sanitizer (~> 1.0, >= 1.0.3)
36
+ active_attr (0.11.0)
37
+ activemodel (>= 3.0.2, < 6.0)
38
+ activesupport (>= 3.0.2, < 6.0)
39
+ active_model_serializers (0.10.7)
40
+ actionpack (>= 4.1, < 6)
41
+ activemodel (>= 4.1, < 6)
42
+ case_transform (>= 0.2)
43
+ jsonapi-renderer (>= 0.1.1.beta1, < 0.3)
44
+ activejob (5.2.0)
45
+ activesupport (= 5.2.0)
46
+ globalid (>= 0.3.6)
47
+ activemodel (5.2.0)
48
+ activesupport (= 5.2.0)
49
+ activerecord (5.2.0)
50
+ activemodel (= 5.2.0)
51
+ activesupport (= 5.2.0)
52
+ arel (>= 9.0)
53
+ activestorage (5.2.0)
54
+ actionpack (= 5.2.0)
55
+ activerecord (= 5.2.0)
56
+ marcel (~> 0.3.1)
57
+ activesupport (5.2.0)
58
+ concurrent-ruby (~> 1.0, >= 1.0.2)
59
+ i18n (>= 0.7, < 2)
60
+ minitest (~> 5.1)
61
+ tzinfo (~> 1.1)
62
+ addressable (2.5.2)
63
+ public_suffix (>= 2.0.2, < 4.0)
64
+ arel (9.0.0)
65
+ builder (3.2.3)
66
+ byebug (10.0.2)
67
+ cancancan (2.2.0)
68
+ case_transform (0.2)
69
+ activesupport
70
+ coderay (1.1.2)
71
+ concurrent-ruby (1.0.5)
72
+ crack (0.4.3)
73
+ safe_yaml (~> 1.0.0)
74
+ crass (1.0.4)
75
+ database_cleaner (1.7.0)
76
+ diff-lcs (1.3)
77
+ docile (1.3.1)
78
+ erubi (1.7.1)
79
+ factory_bot (4.10.0)
80
+ activesupport (>= 3.0.0)
81
+ factory_bot_rails (4.10.0)
82
+ factory_bot (~> 4.10.0)
83
+ railties (>= 3.0.0)
84
+ faker (1.8.7)
85
+ i18n (>= 0.7)
86
+ globalid (0.4.1)
87
+ activesupport (>= 4.2.0)
88
+ hashdiff (0.3.7)
89
+ i18n (1.0.1)
90
+ concurrent-ruby (~> 1.0)
91
+ json (2.1.0)
92
+ json_spec (1.1.5)
93
+ multi_json (~> 1.0)
94
+ rspec (>= 2.0, < 4.0)
95
+ jsonapi-renderer (0.2.0)
96
+ loofah (2.2.2)
97
+ crass (~> 1.0.2)
98
+ nokogiri (>= 1.5.9)
99
+ mail (2.7.0)
100
+ mini_mime (>= 0.1.1)
101
+ marcel (0.3.2)
102
+ mimemagic (~> 0.3.2)
103
+ method_source (0.9.0)
104
+ mimemagic (0.3.2)
105
+ mini_mime (1.0.0)
106
+ mini_portile2 (2.3.0)
107
+ minitest (5.11.3)
108
+ multi_json (1.13.1)
109
+ nio4r (2.3.1)
110
+ nokogiri (1.8.4)
111
+ mini_portile2 (~> 2.3.0)
112
+ pg (1.0.0)
113
+ pry (0.11.3)
114
+ coderay (~> 1.1.0)
115
+ method_source (~> 0.9.0)
116
+ pry-byebug (3.6.0)
117
+ byebug (~> 10.0)
118
+ pry (~> 0.10)
119
+ public_suffix (3.0.2)
120
+ rack (2.0.5)
121
+ rack-test (1.0.0)
122
+ rack (>= 1.0, < 3)
123
+ rails (5.2.0)
124
+ actioncable (= 5.2.0)
125
+ actionmailer (= 5.2.0)
126
+ actionpack (= 5.2.0)
127
+ actionview (= 5.2.0)
128
+ activejob (= 5.2.0)
129
+ activemodel (= 5.2.0)
130
+ activerecord (= 5.2.0)
131
+ activestorage (= 5.2.0)
132
+ activesupport (= 5.2.0)
133
+ bundler (>= 1.3.0)
134
+ railties (= 5.2.0)
135
+ sprockets-rails (>= 2.0.0)
136
+ rails-dom-testing (2.0.3)
137
+ activesupport (>= 4.2.0)
138
+ nokogiri (>= 1.6)
139
+ rails-html-sanitizer (1.0.4)
140
+ loofah (~> 2.2, >= 2.2.2)
141
+ railties (5.2.0)
142
+ actionpack (= 5.2.0)
143
+ activesupport (= 5.2.0)
144
+ method_source
145
+ rake (>= 0.8.7)
146
+ thor (>= 0.18.1, < 2.0)
147
+ rake (10.5.0)
148
+ rspec (3.7.0)
149
+ rspec-core (~> 3.7.0)
150
+ rspec-expectations (~> 3.7.0)
151
+ rspec-mocks (~> 3.7.0)
152
+ rspec-core (3.7.1)
153
+ rspec-support (~> 3.7.0)
154
+ rspec-expectations (3.7.0)
155
+ diff-lcs (>= 1.2.0, < 2.0)
156
+ rspec-support (~> 3.7.0)
157
+ rspec-mocks (3.7.0)
158
+ diff-lcs (>= 1.2.0, < 2.0)
159
+ rspec-support (~> 3.7.0)
160
+ rspec-rails (3.7.2)
161
+ actionpack (>= 3.0)
162
+ activesupport (>= 3.0)
163
+ railties (>= 3.0)
164
+ rspec-core (~> 3.7.0)
165
+ rspec-expectations (~> 3.7.0)
166
+ rspec-mocks (~> 3.7.0)
167
+ rspec-support (~> 3.7.0)
168
+ rspec-support (3.7.1)
169
+ safe_yaml (1.0.4)
170
+ simplecov (0.16.1)
171
+ docile (~> 1.1)
172
+ json (>= 1.8, < 3)
173
+ simplecov-html (~> 0.10.0)
174
+ simplecov-html (0.10.2)
175
+ sprockets (3.7.2)
176
+ concurrent-ruby (~> 1.0)
177
+ rack (> 1, < 3)
178
+ sprockets-rails (3.2.1)
179
+ actionpack (>= 4.0)
180
+ activesupport (>= 4.0)
181
+ sprockets (>= 3.0.0)
182
+ thor (0.20.0)
183
+ thread_safe (0.3.6)
184
+ tzinfo (1.2.5)
185
+ thread_safe (~> 0.1)
186
+ webmock (3.4.2)
187
+ addressable (>= 2.3.6)
188
+ crack (>= 0.3.2)
189
+ hashdiff
190
+ websocket-driver (0.7.0)
191
+ websocket-extensions (>= 0.1.0)
192
+ websocket-extensions (0.1.3)
193
+
194
+ PLATFORMS
195
+ ruby
196
+
197
+ DEPENDENCIES
198
+ active_record_api-rest!
199
+ bundler (~> 1.16)
200
+ database_cleaner
201
+ factory_bot_rails
202
+ faker
203
+ json_spec
204
+ pg
205
+ pry
206
+ pry-byebug
207
+ rake (~> 10.0)
208
+ rspec (~> 3.0)
209
+ rspec-rails
210
+ simplecov
211
+ webmock
212
+
213
+ BUNDLED WITH
214
+ 1.16.1
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2018 samuelbirk
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,37 @@
1
+ # ActiveRecordApi::RestController
2
+
3
+ A gem to make restful controllers
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'active_record_api-rest_controller'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install active_record_api-rest_controller
20
+
21
+ ## Development
22
+
23
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
24
+
25
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
26
+
27
+ ## Contributing
28
+
29
+ Bug reports and pull requests are welcome on GitHub at https://gitlab.com/fullmeasure/swagger-api/swagger-api. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
30
+
31
+ ## License
32
+
33
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
34
+
35
+ ## Code of Conduct
36
+
37
+ Everyone interacting in the Swagger::Api project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/swagger-api/blob/master/CODE_OF_CONDUCT.md).
data/Rakefile ADDED
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'bundler/gem_tasks'
4
+ require 'rspec/core/rake_task'
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ task :default => :spec
@@ -0,0 +1,42 @@
1
+ # frozen_string_literal: true
2
+
3
+ lib = File.expand_path('../lib', __FILE__)
4
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
+ require 'active_record_api/rest/version'
6
+
7
+ Gem::Specification.new do |spec|
8
+ spec.name = 'active_record_api-rest'
9
+ spec.version = ActiveRecordApi::Rest::VERSION
10
+ spec.authors = ['Full Measure Education']
11
+ spec.email = ['devops@fullmeasureed.com']
12
+
13
+ spec.summary = 'A simple library for RESTful rails controllers.'
14
+ spec.description = 'A simple library for RESTful rails controllers.'
15
+ spec.homepage = 'https://gitlab.com/fullmeasure/public/gems/active_record_api-rest_controller'
16
+ spec.license = 'MIT'
17
+
18
+ # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
19
+ # to allow pushing to a single host or delete this section to allow pushing to any host.
20
+ if spec.respond_to?(:metadata)
21
+ spec.metadata['allowed_push_host'] = 'https://rubygems.org'
22
+ else
23
+ raise 'RubyGems 2.0 or newer is required to protect against public gem pushes.'
24
+ end
25
+
26
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
27
+ f.match(%r{^(test|spec|features)/})
28
+ end
29
+ spec.bindir = 'exe'
30
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
31
+ spec.require_paths = ['lib']
32
+
33
+ spec.add_development_dependency 'bundler', '~> 1.16'
34
+ spec.add_development_dependency 'factory_bot_rails'
35
+ spec.add_development_dependency 'rake', '~> 10.0'
36
+ spec.add_development_dependency 'rspec', '~> 3.0'
37
+ spec.add_development_dependency 'rspec-rails'
38
+ spec.add_dependency 'active_attr'
39
+ spec.add_dependency 'active_model_serializers'
40
+ spec.add_dependency 'cancancan'
41
+ spec.add_dependency 'rails', '>= 5.1'
42
+ end
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "swagger/api"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here