Skip to content

Commit

Permalink
Merge pull request #9 from Flagsmith/release/3.0.0
Browse files Browse the repository at this point in the history
Release/3.0.0
  • Loading branch information
dabeeeenster authored Jun 7, 2022
2 parents cfc8c9c + 1976f2a commit bb951c8
Show file tree
Hide file tree
Showing 88 changed files with 3,430 additions and 233 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# This workflow will build the gem from gemspec and publish

name: Push Ruby Gem

on:
push:
tags:
- '*'

jobs:
release:
runs-on: ubuntu-latest
env:
GEM_HOST_API_KEY: ${{ secrets.GEM_HOST_API_KEY }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # need all the commits
- uses: ruby/setup-ruby@v1
with:
ruby-version: .ruby-version
bundler-cache: true
- name: Configure Git
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
- name: Bump and Commit
run: |
git push --follow-tags
- name: Buld and Push to rubygems.org
run: |
rake release[remote]
45 changes: 45 additions & 0 deletions .github/workflows/pull_request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby

name: CI RSpec Tests

on:
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review

push:
branches:
- main

permissions:
contents: read

jobs:
test:
name: CI
runs-on: ubuntu-latest
strategy:
matrix:
ruby-version: ['2.4', '2.5', '2.6', '2.7', '3.0', '3.1']

steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Set up Ruby
# To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
# change this to (see https://github.com/ruby/setup-ruby#versioning):
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Run tests
run: bundle exec rspec spec
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
/pkg/
/spec/reports/
/spec/examples.txt
.rspec_status
/test/tmp/
/test/version_tmp/
/tmp/
Expand Down Expand Up @@ -51,7 +52,7 @@ build-iPhoneSimulator/
# intended to run in multiple environments; otherwise, check them in:
# Gemfile.lock
# .ruby-version
# .ruby-gemset
.ruby-gemset

# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
.rvmrc
.rvmrc
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "spec/engine-test-data"]
path = spec/engine-test-data
url = [email protected]:Flagsmith/engine-test-data.git
2 changes: 2 additions & 0 deletions .rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
--format documentation
--color
5 changes: 4 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ inherit_from: .rubocop_todo.yml

Layout/HashAlignment:
AllowMultipleStyles: true
EnforcedColonStyle: separator
EnforcedColonStyle: key
AllCops:
NewCops: enable
SuggestExtensions: false
Exclude:
- 'spec/**/*'
- 'example/**/*'
1 change: 0 additions & 1 deletion .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
Metrics/BlockLength:
Exclude:
- '**/*.gemspec'
- 'spec/flagsmith_spec.rb'

# Offense count: 1
# Configuration parameters: AllowedMethods.
Expand Down
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.4.0
41 changes: 35 additions & 6 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,25 +1,52 @@
PATH
remote: .
specs:
flagsmith (2.0.0)
flagsmith (3.0.0)
faraday
faraday-retry
faraday_middleware
semantic

GEM
remote: https://rubygems.org/
specs:
ast (2.4.1)
coderay (1.1.3)
diff-lcs (1.4.4)
faraday (1.2.0)
faraday (1.10.0)
faraday-em_http (~> 1.0)
faraday-em_synchrony (~> 1.0)
faraday-excon (~> 1.1)
faraday-httpclient (~> 1.0)
faraday-multipart (~> 1.0)
faraday-net_http (~> 1.0)
faraday-net_http_persistent (~> 1.0)
faraday-patron (~> 1.0)
faraday-rack (~> 1.0)
faraday-retry (~> 1.0)
ruby2_keywords (>= 0.0.4)
faraday-em_http (1.0.0)
faraday-em_synchrony (1.0.0)
faraday-excon (1.1.0)
faraday-httpclient (1.0.1)
faraday-multipart (1.0.3)
multipart-post (>= 1.2, < 3)
ruby2_keywords
faraday_middleware (1.0.0)
faraday-net_http (1.0.1)
faraday-net_http_persistent (1.2.0)
faraday-patron (1.0.0)
faraday-rack (1.0.0)
faraday-retry (1.0.3)
faraday_middleware (1.2.0)
faraday (~> 1.0)
gem-release (2.2.0)
method_source (1.0.0)
multipart-post (2.1.1)
parallel (1.20.1)
parser (3.0.0.0)
ast (~> 2.4.1)
pry (0.14.1)
coderay (~> 1.1)
method_source (~> 1.0)
rainbow (3.0.0)
rake (13.0.3)
regexp_parser (2.0.3)
Expand Down Expand Up @@ -49,7 +76,8 @@ GEM
rubocop-ast (1.3.0)
parser (>= 2.7.1.5)
ruby-progressbar (1.10.1)
ruby2_keywords (0.0.2)
ruby2_keywords (0.0.5)
semantic (1.6.1)
unicode-display_width (1.7.0)

PLATFORMS
Expand All @@ -59,9 +87,10 @@ DEPENDENCIES
bundler
flagsmith!
gem-release
pry
rake
rspec
rubocop

BUNDLED WITH
1.17.2
2.3.14
6 changes: 5 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,8 @@ require 'rspec/core/rake_task'

RSpec::Core::RakeTask.new(:spec)

task default: :spec
require 'rubocop/rake_task'

RuboCop::RakeTask.new

task default: %i[spec rubocop]
15 changes: 15 additions & 0 deletions bin/console
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

require 'bundler/setup'
require 'flagsmith'

# You can add fixtures and/or initialization code here to make experimenting
# with your gem easier. You can also use a different console, if you like.

# (If you use this, don't forget to add pry to your Gemfile!)
require 'pry'
Pry.start

require 'irb'
IRB.start(__FILE__)
8 changes: 8 additions & 0 deletions bin/setup
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash
set -euo pipefail
IFS=$'\n\t'
set -vx

bundle install

# Do any other automated setup that you need to do here
5 changes: 5 additions & 0 deletions example/.env.development
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Define ENV variables for development environment
DATABASE_URL="sqlite://db/example_development.sqlite"
SERVE_STATIC_ASSETS="true"
WEB_SESSIONS_SECRET="4743628fa58981a0eaf99cc636146f49ceffd0ab6a8423c0e2493e67cd825f67"
FLAGSMITH_ENVIRONMENT_KEY="YOUR_FLAGSMITH_ENVIRONMENT_KEY"
4 changes: 4 additions & 0 deletions example/.env.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Define ENV variables for test environment
DATABASE_URL="sqlite://db/example_test.sqlite"
SERVE_STATIC_ASSETS="true"
WEB_SESSIONS_SECRET="50f1a22a68ccc6d06b48387f4cd4aa63cbaabd2b525c288f0f7a7046b10cc6ac"
5 changes: 5 additions & 0 deletions example/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/db/*.sqlite
/public/assets*
/tmp
.env.local
.env.*.local
3 changes: 3 additions & 0 deletions example/.hanamirc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
project=example
test=rspec
template=slim
2 changes: 2 additions & 0 deletions example/.rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
--color
--require spec_helper
25 changes: 25 additions & 0 deletions example/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
source 'https://rubygems.org'

gem 'hanami', '~> 1.3'
gem 'hanami-model', '~> 1.3'
gem 'slim'
gem 'sqlite3'
gem "puma", "~> 5.6"

gemspec path: '../'

group :development do
# Code reloading
# See: https://guides.hanamirb.org/projects/code-reloading
gem 'hanami-webconsole'
gem 'shotgun', platforms: :ruby
end

group :test, :development do
gem 'dotenv', '~> 2.4'
end

group :test do
gem 'capybara'
gem 'rspec'
end
Loading

0 comments on commit bb951c8

Please sign in to comment.