factory_bot_instrumentation 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. checksums.yaml +7 -0
  2. data/.editorconfig +30 -0
  3. data/.gitignore +13 -0
  4. data/.rspec +3 -0
  5. data/.rubocop.yml +43 -0
  6. data/.simplecov +3 -0
  7. data/.travis.yml +28 -0
  8. data/Appraisals +15 -0
  9. data/CHANGELOG.md +3 -0
  10. data/Gemfile +8 -0
  11. data/Gemfile.lock +161 -0
  12. data/LICENSE +21 -0
  13. data/Makefile +96 -0
  14. data/README.md +713 -0
  15. data/Rakefile +8 -0
  16. data/app/assets/config/factory_bot_instrumentation_manifest.js +2 -0
  17. data/app/assets/javascripts/factory_bot_instrumentation/application.js +16 -0
  18. data/app/assets/javascripts/factory_bot_instrumentation/create.js +134 -0
  19. data/app/assets/javascripts/factory_bot_instrumentation/hooks.js +123 -0
  20. data/app/assets/javascripts/factory_bot_instrumentation/lib/form.js +66 -0
  21. data/app/assets/javascripts/factory_bot_instrumentation/lib/utils.js +116 -0
  22. data/app/assets/stylesheets/factory_bot_instrumentation/application.css +91 -0
  23. data/app/controllers/factory_bot/instrumentation/application_controller.rb +7 -0
  24. data/app/controllers/factory_bot/instrumentation/root_controller.rb +113 -0
  25. data/app/views/factory_bot/instrumentation/application/_config.html.erb +5 -0
  26. data/app/views/factory_bot/instrumentation/application/_scripts.html.erb +18 -0
  27. data/app/views/factory_bot/instrumentation/application/_spinner.html.erb +7 -0
  28. data/app/views/factory_bot/instrumentation/application/_styles.html.erb +20 -0
  29. data/app/views/factory_bot/instrumentation/root/index.html.erb +31 -0
  30. data/app/views/factory_bot_instrumentation/_blocks.html.erb +6 -0
  31. data/app/views/factory_bot_instrumentation/_navigation.html.erb +13 -0
  32. data/app/views/factory_bot_instrumentation/_scripts.html.erb +5 -0
  33. data/app/views/factory_bot_instrumentation/_styles.html.erb +5 -0
  34. data/app/views/layouts/factory_bot/instrumentation/application.html.erb +29 -0
  35. data/bin/rails +14 -0
  36. data/config/instrumentation.yml +55 -0
  37. data/config/routes.rb +8 -0
  38. data/doc/assets/blocks.png +0 -0
  39. data/doc/assets/customized.png +0 -0
  40. data/doc/assets/navigation.png +0 -0
  41. data/doc/assets/project.svg +68 -0
  42. data/doc/assets/regular.png +0 -0
  43. data/docker-compose.yml +8 -0
  44. data/factory_bot_instrumentation.gemspec +33 -0
  45. data/gemfiles/rails_4.gemfile +7 -0
  46. data/gemfiles/rails_4.gemfile.lock +147 -0
  47. data/gemfiles/rails_5.0.gemfile +7 -0
  48. data/gemfiles/rails_5.0.gemfile.lock +154 -0
  49. data/gemfiles/rails_5.1.gemfile +7 -0
  50. data/gemfiles/rails_5.1.gemfile.lock +154 -0
  51. data/gemfiles/rails_5.2.gemfile +7 -0
  52. data/gemfiles/rails_5.2.gemfile.lock +162 -0
  53. data/lib/factory_bot/instrumentation/configuration.rb +20 -0
  54. data/lib/factory_bot/instrumentation/engine.rb +19 -0
  55. data/lib/factory_bot/instrumentation/version.rb +7 -0
  56. data/lib/factory_bot_instrumentation.rb +43 -0
  57. metadata +209 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 37c841015eb6d5ca194d74c475957cf81a896a1ba20cebfd354de0702979a003
4
+ data.tar.gz: f4071fb9684abc657f92e0c5d5b8001c557832e4a2a8645ee3225e600f737a55
5
+ SHA512:
6
+ metadata.gz: ca07c702926a18278aac3488b409d5d2a6cb3297fa3bbf3f6371c6606f26139c98b0c741995baf9662935dc890ff7cf7864f1f299c2402a6a3617d9bedbb71e9
7
+ data.tar.gz: 38eb79f9af34cbdc7a02d45c21a4f33db15c8688159a7e012c6b1f237e2edc2ea75585cd820bcb0541d8a4673c05270c83b58059282053453dd2df9ce1b1e653
data/.editorconfig ADDED
@@ -0,0 +1,30 @@
1
+ # http://editorconfig.org
2
+ root = true
3
+
4
+ [*]
5
+ indent_style = space
6
+ indent_size = 2
7
+ end_of_line = lf
8
+ charset = utf-8
9
+ trim_trailing_whitespace = true
10
+ insert_final_newline = true
11
+
12
+ [*.md]
13
+ trim_trailing_whitespace = true
14
+
15
+ [*.json]
16
+ indent_style = space
17
+ indent_size = 2
18
+
19
+ [*.yml]
20
+ indent_style = space
21
+ indent_size = 2
22
+
23
+ [Makefile]
24
+ trim_trailing_whitespace = true
25
+ indent_style = tab
26
+ indent_size = 4
27
+
28
+ [*.sh]
29
+ indent_style = space
30
+ indent_size = 2
data/.gitignore ADDED
@@ -0,0 +1,13 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/api/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+ /vendor/
10
+ /gemfiles/vendor/
11
+
12
+ # rspec failure tracking
13
+ .rspec_status
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,43 @@
1
+ require: rubocop-rspec
2
+
3
+ Rails:
4
+ Enabled: true
5
+
6
+ Documentation:
7
+ Enabled: true
8
+
9
+ AllCops:
10
+ DisplayCopNames: true
11
+ TargetRubyVersion: 2.3
12
+ Exclude:
13
+ - db/schema.rb
14
+ - bin/**/*
15
+ - db/migrate/**/*
16
+ - vendor/cache/**/*
17
+ - vendor/bundle/**/*
18
+ - build/**/*
19
+
20
+ Metrics/BlockLength:
21
+ Exclude:
22
+ # Because of the Grape DSL
23
+ - lib/**/*.rb
24
+ - Rakefile
25
+ - hausgold-sdk.gemspec
26
+ - spec/**/*.rb
27
+ - '**/*.rake'
28
+
29
+ # Document all the things.
30
+ Style/DocumentationMethod:
31
+ Enabled: true
32
+ RequireForNonPublicMethods: true
33
+
34
+ # It's a deliberate idiom in RSpec.
35
+ # See: https://github.com/bbatsov/rubocop/issues/4222
36
+ Lint/AmbiguousBlockAssociation:
37
+ Exclude:
38
+ - "spec/**/*"
39
+
40
+ # Because +expect_any_instance_of().to have_received()+ is not
41
+ # supported with the +with(hash_including)+ matchers
42
+ RSpec/MessageSpies:
43
+ EnforcedStyle: receive
data/.simplecov ADDED
@@ -0,0 +1,3 @@
1
+ SimpleCov.start 'test_frameworks' do
2
+ add_filter '/vendor/bundle/'
3
+ end
data/.travis.yml ADDED
@@ -0,0 +1,28 @@
1
+ env:
2
+ global:
3
+ - CC_TEST_REPORTER_ID=fb31117c43f12bf12f2d5a2b8ab4b3fe1b18aa874490f7f3db5502aa9ddb65fc
4
+
5
+ sudo: false
6
+ language: ruby
7
+ cache: bundler
8
+ rvm:
9
+ - 2.6
10
+ - 2.5
11
+ - 2.4
12
+ - 2.3
13
+
14
+ gemfile:
15
+ - gemfiles/rails_4.gemfile
16
+ - gemfiles/rails_5.0.gemfile
17
+ - gemfiles/rails_5.1.gemfile
18
+ - gemfiles/rails_5.2.gemfile
19
+
20
+ before_install: gem install bundler
21
+
22
+ before_script:
23
+ - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
24
+ - chmod +x ./cc-test-reporter
25
+ - ./cc-test-reporter before-build
26
+ script: bundle exec rake
27
+ after_script:
28
+ - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
data/Appraisals ADDED
@@ -0,0 +1,15 @@
1
+ appraise 'rails-4' do
2
+ gem 'activesupport', '4.2.10'
3
+ end
4
+
5
+ appraise 'rails-5.0' do
6
+ gem 'activesupport', '5.0.6'
7
+ end
8
+
9
+ appraise 'rails-5.1' do
10
+ gem 'activesupport', '5.1.4'
11
+ end
12
+
13
+ appraise 'rails-5.2' do
14
+ gem 'activesupport', '5.2.0'
15
+ end
data/CHANGELOG.md ADDED
@@ -0,0 +1,3 @@
1
+ ### 0.1.0
2
+
3
+ * Added the initial code base
data/Gemfile ADDED
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
6
+
7
+ # Specify your gem's dependencies in grape-jwt-authentication.gemspec
8
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,161 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ factory_bot_instrumentation (0.1.0)
5
+ factory_bot
6
+ rails (>= 3.2.0)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ actioncable (5.2.2)
12
+ actionpack (= 5.2.2)
13
+ nio4r (~> 2.0)
14
+ websocket-driver (>= 0.6.1)
15
+ actionmailer (5.2.2)
16
+ actionpack (= 5.2.2)
17
+ actionview (= 5.2.2)
18
+ activejob (= 5.2.2)
19
+ mail (~> 2.5, >= 2.5.4)
20
+ rails-dom-testing (~> 2.0)
21
+ actionpack (5.2.2)
22
+ actionview (= 5.2.2)
23
+ activesupport (= 5.2.2)
24
+ rack (~> 2.0)
25
+ rack-test (>= 0.6.3)
26
+ rails-dom-testing (~> 2.0)
27
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
28
+ actionview (5.2.2)
29
+ activesupport (= 5.2.2)
30
+ builder (~> 3.1)
31
+ erubi (~> 1.4)
32
+ rails-dom-testing (~> 2.0)
33
+ rails-html-sanitizer (~> 1.0, >= 1.0.3)
34
+ activejob (5.2.2)
35
+ activesupport (= 5.2.2)
36
+ globalid (>= 0.3.6)
37
+ activemodel (5.2.2)
38
+ activesupport (= 5.2.2)
39
+ activerecord (5.2.2)
40
+ activemodel (= 5.2.2)
41
+ activesupport (= 5.2.2)
42
+ arel (>= 9.0)
43
+ activestorage (5.2.2)
44
+ actionpack (= 5.2.2)
45
+ activerecord (= 5.2.2)
46
+ marcel (~> 0.3.1)
47
+ activesupport (5.2.2)
48
+ concurrent-ruby (~> 1.0, >= 1.0.2)
49
+ i18n (>= 0.7, < 2)
50
+ minitest (~> 5.1)
51
+ tzinfo (~> 1.1)
52
+ appraisal (2.2.0)
53
+ bundler
54
+ rake
55
+ thor (>= 0.14.0)
56
+ arel (9.0.0)
57
+ builder (3.2.3)
58
+ concurrent-ruby (1.1.4)
59
+ crass (1.0.4)
60
+ diff-lcs (1.3)
61
+ docile (1.3.1)
62
+ erubi (1.8.0)
63
+ factory_bot (4.11.1)
64
+ activesupport (>= 3.0.0)
65
+ globalid (0.4.1)
66
+ activesupport (>= 4.2.0)
67
+ i18n (1.5.1)
68
+ concurrent-ruby (~> 1.0)
69
+ json (2.1.0)
70
+ loofah (2.2.3)
71
+ crass (~> 1.0.2)
72
+ nokogiri (>= 1.5.9)
73
+ mail (2.7.1)
74
+ mini_mime (>= 0.1.1)
75
+ marcel (0.3.3)
76
+ mimemagic (~> 0.3.2)
77
+ method_source (0.9.2)
78
+ mimemagic (0.3.3)
79
+ mini_mime (1.0.1)
80
+ mini_portile2 (2.4.0)
81
+ minitest (5.11.3)
82
+ nio4r (2.3.1)
83
+ nokogiri (1.10.0)
84
+ mini_portile2 (~> 2.4.0)
85
+ rack (2.0.6)
86
+ rack-test (0.8.3)
87
+ rack (>= 1.0, < 3)
88
+ rails (5.2.2)
89
+ actioncable (= 5.2.2)
90
+ actionmailer (= 5.2.2)
91
+ actionpack (= 5.2.2)
92
+ actionview (= 5.2.2)
93
+ activejob (= 5.2.2)
94
+ activemodel (= 5.2.2)
95
+ activerecord (= 5.2.2)
96
+ activestorage (= 5.2.2)
97
+ activesupport (= 5.2.2)
98
+ bundler (>= 1.3.0)
99
+ railties (= 5.2.2)
100
+ sprockets-rails (>= 2.0.0)
101
+ rails-dom-testing (2.0.3)
102
+ activesupport (>= 4.2.0)
103
+ nokogiri (>= 1.6)
104
+ rails-html-sanitizer (1.0.4)
105
+ loofah (~> 2.2, >= 2.2.2)
106
+ railties (5.2.2)
107
+ actionpack (= 5.2.2)
108
+ activesupport (= 5.2.2)
109
+ method_source
110
+ rake (>= 0.8.7)
111
+ thor (>= 0.19.0, < 2.0)
112
+ rake (10.5.0)
113
+ rspec (3.8.0)
114
+ rspec-core (~> 3.8.0)
115
+ rspec-expectations (~> 3.8.0)
116
+ rspec-mocks (~> 3.8.0)
117
+ rspec-core (3.8.0)
118
+ rspec-support (~> 3.8.0)
119
+ rspec-expectations (3.8.2)
120
+ diff-lcs (>= 1.2.0, < 2.0)
121
+ rspec-support (~> 3.8.0)
122
+ rspec-mocks (3.8.0)
123
+ diff-lcs (>= 1.2.0, < 2.0)
124
+ rspec-support (~> 3.8.0)
125
+ rspec-support (3.8.0)
126
+ simplecov (0.16.1)
127
+ docile (~> 1.1)
128
+ json (>= 1.8, < 3)
129
+ simplecov-html (~> 0.10.0)
130
+ simplecov-html (0.10.2)
131
+ sprockets (3.7.2)
132
+ concurrent-ruby (~> 1.0)
133
+ rack (> 1, < 3)
134
+ sprockets-rails (3.2.1)
135
+ actionpack (>= 4.0)
136
+ activesupport (>= 4.0)
137
+ sprockets (>= 3.0.0)
138
+ sqlite3 (1.3.13)
139
+ thor (0.20.3)
140
+ thread_safe (0.3.6)
141
+ timecop (0.9.1)
142
+ tzinfo (1.2.5)
143
+ thread_safe (~> 0.1)
144
+ websocket-driver (0.7.0)
145
+ websocket-extensions (>= 0.1.0)
146
+ websocket-extensions (0.1.3)
147
+
148
+ PLATFORMS
149
+ ruby
150
+
151
+ DEPENDENCIES
152
+ appraisal
153
+ bundler (~> 1.16)
154
+ factory_bot_instrumentation!
155
+ rspec (~> 3.0)
156
+ simplecov (~> 0.15)
157
+ sqlite3
158
+ timecop (~> 0.9.1)
159
+
160
+ BUNDLED WITH
161
+ 1.17.2
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2017 HAUSGOLD | talocasa GmbH
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 all
13
+ 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 THE
21
+ SOFTWARE.
data/Makefile ADDED
@@ -0,0 +1,96 @@
1
+ MAKEFLAGS += --warn-undefined-variables -j1
2
+ SHELL := bash
3
+ .SHELLFLAGS := -eu -o pipefail -c
4
+ .DEFAULT_GOAL := all
5
+ .DELETE_ON_ERROR:
6
+ .SUFFIXES:
7
+ .PHONY:
8
+
9
+ # Environment switches
10
+ MAKE_ENV ?= docker
11
+ COMPOSE_RUN_SHELL_FLAGS ?= --rm
12
+
13
+ # Directories
14
+ VENDOR_DIR ?= vendor/bundle
15
+ GEMFILES_DIR ?= gemfiles
16
+
17
+ # Host binaries
18
+ BASH ?= bash
19
+ COMPOSE ?= docker-compose
20
+ ID ?= id
21
+ MKDIR ?= mkdir
22
+ RM ?= rm
23
+
24
+ # Container binaries
25
+ BUNDLE ?= bundle
26
+ APPRAISAL ?= appraisal
27
+ RAKE ?= rake
28
+
29
+ # Files
30
+ GEMFILES ?= $(subst _,-,$(patsubst $(GEMFILES_DIR)/%.gemfile,%,\
31
+ $(wildcard $(GEMFILES_DIR)/*.gemfile)))
32
+ TEST_GEMFILES := $(GEMFILES:%=test-%)
33
+
34
+ # Define a generic shell run wrapper
35
+ # $1 - The command to run
36
+ ifeq ($(MAKE_ENV),docker)
37
+ define run-shell
38
+ $(COMPOSE) run $(COMPOSE_RUN_SHELL_FLAGS) \
39
+ -e LANG=en_US.UTF-8 -e LANGUAGE=en_US.UTF-8 -e LC_ALL=en_US.UTF-8 \
40
+ -e HOME=/tmp -e BUNDLE_APP_CONFIG=/app/.bundle \
41
+ -u `$(ID) -u` test bash -c 'sleep 0.1; echo; $(1)'
42
+ endef
43
+ else ifeq ($(MAKE_ENV),baremetal)
44
+ define run-shell
45
+ $(1)
46
+ endef
47
+ endif
48
+
49
+ all:
50
+ # factory_bot_instrumentation
51
+ #
52
+ # install Install the dependencies
53
+ # test Run the whole test suite
54
+ # clean Clean the dependencies
55
+ #
56
+ # shell Run an interactive shell on the container
57
+ # shell-irb Run an interactive IRB shell on the container
58
+
59
+ install:
60
+ # Install the dependencies
61
+ @$(MKDIR) -p $(VENDOR_DIR)
62
+ @$(call run-shell,$(BUNDLE) check || $(BUNDLE) install --path $(VENDOR_DIR))
63
+ @$(call run-shell,$(BUNDLE) exec $(APPRAISAL) install)
64
+
65
+ test: install
66
+ # Run the whole test suite
67
+ @$(call run-shell,$(BUNDLE) exec $(RAKE))
68
+
69
+ $(TEST_GEMFILES): GEMFILE=$(@:test-%=%)
70
+ $(TEST_GEMFILES):
71
+ # Run the whole test suite ($(GEMFILE))
72
+ @$(call run-shell,$(BUNDLE) exec $(APPRAISAL) $(GEMFILE) $(RAKE))
73
+
74
+ clean:
75
+ # Clean the dependencies
76
+ @$(RM) -rf $(VENDOR_DIR)
77
+
78
+ clean-containers:
79
+ # Clean running containers
80
+ ifeq ($(MAKE_ENV),docker)
81
+ @$(COMPOSE) down
82
+ endif
83
+
84
+ distclean: clean clean-containers
85
+
86
+ shell: install
87
+ # Run an interactive shell on the container
88
+ @$(call run-shell,$(BASH) -i)
89
+
90
+ shell-irb: install
91
+ # Run an interactive IRB shell on the container
92
+ @$(call run-shell,bin/console)
93
+
94
+ release:
95
+ # Release a new gem version
96
+ @$(RAKE) release