rollout-ui 0.7.1 → 0.8.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6f52e6f2464930c297ee97dfa2e73771ef20dc1c345186582c4f211ddc16a9bc
4
- data.tar.gz: 72b761a78d4607396ee71860ff9d5f36fd57563fcba018e34ed374fc308dd3d0
3
+ metadata.gz: abb4b1f85851c0127d87fcb8c428fd704d40b1e4c7b976ce8474d90eb449ab2e
4
+ data.tar.gz: e9bf31f2540a4811fd5aa4df4b9eb19a0cb77c88955a72d34694703359adc222
5
5
  SHA512:
6
- metadata.gz: c9a1eec0c0b71f92458be1f494a99098aa1a7d8bce482c47f45f90de8566dcc2643e97bf2f8bad90c209456dd459e8d462c4edae804e31fc6283bc2f14836f19
7
- data.tar.gz: c9e5d5ddaea0f7cb5302d67f7f4b3e709ee63b916a5a2aa7f2b7075af8a3034f2bfca0d00b7cb634082bb5319f03a727d688ab84109d431922edfb9122dee520
6
+ metadata.gz: 9b7ca3dae1414eced5038c1e3bdaf73e2e6f870f2164fab88cad497d98d42fcf863c70c286df9f7b9058cd36020f3fcf4106e50c6d44ed0c997f9410740271d5
7
+ data.tar.gz: 0b3ce4474df18ec347fff573d6a112c848cbe4d6c0e678ec773206385eecb0f45ef116a0fde1f02760c071912e93db42a56a47b528f502e59149858aa88e7e42
@@ -0,0 +1,46 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v*'
7
+
8
+ jobs:
9
+ release:
10
+ runs-on: ubuntu-latest
11
+ services:
12
+ redis:
13
+ image: redis:7-alpine
14
+ ports:
15
+ - 6379:6379
16
+ options: >-
17
+ --health-cmd "redis-cli ping"
18
+ --health-interval 10s
19
+ --health-timeout 5s
20
+ --health-retries 5
21
+ steps:
22
+ - name: Checkout code
23
+ uses: actions/checkout@v4
24
+ - name: Setup Ruby
25
+ uses: ruby/setup-ruby@v1
26
+ with:
27
+ bundler-cache: true
28
+ - name: Run tests
29
+ run: bundle exec rspec
30
+ - name: Create GitHub Release
31
+ uses: softprops/action-gh-release@v2
32
+ with:
33
+ tag_name: ${{ github.ref }}
34
+ name: ${{ github.ref_name }}
35
+ generate_release_notes: true
36
+ draft: false
37
+ prerelease: false
38
+ - name: Set up RubyGems credentials
39
+ env:
40
+ RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}
41
+ run: |
42
+ mkdir -p ~/.gem
43
+ echo ":rubygems_api_key: $RUBYGEMS_API_KEY" > ~/.gem/credentials
44
+ chmod 0600 ~/.gem/credentials
45
+ - name: Release to RubyGems
46
+ run: bundle exec rake release
@@ -0,0 +1,32 @@
1
+ name: Test
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - master
7
+ pull_request:
8
+ branches:
9
+ - master
10
+
11
+ jobs:
12
+ test:
13
+ runs-on: ubuntu-latest
14
+ services:
15
+ redis:
16
+ image: redis:7-alpine
17
+ ports:
18
+ - 6379:6379
19
+ options: >-
20
+ --health-cmd "redis-cli ping"
21
+ --health-interval 10s
22
+ --health-timeout 5s
23
+ --health-retries 5
24
+ steps:
25
+ - name: Checkout code
26
+ uses: actions/checkout@v4
27
+ - name: Setup Ruby
28
+ uses: ruby/setup-ruby@v1
29
+ with:
30
+ bundler-cache: true
31
+ - name: Run tests
32
+ run: bundle exec rspec
data/.mise.toml ADDED
@@ -0,0 +1,2 @@
1
+ [tools]
2
+ ruby = "3.4.7"
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.3.0
1
+ 3.4.7
data/README.md CHANGED
@@ -92,21 +92,45 @@ end
92
92
 
93
93
  Bug reports and pull requests are welcome on GitHub at https://github.com/fetlife/rollout-ui.
94
94
 
95
- To run this project for development in isolation:
95
+ ### Development Setup
96
+
97
+ This project uses [mise](https://mise.jdx.dev/) for managing development tools.
98
+
99
+ Install mise if you haven't already:
100
+
101
+ ```sh
102
+ curl https://mise.run | sh
103
+ ```
104
+
105
+ Then install the required tools and dependencies:
96
106
 
97
107
  ```sh
108
+ mise install
98
109
  bundle install
110
+ ```
111
+
112
+ To run this project for development in isolation:
113
+
114
+ ```sh
99
115
  bundle exec rerun rackup
100
116
  ```
101
117
 
102
118
  And visit [http://localhost:9292/](http://localhost:9292/).
103
119
 
104
- Alternatively you can also configure which Redis with:
120
+ Alternatively, you can also configure which Redis with:
105
121
 
106
122
  ```sh
107
123
  REDIS_HOST=localhost REDIS_PORT=6379 REDIS_DB=10 bundle exec rerun rackup
108
124
  ```
109
125
 
126
+ ### Releasing
127
+
128
+ 1. Bump version: `rake version:patch` (or `minor`/`major`)
129
+ 2. Commit and tag: `git commit -am "Bump version" && git tag v0.7.3`
130
+ 3. Push: `git push origin master --tags`
131
+
132
+ The GitHub Actions workflow will automatically publish to RubyGems when tags are pushed.
133
+
110
134
  ## License
111
135
 
112
136
  The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
data/Rakefile CHANGED
@@ -4,3 +4,45 @@ require "rspec/core/rake_task"
4
4
  RSpec::Core::RakeTask.new(:spec)
5
5
 
6
6
  task :default => :spec
7
+
8
+ namespace :version do
9
+ desc "Bump patch version"
10
+ task :patch do
11
+ bump_version(:patch)
12
+ end
13
+
14
+ desc "Bump minor version"
15
+ task :minor do
16
+ bump_version(:minor)
17
+ end
18
+
19
+ desc "Bump major version"
20
+ task :major do
21
+ bump_version(:major)
22
+ end
23
+ end
24
+
25
+ def bump_version(type)
26
+ require 'rollout/ui/version'
27
+ current_version = Rollout::UI::VERSION
28
+ major, minor, patch = current_version.split('.').map(&:to_i)
29
+
30
+ new_version = case type
31
+ when :major
32
+ "#{major + 1}.0.0"
33
+ when :minor
34
+ "#{major}.#{minor + 1}.0"
35
+ when :patch
36
+ "#{major}.#{minor}.#{patch + 1}"
37
+ end
38
+
39
+ puts "Bumping version from #{current_version} to #{new_version}"
40
+
41
+ # Update version file
42
+ version_file = 'lib/rollout/ui/version.rb'
43
+ content = File.read(version_file)
44
+ updated_content = content.gsub(/VERSION\s*=\s*"[^"]+"/, "VERSION = \"#{new_version}\"")
45
+ File.write(version_file, updated_content)
46
+
47
+ puts "Version bumped to #{new_version}"
48
+ end
@@ -1,5 +1,5 @@
1
1
  class Rollout
2
2
  module UI
3
- VERSION = "0.7.1"
3
+ VERSION = "0.8.0"
4
4
  end
5
5
  end
@@ -42,7 +42,11 @@ h2.font-semibold.text-xl.text-gray-500.pt-12.flex.items-center
42
42
  = feature.users.count
43
43
  - if @rollout.respond_to?(:logging)
44
44
  td.py-2.whitespace-no-wrap
45
- span title=@rollout.logging.updated_at(feature_name).strftime(Rollout::UI.config.timestamp_format) = time_ago(@rollout.logging.updated_at(feature_name))
45
+ - updated_at = @rollout.logging.updated_at(feature_name)
46
+ - if updated_at.nil?
47
+ span.text-gray-400 Never
48
+ - else
49
+ span title=updated_at.strftime(Rollout::UI.config.timestamp_format) = time_ago(updated_at)
46
50
  td.flex.items-center.py-2.justify-end.whitespace-no-wrap.pl-3
47
51
  form action=activate_percentage_feature_path(feature_name, 100) method='POST'
48
52
  button.p-3.bg-gray-100.ml-1.rounded-sm.font-bold.leading-none.transition-colors.duration-150(class='hover:bg-gray-200' type='submit' onclick="return confirm('Are you sure you want activate #{sanitized_name(feature_name)} to 100%?')")
@@ -3,15 +3,62 @@ html
3
3
  head
4
4
  title Rollout UI
5
5
  meta name='viewport' content='width=device-width initial-scale=1'
6
+ meta name='color-scheme' content='light dark'
6
7
  link rel='stylesheet' href=stylesheet_path('tailwind.min')
8
+ style
9
+ | :root { color-scheme: light; }
10
+ | :root.dark { color-scheme: dark; }
11
+ | body { transition: background-color 0.2s, color 0.2s; }
12
+ | .dark { background-color: #1a1a1a; color: #e5e5e5; }
13
+ | .dark .text-gray-700 { color: #d1d1d1; }
14
+ | .dark .text-gray-600 { color: #b8b8b8; }
15
+ | .dark .text-gray-500 { color: #9ca3af; }
16
+ | .dark .text-gray-400 { color: #6b7280; }
17
+ | .dark .bg-gray-100 { background-color: #2a2a2a; }
18
+ | .dark .bg-gray-200 { background-color: #333333; }
19
+ | .dark .bg-gray-300 { background-color: #404040; }
20
+ | .dark .border-gray-200 { border-color: #404040; }
21
+ | .dark .hover\:bg-gray-200:hover { background-color: #3a3a3a; }
22
+ | .dark .text-blue-600 { color: #60a5fa; }
23
+ | .dark .hover\:text-blue-700:hover { color: #93c5fd; }
7
24
 
8
25
  body
9
26
  / Addresses https://stackoverflow.com/questions/21147149/flash-of-unstyled-content-fouc-in-firefox-only-is-ff-slow-renderer
10
27
  script 0
11
28
 
29
+ script
30
+ | (function() {
31
+ | const theme = localStorage.getItem('theme') || 'system';
32
+ | function applyTheme(t) {
33
+ | const root = document.documentElement;
34
+ | if (t === 'dark' || (t === 'system' && window.matchMedia('(prefers-color-scheme: dark)').matches)) {
35
+ | root.classList.add('dark');
36
+ | } else {
37
+ | root.classList.remove('dark');
38
+ | }
39
+ | }
40
+ | applyTheme(theme);
41
+ | window.addEventListener('DOMContentLoaded', function() {
42
+ | const btn = document.getElementById('theme-toggle');
43
+ | btn.textContent = theme;
44
+ | btn.addEventListener('click', function() {
45
+ | const current = localStorage.getItem('theme') || 'system';
46
+ | const next = current === 'light' ? 'dark' : current === 'dark' ? 'system' : 'light';
47
+ | localStorage.setItem('theme', next);
48
+ | applyTheme(next);
49
+ | btn.textContent = next;
50
+ | });
51
+ | window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', function() {
52
+ | if (localStorage.getItem('theme') === 'system') applyTheme('system');
53
+ | });
54
+ | });
55
+ | })();
56
+
12
57
  .container.mx-auto.font-mono.text-gray-700.px-5.pb-20
13
- h1.font-light.text-4xl.text-gray-600.pt-20
14
- a href=index_path class='hover:text-blue-700'
15
- ' Rollout
58
+ .flex.items-center.pt-20
59
+ h1.font-light.text-4xl.text-gray-600.flex-auto
60
+ a href=index_path class='hover:text-blue-700'
61
+ ' Rollout
62
+ button#theme-toggle.text-sm.text-gray-600.p-2.bg-gray-100.rounded-sm.transition-colors.duration-150(class='hover:bg-gray-200') system
16
63
 
17
64
  == yield
data/rollout-ui.gemspec CHANGED
@@ -8,8 +8,8 @@ Gem::Specification.new do |spec|
8
8
  spec.authors = ['FetLife']
9
9
  spec.email = ['dev@fetlife.com']
10
10
 
11
- spec.summary = %q{}
12
- spec.description = %q{}
11
+ spec.summary = %q{Minimalist web ui for the rollout gem}
12
+ spec.description = %q{Rack-mountable app to use and configure feature flags via the rollout gem}
13
13
  spec.homepage = 'https://github.com/fetlife/rollout-ui'
14
14
  spec.license = 'MIT'
15
15
 
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rollout-ui
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - FetLife
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2025-03-27 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: rollout
@@ -196,14 +195,18 @@ dependencies:
196
195
  - - ">="
197
196
  - !ruby/object:Gem::Version
198
197
  version: '0'
199
- description: ''
198
+ description: Rack-mountable app to use and configure feature flags via the rollout
199
+ gem
200
200
  email:
201
201
  - dev@fetlife.com
202
202
  executables: []
203
203
  extensions: []
204
204
  extra_rdoc_files: []
205
205
  files:
206
+ - ".github/workflows/release.yml"
207
+ - ".github/workflows/test.yml"
206
208
  - ".gitignore"
209
+ - ".mise.toml"
207
210
  - ".rspec"
208
211
  - ".ruby-version"
209
212
  - Gemfile
@@ -231,7 +234,6 @@ homepage: https://github.com/fetlife/rollout-ui
231
234
  licenses:
232
235
  - MIT
233
236
  metadata: {}
234
- post_install_message:
235
237
  rdoc_options: []
236
238
  require_paths:
237
239
  - lib
@@ -246,8 +248,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
246
248
  - !ruby/object:Gem::Version
247
249
  version: '0'
248
250
  requirements: []
249
- rubygems_version: 3.5.3
250
- signing_key:
251
+ rubygems_version: 3.6.9
251
252
  specification_version: 4
252
- summary: ''
253
+ summary: Minimalist web ui for the rollout gem
253
254
  test_files: []