Skip to content

Commit 422afea

Browse files
author
Nicholas Barone
committed
Basic setup
1 parent bc9d4fe commit 422afea

File tree

9 files changed

+184
-35
lines changed

9 files changed

+184
-35
lines changed

.github/workflows/ci.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Test & lint
2+
on: [push, pull_request]
3+
4+
jobs:
5+
tests:
6+
name: Test
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- name: Checkout code
11+
uses: actions/checkout@v4
12+
with:
13+
fetch-depth: '20'
14+
15+
- name: Setup Ruby
16+
uses: ruby/setup-ruby@v1
17+
18+
- run: bundle install
19+
20+
- name: RSpec
21+
run: bundle exec rspec
22+
23+
lint:
24+
name: Lint
25+
runs-on: ubuntu-latest
26+
27+
steps:
28+
- name: Checkout code
29+
uses: actions/checkout@v4
30+
31+
- name: Setup Ruby
32+
uses: ruby/setup-ruby@v1
33+
34+
- run: bundle install
35+
36+
- name: Run linter
37+
run: bundle exec rubocop

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,5 @@
99

1010
# rspec failure tracking
1111
.rspec_status
12+
13+
*.gem

.rubocop.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
inherit_gem:
2+
rubocop-rails-omakase: rubocop.yml

.ruby-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ruby-3.3.4

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
source "https://rubygems.org"
22

3-
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
3+
git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
44

55
# Specify your gem's dependencies in rails-storybook.gemspec
66
gemspec

Gemfile.lock

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
PATH
2+
remote: .
3+
specs:
4+
rails-storybook (0.1.0)
5+
6+
GEM
7+
remote: https://rubygems.org/
8+
specs:
9+
activesupport (7.1.3.4)
10+
base64
11+
bigdecimal
12+
concurrent-ruby (~> 1.0, >= 1.0.2)
13+
connection_pool (>= 2.2.5)
14+
drb
15+
i18n (>= 1.6, < 2)
16+
minitest (>= 5.1)
17+
mutex_m
18+
tzinfo (~> 2.0)
19+
ast (2.4.2)
20+
base64 (0.2.0)
21+
bigdecimal (3.1.8)
22+
concurrent-ruby (1.3.3)
23+
connection_pool (2.4.1)
24+
debug (1.9.2)
25+
irb (~> 1.10)
26+
reline (>= 0.3.8)
27+
diff-lcs (1.5.1)
28+
drb (2.2.1)
29+
i18n (1.14.5)
30+
concurrent-ruby (~> 1.0)
31+
io-console (0.7.2)
32+
irb (1.14.0)
33+
rdoc (>= 4.0.0)
34+
reline (>= 0.4.2)
35+
json (2.7.2)
36+
language_server-protocol (3.17.0.3)
37+
minitest (5.24.1)
38+
mutex_m (0.2.0)
39+
parallel (1.25.1)
40+
parser (3.3.4.0)
41+
ast (~> 2.4.1)
42+
racc
43+
psych (5.1.2)
44+
stringio
45+
racc (1.8.1)
46+
rack (3.1.7)
47+
rainbow (3.1.1)
48+
rake (13.2.1)
49+
rdoc (6.7.0)
50+
psych (>= 4.0.0)
51+
regexp_parser (2.9.2)
52+
reline (0.5.9)
53+
io-console (~> 0.5)
54+
rexml (3.3.4)
55+
strscan
56+
rspec (3.13.0)
57+
rspec-core (~> 3.13.0)
58+
rspec-expectations (~> 3.13.0)
59+
rspec-mocks (~> 3.13.0)
60+
rspec-core (3.13.0)
61+
rspec-support (~> 3.13.0)
62+
rspec-expectations (3.13.1)
63+
diff-lcs (>= 1.2.0, < 2.0)
64+
rspec-support (~> 3.13.0)
65+
rspec-mocks (3.13.1)
66+
diff-lcs (>= 1.2.0, < 2.0)
67+
rspec-support (~> 3.13.0)
68+
rspec-support (3.13.1)
69+
rubocop (1.65.1)
70+
json (~> 2.3)
71+
language_server-protocol (>= 3.17.0)
72+
parallel (~> 1.10)
73+
parser (>= 3.3.0.2)
74+
rainbow (>= 2.2.2, < 4.0)
75+
regexp_parser (>= 2.4, < 3.0)
76+
rexml (>= 3.2.5, < 4.0)
77+
rubocop-ast (>= 1.31.1, < 2.0)
78+
ruby-progressbar (~> 1.7)
79+
unicode-display_width (>= 2.4.0, < 3.0)
80+
rubocop-ast (1.31.3)
81+
parser (>= 3.3.1.0)
82+
rubocop-minitest (0.35.1)
83+
rubocop (>= 1.61, < 2.0)
84+
rubocop-ast (>= 1.31.1, < 2.0)
85+
rubocop-performance (1.21.1)
86+
rubocop (>= 1.48.1, < 2.0)
87+
rubocop-ast (>= 1.31.1, < 2.0)
88+
rubocop-rails (2.25.1)
89+
activesupport (>= 4.2.0)
90+
rack (>= 1.1)
91+
rubocop (>= 1.33.0, < 2.0)
92+
rubocop-ast (>= 1.31.1, < 2.0)
93+
rubocop-rails-omakase (1.0.0)
94+
rubocop
95+
rubocop-minitest
96+
rubocop-performance
97+
rubocop-rails
98+
ruby-progressbar (1.13.0)
99+
stringio (3.1.1)
100+
strscan (3.1.0)
101+
tzinfo (2.0.6)
102+
concurrent-ruby (~> 1.0)
103+
unicode-display_width (2.5.0)
104+
105+
PLATFORMS
106+
ruby
107+
x86_64-darwin-23
108+
109+
DEPENDENCIES
110+
bundler (~> 2.5)
111+
debug (~> 1.6)
112+
rails-storybook!
113+
rake (~> 13.2)
114+
rspec (~> 3.13)
115+
rubocop (~> 1.6)
116+
rubocop-rails-omakase (~> 1.0)
117+
118+
BUNDLED WITH
119+
2.5.16

README.md

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# Rails::Storybook
22

3-
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/rails/storybook`. To experiment with that code, run `bin/console` for an interactive prompt.
3+
[![Gem Version](https://badge.fury.io/rb/rails-storybook.svg)](https://badge.fury.io/rb/rails-storybook)
4+
![ci](https://github.com/rangerscience/rails-storybook/actions/workflows/ci.yml/badge.svg)
5+
[![code-climate](https://codeclimate.com/github/rangerscience/rails-storybook.svg)](https://codeclimate.com/github/rangerscience/rails-storybook)
46

5-
TODO: Delete this and the text above, and describe your gem
7+
Storybook is a very cool Javascript ecosystem tool, aiding in the development of component-based UIs. It takes a little bit of doing to make it play nicely with Rails. And, a main benefit of using Storybook is that it lets you use Chromatic - which means no more need for *a lot* of your UI tests!
68

79
## Installation
810

@@ -12,32 +14,28 @@ Add this line to your application's Gemfile:
1214
gem 'rails-storybook'
1315
```
1416

15-
And then execute:
16-
17-
$ bundle
18-
19-
Or install it yourself as:
20-
21-
$ gem install rails-storybook
17+
TODO
2218

2319
## Usage
2420

2521
TODO: Write usage instructions here
2622

2723
## Development
2824

25+
TODO
26+
2927
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
3028

3129
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
3230

3331
## Contributing
3432

35-
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/rails-storybook. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
33+
Bug reports and pull requests are welcome on GitHub at https://github.com/rangerscience/rails-storybook. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
3634

3735
## License
3836

3937
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
4038

4139
## Code of Conduct
4240

43-
Everyone interacting in the Rails::Storybook project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/rails-storybook/blob/master/CODE_OF_CONDUCT.md).
41+
Everyone interacting in the Rails::Storybook project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/rangerscience/rails-storybook/blob/master/CODE_OF_CONDUCT.md).

Rakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ require "rspec/core/rake_task"
33

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

6-
task :default => :spec
6+
task default: :spec

rails-storybook.gemspec

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,37 +6,27 @@ require "rails/storybook/version"
66
Gem::Specification.new do |spec|
77
spec.name = "rails-storybook"
88
spec.version = Rails::Storybook::VERSION
9-
spec.authors = ["Nicholas Barone"]
10-
spec.email = ["[email protected]"]
9+
spec.authors = [ "Nicholas Barone" ]
10+
spec.email = [ "[email protected]" ]
1111

12-
spec.summary = %q{TODO: Write a short summary, because RubyGems requires one.}
13-
spec.description = %q{TODO: Write a longer description or delete this line.}
14-
spec.homepage = "TODO: Put your gem's website or public repo URL here."
12+
spec.summary = %q(Gem to allow Storybook to work with Rails)
13+
spec.description = %q(...specifically for use with Chromatic)
14+
spec.homepage = "https://github.com/rangerscience/rails-storybook"
1515
spec.license = "MIT"
1616

17-
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
18-
# to allow pushing to a single host or delete this section to allow pushing to any host.
19-
if spec.respond_to?(:metadata)
20-
spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'"
21-
22-
spec.metadata["homepage_uri"] = spec.homepage
23-
spec.metadata["source_code_uri"] = "TODO: Put your gem's public repo URL here."
24-
spec.metadata["changelog_uri"] = "TODO: Put your gem's CHANGELOG.md URL here."
25-
else
26-
raise "RubyGems 2.0 or newer is required to protect against " \
27-
"public gem pushes."
28-
end
29-
3017
# Specify which files should be added to the gem when it is released.
3118
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
3219
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
3320
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
3421
end
3522
spec.bindir = "exe"
3623
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
37-
spec.require_paths = ["lib"]
24+
spec.require_paths = [ "lib" ]
3825

39-
spec.add_development_dependency "bundler", "~> 1.17"
40-
spec.add_development_dependency "rake", "~> 10.0"
41-
spec.add_development_dependency "rspec", "~> 3.0"
26+
spec.add_development_dependency "bundler", "~> 2.5"
27+
spec.add_development_dependency "rake", "~> 13.2"
28+
spec.add_development_dependency "rspec", "~> 3.13"
29+
spec.add_development_dependency "debug", "~> 1.6"
30+
spec.add_development_dependency "rubocop", "~> 1.6"
31+
spec.add_development_dependency "rubocop-rails-omakase", "~> 1.0"
4232
end

0 commit comments

Comments
 (0)