项目作者: watermarkchurch

项目描述 :
Interfacing with Contentful
高级语言: Ruby
项目地址: git://github.com/watermarkchurch/wcc-contentful.git
创建时间: 2018-02-15T17:28:57Z
项目社区:https://github.com/watermarkchurch/wcc-contentful

开源协议:MIT License

下载


The home of multiple gems that Watermark Community Church uses to integrate with
Contentful.

Build Status
Coverage Status

Supported Rails versions

Please see the most recent CircleCI build for the most
up-to-date list of supported framework environments. At the time of this writing,
the gem officially supports the following:

  • Ruby versions:
    • 3.1 - 3.4
    • 2.7
  • Framework versions:
    • Rails 8.0
    • Rails 7.0
    • Rails 6.1
    • Rack 2 (w/o Rails)

Pull requests are welcome to enable supporting other frameworks!

To get started in testing a new Ruby version, use rvm or rbenv to choose your
ruby version. Then, check out the appropriate Gemfile using the bin/use helper:

  1. $ rbenv local 3.1.1
  2. $ gem install bundler
  3. $ bundle install
  4. $ bin/use gemfiles/rails_6.1_ruby_3.1.gemfile

Now each of the wcc- gems has a Gemfile based on that Appraisal gemfile. cd
into the gem’s directory and run bundle install to install the gems.

Adding a new Rails version

To get started testing a new framework, add the appropriate combination of gems to the Appraisals file
and run bundle exec appraisal generate to generate the appropriate gemfile in the gemfiles directory:

  1. diff --git a/Appraisals b/Appraisals
  2. index 041abea..917142f 100644
  3. --- a/Appraisals
  4. +++ b/Appraisals
  5. @@ -1,5 +1,9 @@
  6. # frozen_string_literal: true
  7. +appraise 'sinatra-2.0' do
  8. + gem 'sinatra', '~> 2.0.0'
  9. +end
  10. +
  11. appraise 'rails-6.1' do
  12. gem 'rails', '~> 6.1'
  13. gem 'railties', '~> 6.1'

Then you can use the bin/use helper to check out that set of gems:

  1. $ bundle exec appraisal generate
  2. $ bin/use gemfiles/rails_6.1.gemfile

And build a helper that conditionally includes your framework specs based on whether
that gem is installed. Example:

  1. # spec/active_record_helper.rb
  2. require 'spec_helper'
  3. begin
  4. gem 'activerecord'
  5. require 'active_record'
  6. rescue Gem::LoadError => e
  7. # active_record is not loaded in this test run
  8. warn "WARNING: Cannot load active_record - some tests will be skipped\n#{e}"
  9. end
  10. unless defined?(ActiveRecord)
  11. RSpec.configure do |c|
  12. # skip active record based specs
  13. c.before(:each, active_record: true) do
  14. skip 'activerecord is not loaded'
  15. end
  16. end
  17. end

Finally, make sure you add it to the build matrix in .circleci/config.yml:

  1. diff --git a/.circleci/config.yml b/.circleci/config.yml
  2. index 317cde6..f5c439f 100644
  3. --- a/.circleci/config.yml
  4. +++ b/.circleci/config.yml
  5. @@ -107,6 +107,10 @@ workflows:
  6. name: test_rails-7.2_ruby-3.3
  7. ruby: 3.3.5
  8. gemfile: gemfiles/rails_7.2_ruby_3.3.gemfile
  9. + - test:
  10. + name: sinatra-2.0_ruby-3.3
  11. + ruby: 3.3.5
  12. + gemfile: gemfiles/sinatra_2.0_ruby_3.3.gemfile
  13. - lint:
  14. ruby: 3.3.5
  15. gemfile: gemfiles/rails_7.2_ruby_3.3.gemfile

License

The gem is available as open source under the terms of the MIT License.

Code of Ethics

The developers at Watermark Community Church have pledged to govern their interactions with each other, with their clients, and with the larger wcc-contentful user community in accordance with the “instruments of good works” from chapter 4 of The Rule of St. Benedict (hereafter: “The Rule”). This code of ethics has proven its mettle in thousands of diverse communities for over 1,500 years, and has served as a baseline for many civil law codes since the time of Charlemagne.

See the full Code of Ethics

Deployment instructions:

1) Bump the version number using the appropriate rake task:

  1. rake bump:major
  2. rake bump:patch
  3. rake bump:minor
  4. rake bump:pre

Note: ensure that the versions of both gems are synchronized! The release command
will run rake check and will fail if this is not the case. The bump tasks should
synchronize automatically.

2) Run rake release to commit, tag, and upload the gems.