shill 0.1.0 → 0.2.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: c856b97b9e77c751f97f81f2b4ccf1d4bab2d939ad808d86cd86703bbe7616ae
4
- data.tar.gz: 2aee215e4a54aed30f179e7da637a3ede554e3a689bc36690f39d7251b1941e0
3
+ metadata.gz: 4f0ffc8cf45e7690dea17a48ab6370bb9016df49f0e6ca70b701c782316db2ae
4
+ data.tar.gz: 37f21d5c06c84e3f4afd104331476fb17a8f5789cf6c1bfd230678b5b94218e1
5
5
  SHA512:
6
- metadata.gz: 7d7abda12e3b7d075e20cce210951639a814379542537cc922cc216178f39e2f6fbbc55ed6ff2bee8973890758f8ff71965d1c87cb128b70ef3757a561ba37a7
7
- data.tar.gz: 4dd8770a375b40f3d2440ca5a51859abbd3447306cf1bc8e9df136cbebc1f38daeca369962510fe6865715a349f21bd37fee15a8463cb03ca1871e85217f7427
6
+ metadata.gz: fa60818f20a34a3080ea6dc83f58a005b546ce59f56a277b245e1f46e6332e284de696e3fe654000b3e8fd0aa3d34ab4401dd3145e0f2a9bb86073a19c8b4329
7
+ data.tar.gz: a2add6060a5e0af99d10faadd0ce372d054c1780b7515620dae1a6bcc66b33b1e17735c0c2dd9e6a81ca321d8ea9e99a29b3fb236e45e0b8414131d3a6b7076c
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.1.1] - 2025-05-15
4
+
5
+ - Fix: Replace example URLs
6
+
3
7
  ## [0.1.0] - 2025-05-15
4
8
 
5
9
  - Initial release
data/README.md CHANGED
@@ -14,8 +14,7 @@ A tiny, dependency-free Ruby gem that fetches and exposes a list of projects fro
14
14
  Add the gem to your project:
15
15
 
16
16
  ```ruby
17
- gem "shill", github: "marckohlbrugge/shill" # until published on RubyGems
18
- gem "shill" # once published
17
+ gem "shill"
19
18
  ```
20
19
 
21
20
  Then install:
@@ -115,6 +114,39 @@ bundle install
115
114
  bundle exec rake test # runs the Minitest suite
116
115
  ```
117
116
 
117
+ ### Releasing a new version
118
+
119
+ 1. Bump the version in `lib/shill/version.rb` following [Semantic Versioning](https://semver.org/) (e.g. `0.1.1` → `0.1.2`).
120
+ 2. Update `CHANGELOG.md` (optional but recommended).
121
+ 3. Commit the changes:
122
+
123
+ ```bash
124
+ git commit -am "Bump version to x.y.z"
125
+ ```
126
+
127
+ 4. Run the Bundler release task (builds, pushes the gem, and tags the commit):
128
+
129
+ ```bash
130
+ bundle exec rake release # same as `rake release`
131
+ ```
132
+
133
+ Behind the scenes this will:
134
+
135
+ * Run `rake build` → creates `pkg/shill-x.y.z.gem`.
136
+ * Run `gem push` to upload the new gem to RubyGems.org using your saved API key.
137
+ * Create a Git tag `vX.Y.Z` and push it to the origin.
138
+
139
+ 5. Done! The new version will be live on RubyGems within a minute or so.
140
+
141
+ If you prefer to do things manually you can replicate the steps yourself:
142
+
143
+ ```bash
144
+ rake build # => pkg/shill-x.y.z.gem
145
+ gem push pkg/shill-x.y.z.gem # upload
146
+ git tag -a vX.Y.Z -m "Release vX.Y.Z"
147
+ git push && git push --tags
148
+ ```
149
+
118
150
  ---
119
151
 
120
152
  ## Contributing
@@ -146,3 +178,27 @@ Shill.projects(refresh: true) # bypasses cache and stores fresh data
146
178
  ```
147
179
 
148
180
  ---
181
+
182
+ ## Rails view helpers
183
+
184
+ Once the gem is loaded in a Rails app, you can access the data directly in any view:
185
+
186
+ ```erb
187
+ <ul>
188
+ <% shill_projects.each do |project| %>
189
+ <li>
190
+ <%= link_to project.name, project.url %> — <%= project.description %>
191
+ </li>
192
+ <% end %>
193
+ </ul>
194
+ ```
195
+
196
+ Need just one?
197
+
198
+ ```erb
199
+ <% if (proj = shill_random_project) %>
200
+ <%= link_to proj.name, proj.url %>
201
+ <% end %>
202
+ ```
203
+
204
+ ---
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Shill
4
+ # View-helper methods for Rails
5
+ module Helpers
6
+ # Returns all cached projects (see Shill.projects)
7
+ def shill_projects
8
+ Shill.projects
9
+ end
10
+
11
+ # Returns a single random project
12
+ def shill_random_project
13
+ Shill.random_project
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "rails/railtie"
4
+
5
+ module Shill
6
+ class Railtie < ::Rails::Railtie
7
+ initializer "shill.view_helpers" do
8
+ ActiveSupport.on_load(:action_view) do
9
+ include Shill::Helpers
10
+ end
11
+ end
12
+ end
13
+ end
data/lib/shill/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Shill
4
- VERSION = "0.1.0"
4
+ VERSION = "0.2.0"
5
5
  end
data/lib/shill.rb CHANGED
@@ -1,6 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative "shill/version"
4
+ # Autoload internal files
5
+ require_relative "shill/helpers"
6
+
7
+ # Load Railtie if Rails is present
8
+ if defined?(Rails::Railtie)
9
+ require_relative "shill/railtie"
10
+ end
4
11
 
5
12
  module Shill
6
13
  class Error < StandardError; end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shill
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marc Köhlbrugge
@@ -24,16 +24,18 @@ files:
24
24
  - README.md
25
25
  - Rakefile
26
26
  - lib/shill.rb
27
+ - lib/shill/helpers.rb
28
+ - lib/shill/railtie.rb
27
29
  - lib/shill/version.rb
28
30
  - sig/shill.rbs
29
- homepage: https://github.com/example/shill
31
+ homepage: https://github.com/marckohlbrugge/shill
30
32
  licenses:
31
33
  - MIT
32
34
  metadata:
33
35
  allowed_push_host: https://rubygems.org
34
- homepage_uri: https://github.com/example/shill
35
- source_code_uri: https://github.com/example/shill
36
- changelog_uri: https://github.com/example/shill/blob/main/CHANGELOG.md
36
+ homepage_uri: https://github.com/marckohlbrugge/shill
37
+ source_code_uri: https://github.com/marckohlbrugge/shill
38
+ changelog_uri: https://github.com/marckohlbrugge/shill/blob/main/CHANGELOG.md
37
39
  post_install_message:
38
40
  rdoc_options: []
39
41
  require_paths: