Skip to content

Commit bb951c8

Browse files
authored
Merge pull request #9 from Flagsmith/release/3.0.0
Release/3.0.0
2 parents cfc8c9c + 1976f2a commit bb951c8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+3430
-233
lines changed

.github/workflows/publish.yaml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# This workflow will build the gem from gemspec and publish
2+
3+
name: Push Ruby Gem
4+
5+
on:
6+
push:
7+
tags:
8+
- '*'
9+
10+
jobs:
11+
release:
12+
runs-on: ubuntu-latest
13+
env:
14+
GEM_HOST_API_KEY: ${{ secrets.GEM_HOST_API_KEY }}
15+
steps:
16+
- uses: actions/checkout@v3
17+
with:
18+
fetch-depth: 0 # need all the commits
19+
- uses: ruby/setup-ruby@v1
20+
with:
21+
ruby-version: .ruby-version
22+
bundler-cache: true
23+
- name: Configure Git
24+
run: |
25+
git config --local user.email "[email protected]"
26+
git config --local user.name "GitHub Action"
27+
- name: Bump and Commit
28+
run: |
29+
git push --follow-tags
30+
- name: Buld and Push to rubygems.org
31+
run: |
32+
rake release[remote]

.github/workflows/pull_request.yaml

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support
4+
# documentation.
5+
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
6+
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
7+
8+
name: CI RSpec Tests
9+
10+
on:
11+
pull_request:
12+
types:
13+
- opened
14+
- synchronize
15+
- reopened
16+
- ready_for_review
17+
18+
push:
19+
branches:
20+
- main
21+
22+
permissions:
23+
contents: read
24+
25+
jobs:
26+
test:
27+
name: CI
28+
runs-on: ubuntu-latest
29+
strategy:
30+
matrix:
31+
ruby-version: ['2.4', '2.5', '2.6', '2.7', '3.0', '3.1']
32+
33+
steps:
34+
- uses: actions/checkout@v3
35+
with:
36+
submodules: recursive
37+
- name: Set up Ruby
38+
# To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
39+
# change this to (see https://github.com/ruby/setup-ruby#versioning):
40+
uses: ruby/setup-ruby@v1
41+
with:
42+
ruby-version: ${{ matrix.ruby-version }}
43+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
44+
- name: Run tests
45+
run: bundle exec rspec spec

.gitignore

+3-2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
/pkg/
1414
/spec/reports/
1515
/spec/examples.txt
16+
.rspec_status
1617
/test/tmp/
1718
/test/version_tmp/
1819
/tmp/
@@ -51,7 +52,7 @@ build-iPhoneSimulator/
5152
# intended to run in multiple environments; otherwise, check them in:
5253
# Gemfile.lock
5354
# .ruby-version
54-
# .ruby-gemset
55+
.ruby-gemset
5556

5657
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
57-
.rvmrc
58+
.rvmrc

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "spec/engine-test-data"]
2+
path = spec/engine-test-data
3+
url = [email protected]:Flagsmith/engine-test-data.git

.rspec

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
--format documentation
2+
--color

.rubocop.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@ inherit_from: .rubocop_todo.yml
22

33
Layout/HashAlignment:
44
AllowMultipleStyles: true
5-
EnforcedColonStyle: separator
5+
EnforcedColonStyle: key
66
AllCops:
77
NewCops: enable
88
SuggestExtensions: false
9+
Exclude:
10+
- 'spec/**/*'
11+
- 'example/**/*'

.rubocop_todo.yml

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
Metrics/BlockLength:
1313
Exclude:
1414
- '**/*.gemspec'
15-
- 'spec/flagsmith_spec.rb'
1615

1716
# Offense count: 1
1817
# Configuration parameters: AllowedMethods.

.ruby-version

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2.4.0

Gemfile.lock

+35-6
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,52 @@
11
PATH
22
remote: .
33
specs:
4-
flagsmith (2.0.0)
4+
flagsmith (3.0.0)
55
faraday
6+
faraday-retry
67
faraday_middleware
8+
semantic
79

810
GEM
911
remote: https://rubygems.org/
1012
specs:
1113
ast (2.4.1)
14+
coderay (1.1.3)
1215
diff-lcs (1.4.4)
13-
faraday (1.2.0)
16+
faraday (1.10.0)
17+
faraday-em_http (~> 1.0)
18+
faraday-em_synchrony (~> 1.0)
19+
faraday-excon (~> 1.1)
20+
faraday-httpclient (~> 1.0)
21+
faraday-multipart (~> 1.0)
22+
faraday-net_http (~> 1.0)
23+
faraday-net_http_persistent (~> 1.0)
24+
faraday-patron (~> 1.0)
25+
faraday-rack (~> 1.0)
26+
faraday-retry (~> 1.0)
27+
ruby2_keywords (>= 0.0.4)
28+
faraday-em_http (1.0.0)
29+
faraday-em_synchrony (1.0.0)
30+
faraday-excon (1.1.0)
31+
faraday-httpclient (1.0.1)
32+
faraday-multipart (1.0.3)
1433
multipart-post (>= 1.2, < 3)
15-
ruby2_keywords
16-
faraday_middleware (1.0.0)
34+
faraday-net_http (1.0.1)
35+
faraday-net_http_persistent (1.2.0)
36+
faraday-patron (1.0.0)
37+
faraday-rack (1.0.0)
38+
faraday-retry (1.0.3)
39+
faraday_middleware (1.2.0)
1740
faraday (~> 1.0)
1841
gem-release (2.2.0)
42+
method_source (1.0.0)
1943
multipart-post (2.1.1)
2044
parallel (1.20.1)
2145
parser (3.0.0.0)
2246
ast (~> 2.4.1)
47+
pry (0.14.1)
48+
coderay (~> 1.1)
49+
method_source (~> 1.0)
2350
rainbow (3.0.0)
2451
rake (13.0.3)
2552
regexp_parser (2.0.3)
@@ -49,7 +76,8 @@ GEM
4976
rubocop-ast (1.3.0)
5077
parser (>= 2.7.1.5)
5178
ruby-progressbar (1.10.1)
52-
ruby2_keywords (0.0.2)
79+
ruby2_keywords (0.0.5)
80+
semantic (1.6.1)
5381
unicode-display_width (1.7.0)
5482

5583
PLATFORMS
@@ -59,9 +87,10 @@ DEPENDENCIES
5987
bundler
6088
flagsmith!
6189
gem-release
90+
pry
6291
rake
6392
rspec
6493
rubocop
6594

6695
BUNDLED WITH
67-
1.17.2
96+
2.3.14

Rakefile

+5-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,8 @@ require 'rspec/core/rake_task'
55

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

8-
task default: :spec
8+
require 'rubocop/rake_task'
9+
10+
RuboCop::RakeTask.new
11+
12+
task default: %i[spec rubocop]

bin/console

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env ruby
2+
# frozen_string_literal: true
3+
4+
require 'bundler/setup'
5+
require 'flagsmith'
6+
7+
# You can add fixtures and/or initialization code here to make experimenting
8+
# with your gem easier. You can also use a different console, if you like.
9+
10+
# (If you use this, don't forget to add pry to your Gemfile!)
11+
require 'pry'
12+
Pry.start
13+
14+
require 'irb'
15+
IRB.start(__FILE__)

bin/setup

+8
Original file line numberDiff line numberDiff line change
@@ -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

example/.env.development

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Define ENV variables for development environment
2+
DATABASE_URL="sqlite://db/example_development.sqlite"
3+
SERVE_STATIC_ASSETS="true"
4+
WEB_SESSIONS_SECRET="4743628fa58981a0eaf99cc636146f49ceffd0ab6a8423c0e2493e67cd825f67"
5+
FLAGSMITH_ENVIRONMENT_KEY="YOUR_FLAGSMITH_ENVIRONMENT_KEY"

example/.env.test

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Define ENV variables for test environment
2+
DATABASE_URL="sqlite://db/example_test.sqlite"
3+
SERVE_STATIC_ASSETS="true"
4+
WEB_SESSIONS_SECRET="50f1a22a68ccc6d06b48387f4cd4aa63cbaabd2b525c288f0f7a7046b10cc6ac"

example/.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/db/*.sqlite
2+
/public/assets*
3+
/tmp
4+
.env.local
5+
.env.*.local

example/.hanamirc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
project=example
2+
test=rspec
3+
template=slim

example/.rspec

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
--color
2+
--require spec_helper

example/Gemfile

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
source 'https://rubygems.org'
2+
3+
gem 'hanami', '~> 1.3'
4+
gem 'hanami-model', '~> 1.3'
5+
gem 'slim'
6+
gem 'sqlite3'
7+
gem "puma", "~> 5.6"
8+
9+
gemspec path: '../'
10+
11+
group :development do
12+
# Code reloading
13+
# See: https://guides.hanamirb.org/projects/code-reloading
14+
gem 'hanami-webconsole'
15+
gem 'shotgun', platforms: :ruby
16+
end
17+
18+
group :test, :development do
19+
gem 'dotenv', '~> 2.4'
20+
end
21+
22+
group :test do
23+
gem 'capybara'
24+
gem 'rspec'
25+
end

0 commit comments

Comments
 (0)