Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Use gem-release in extensions

Damian Legawiecaf186a2f90ab
diff --git a/cmd/lib/spree_cmd/templates/extension/README.md b/cmd/lib/spree_cmd/templates/extension/README.md
index b46c46c87c..09cafc0c1f 100644
--- a/cmd/lib/spree_cmd/templates/extension/README.md
+++ b/cmd/lib/spree_cmd/templates/extension/README.md
@@ -7,7 +7,7 @@ Introduction goes here.
1. Add this extension to your Gemfile with this line:
```ruby
- gem '<%= file_name %>', github: '[your-github-handle]/<%= file_name %>'
+ gem '<%= file_name %>'
```
2. Install the gem using Bundler
@@ -42,6 +42,15 @@ Simply add this require statement to your spec_helper:
require '<%= file_name %>/factories'
```
+## Releasing
+
+```shell
+bundle exec gem bump -p -t
+bundle exec gem release
+```
+
+For more options please see [gem-release REAMDE](https://github.com/svenfuchs/gem-release)
+
## Contributing
If you'd like to contribute, please take a look at the
diff --git a/cmd/lib/spree_cmd/templates/extension/lib/%file_name%/version.rb.tt b/cmd/lib/spree_cmd/templates/extension/lib/%file_name%/version.rb.tt
index 56f54c1891..97402484ef 100644
--- a/cmd/lib/spree_cmd/templates/extension/lib/%file_name%/version.rb.tt
+++ b/cmd/lib/spree_cmd/templates/extension/lib/%file_name%/version.rb.tt
@@ -1,18 +1,11 @@
module <%= class_name %>
+ VERSION = '0.0.1'.freeze
+
module_function
# Returns the version of the currently loaded <%= class_name %> as a
# <tt>Gem::Version</tt>.
def version
- Gem::Version.new VERSION::STRING
- end
-
- module VERSION
- MAJOR = 0
- MINOR = 0
- TINY = 1
- PRE = 'alpha'.freeze
-
- STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
+ Gem::Version.new VERSION
end
end