human_attributes 0.6.0 → 0.7.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (77) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +104 -0
  3. data/.circleci/setup-rubygems.sh +3 -0
  4. data/.rubocop.yml +65 -594
  5. data/.ruby-version +1 -1
  6. data/CHANGELOG.md +11 -0
  7. data/Gemfile.lock +219 -147
  8. data/Guardfile +4 -4
  9. data/README.md +127 -26
  10. data/Rakefile +1 -1
  11. data/human_attributes.gemspec +11 -7
  12. data/lib/human_attributes/config.rb +50 -68
  13. data/lib/human_attributes/engine.rb +1 -0
  14. data/lib/human_attributes/errors.rb +6 -0
  15. data/lib/human_attributes/extension.rb +21 -26
  16. data/lib/human_attributes/formatters/base.rb +1 -0
  17. data/lib/human_attributes/formatters/enum.rb +25 -0
  18. data/lib/human_attributes/formatters/enumerize.rb +1 -0
  19. data/lib/human_attributes/formatters_builder.rb +1 -0
  20. data/lib/human_attributes/version.rb +1 -1
  21. data/spec/dummy/Rakefile +1 -1
  22. data/spec/dummy/app/assets/config/manifest.js +3 -0
  23. data/spec/dummy/app/assets/stylesheets/application.css +3 -3
  24. data/spec/dummy/app/channels/application_cable/channel.rb +4 -0
  25. data/spec/dummy/app/channels/application_cable/connection.rb +4 -0
  26. data/spec/dummy/app/controllers/application_controller.rb +0 -3
  27. data/spec/dummy/app/{assets/javascripts → javascript/packs}/application.js +3 -1
  28. data/spec/dummy/app/jobs/application_job.rb +7 -0
  29. data/spec/dummy/app/mailers/application_mailer.rb +4 -0
  30. data/spec/dummy/app/models/application_record.rb +3 -0
  31. data/spec/dummy/app/models/purchase.rb +20 -11
  32. data/spec/dummy/app/views/layouts/application.html.erb +10 -9
  33. data/spec/dummy/app/views/layouts/mailer.html.erb +13 -0
  34. data/spec/dummy/app/views/layouts/mailer.text.erb +1 -0
  35. data/spec/dummy/bin/rails +3 -3
  36. data/spec/dummy/bin/rake +2 -2
  37. data/spec/dummy/bin/setup +18 -14
  38. data/spec/dummy/config/application.rb +12 -22
  39. data/spec/dummy/config/boot.rb +3 -3
  40. data/spec/dummy/config/cable.yml +10 -0
  41. data/spec/dummy/config/database.yml +4 -18
  42. data/spec/dummy/config/environment.rb +1 -1
  43. data/spec/dummy/config/environments/development.rb +49 -14
  44. data/spec/dummy/config/environments/production.rb +63 -22
  45. data/spec/dummy/config/environments/test.rb +29 -12
  46. data/spec/dummy/config/initializers/application_controller_renderer.rb +8 -0
  47. data/spec/dummy/config/initializers/assets.rb +4 -3
  48. data/spec/dummy/config/initializers/backtrace_silencers.rb +4 -3
  49. data/spec/dummy/config/initializers/content_security_policy.rb +28 -0
  50. data/spec/dummy/config/initializers/cookies_serializer.rb +2 -0
  51. data/spec/dummy/config/initializers/filter_parameter_logging.rb +3 -1
  52. data/spec/dummy/config/initializers/permissions_policy.rb +11 -0
  53. data/spec/dummy/config/initializers/wrap_parameters.rb +2 -2
  54. data/spec/dummy/config/locales/en.yml +26 -1
  55. data/spec/dummy/config/puma.rb +43 -0
  56. data/spec/dummy/config/routes.rb +1 -54
  57. data/spec/dummy/config/storage.yml +34 -0
  58. data/spec/dummy/config.ru +3 -1
  59. data/spec/dummy/db/migrate/20161113032308_create_purchases.rb +1 -1
  60. data/spec/dummy/db/migrate/20211006145358_add_payment_method_to_purchase.rb +5 -0
  61. data/spec/dummy/db/migrate/20211103114451_add_shipping_to_purchase.rb +5 -0
  62. data/spec/dummy/db/migrate/20211103114830_add_store_to_purchase.rb +5 -0
  63. data/spec/dummy/db/schema.rb +17 -17
  64. data/spec/dummy/public/404.html +6 -6
  65. data/spec/dummy/public/422.html +6 -6
  66. data/spec/dummy/public/500.html +6 -6
  67. data/spec/dummy/public/apple-touch-icon-precomposed.png +0 -0
  68. data/spec/dummy/public/apple-touch-icon.png +0 -0
  69. data/spec/dummy/spec/factories/purchases.rb +9 -22
  70. data/spec/dummy/spec/lib/active_record_extension_spec.rb +81 -33
  71. metadata +104 -38
  72. data/.hound.yml +0 -4
  73. data/.travis.yml +0 -15
  74. data/spec/dummy/README.rdoc +0 -28
  75. data/spec/dummy/bin/bundle +0 -3
  76. data/spec/dummy/config/initializers/session_store.rb +0 -3
  77. data/spec/dummy/config/secrets.yml +0 -22
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3d2c50fc7eb6b1c82e300aea72f1c2ff2f84bfd3f41a44eb13f0586f79808833
4
- data.tar.gz: 07e6476b8ba6f7a8e6a8d0a5901bcbc096ea487b33517c3fa74a5c52b741a8df
3
+ metadata.gz: 100442352d961937e384df6bfb4aa8c137be3359048ce9c0359f4a208beb4db8
4
+ data.tar.gz: 946c6db1955e759761eb9be4c3af1142a6541b600ffec8a80af318e62c381d5d
5
5
  SHA512:
6
- metadata.gz: 17f023e6a4795731f7d7d67f9563bdec9bb886a865515aa1b61fdf739fcde494a37d4ff3120e5003781132e098dabe979bf8a83ac404f405c6b416645dbd5b67
7
- data.tar.gz: 245f01909263aa1a9694a2b76bd6a2b3024950018b95b4b038ac8f881e919bea2d51df3a394902e4fd90ad3b72cf5f379e7db9abcbb4105291c9f39d4f886fe3
6
+ metadata.gz: 394cdc7be845cb97ea5dcd4d6f0c2e41a28eb8b660a42297aadb6a3a28145f7477d2e2225b28269845aff8e26858393d019a6aae24bbbb0136a841812788af45
7
+ data.tar.gz: 2df11b1cc727eef343ce702d559f14e9f6f3c432993b5231051b2343911ca1b26a61f90959df684a924be4ea59db99e7c413ec72da8fb4e0c4197da1b57db367
@@ -0,0 +1,104 @@
1
+ version: 2.1
2
+
3
+ env-vars: &env-vars
4
+ RAILS_ENV: test
5
+ NODE_ENV: test
6
+ BUNDLE_PATH: vendor/bundle
7
+
8
+ orbs:
9
+ ruby: circleci/ruby@0.1.2
10
+ browser-tools: circleci/browser-tools@1.1.3
11
+
12
+ executors:
13
+ main-executor:
14
+ parameters:
15
+ ruby-version:
16
+ description: "Ruby version"
17
+ default: "2.7"
18
+ type: string
19
+ docker:
20
+ - image: circleci/ruby:<<parameters.ruby-version>>-node
21
+ environment: *env-vars
22
+
23
+ commands:
24
+ setup:
25
+ description: checkout code and install dependencies
26
+ steps:
27
+ - checkout
28
+ - run:
29
+ name: Install bundle dependencies
30
+ command: |
31
+ BUNDLER_VERSION=$(cat Gemfile.lock | tail -1 | tr -d " ")
32
+ gem install bundler:$BUNDLER_VERSION
33
+ bundle _$(echo $BUNDLER_VERSION)_ install
34
+
35
+ jobs:
36
+ lint:
37
+ executor: main-executor
38
+ steps:
39
+ - setup
40
+ - run:
41
+ name: Install reviewdog
42
+ command: |
43
+ curl -sfL https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s -- -b ./bin
44
+ - run:
45
+ name: Get files to lint
46
+ command: |
47
+ mkdir tmp
48
+ git diff origin/master --name-only --diff-filter=d > tmp/files_to_lint
49
+ - run:
50
+ name: Run rubocop
51
+ shell: /bin/bash
52
+ command: |
53
+ cat tmp/files_to_lint | grep -E '.+\.(rb)$' | xargs bundle exec rubocop --force-exclusion \
54
+ | ./bin/reviewdog -reporter=github-pr-review -f=rubocop
55
+ test:
56
+ parameters:
57
+ ruby-version:
58
+ description: "Ruby version"
59
+ default: "2.7"
60
+ type: string
61
+ executor:
62
+ name: main-executor
63
+ ruby-version: <<parameters.ruby-version>>
64
+ steps:
65
+ - setup
66
+ - run:
67
+ name: Run Tests
68
+ command: |
69
+ RSPEC_JUNIT_ARGS="-r rspec_junit_formatter -f RspecJunitFormatter -o test_results/rspec.xml"
70
+ RSPEC_FORMAT_ARGS="-f progress --no-color -p 10"
71
+ bundle exec rspec ./spec $RSPEC_FORMAT_ARGS $RSPEC_JUNIT_ARGS
72
+ - store_test_results:
73
+ path: test_results
74
+ deploy:
75
+ executor: main-executor
76
+ steps:
77
+ - setup
78
+ - run:
79
+ name: Setup rubygems
80
+ command: bash .circleci/setup-rubygems.sh
81
+ - run:
82
+ name: Publish to rubygems
83
+ command: |
84
+ GEM_FILE_NAME="human_attributes-$(git describe --tags).gem"
85
+ gem build human_attributes.gemspec -o $GEM_FILE_NAME
86
+ gem push $GEM_FILE_NAME
87
+
88
+ workflows:
89
+ version: 2
90
+ main:
91
+ jobs:
92
+ - lint:
93
+ context: org-global
94
+ - test:
95
+ matrix:
96
+ parameters:
97
+ ruby-version: ["2.5", "2.6", "2.7"]
98
+ - deploy:
99
+ context: org-global
100
+ filters:
101
+ tags:
102
+ only: /.*/
103
+ branches:
104
+ ignore: /.*/
@@ -0,0 +1,3 @@
1
+ mkdir ~/.gem
2
+ echo -e "---\r\n:rubygems_api_key: $RUBYGEMS_API_KEY" > ~/.gem/credentials
3
+ chmod 0600 /home/circleci/.gem/credentials