erp_integration 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: b73b17b72afec2d03e59213c35db31b1260f304907a9686af94a6bc0123b19c2
4
+ data.tar.gz: e2f42a3b2c313c6aa91efdcd5663b3c070a04221416799f0b4ee8753fc29df43
5
+ SHA512:
6
+ metadata.gz: e951c654c3293e5e169b212c5b0dc5ecc1b742750155520edb68302b2452e7f5637caa2e36ec75e37363e76626efe667186bd45e58e38cfe0c08c92709cd9f9a
7
+ data.tar.gz: ff1d1e69793589517db55c30ad56be8e7a484d77ef5cba846d00805aad46e3123d90343b38854a6b2323eb7607835fe9ab4a6d491d769d6d78a66b2657e1c4c0
data/.flayignore ADDED
@@ -0,0 +1,10 @@
1
+ spec/**/*.rb
2
+ bin/*
3
+
4
+ # The `.vendor` and `.bundle` folder is used by Github Actions to install
5
+ # the ruby gems for this gem.
6
+ .bundle/
7
+ .vendor/
8
+
9
+ # The GitHub workflows don't have to be inspected by Flay.
10
+ .github
@@ -0,0 +1,7 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: bundler
4
+ directory: "/"
5
+ schedule:
6
+ interval: daily
7
+ open-pull-requests-limit: 10
@@ -0,0 +1,7 @@
1
+ ### What problem is the code solving?
2
+
3
+ ### How does this change address the problem?
4
+
5
+ ### Why is this the best solution?
6
+
7
+ ### Share the knowledge
@@ -0,0 +1,27 @@
1
+ name: Code Quality
2
+
3
+ on: [push]
4
+
5
+ jobs:
6
+ linters:
7
+ runs-on: ubuntu-latest
8
+
9
+ steps:
10
+ - uses: actions/checkout@v2
11
+
12
+ - name: Set up Ruby
13
+ uses: ruby/setup-ruby@v1
14
+ with:
15
+ bundler-cache: true
16
+
17
+ - name: Install all dependencies
18
+ run: bundle install
19
+
20
+ - name: Check code styles with Rubocop
21
+ run: bin/rubocop
22
+
23
+ - name: Look for code smells with Reek
24
+ run: bin/reek
25
+
26
+ - name: Analyze code for structural similarities with Flay
27
+ run: bin/flay
@@ -0,0 +1,26 @@
1
+ name: Verify
2
+
3
+ on: [push]
4
+
5
+ jobs:
6
+ verify:
7
+ runs-on: ubuntu-latest
8
+
9
+ strategy:
10
+ matrix:
11
+ ruby-version: ['3.0', '2.7', '2.6', '2.5', '2.4', '2.3']
12
+
13
+ steps:
14
+ - uses: actions/checkout@v2
15
+
16
+ - name: Set up Ruby ${{ matrix.ruby-version }}
17
+ uses: ruby/setup-ruby@v1
18
+ with:
19
+ bundler-cache: true
20
+ ruby-version: ${{ matrix.ruby-version }}
21
+
22
+ - name: Install all dependencies
23
+ run: bundle install
24
+
25
+ - name: Run the tests
26
+ run: bin/rspec
@@ -0,0 +1,18 @@
1
+ name: PR Validations
2
+
3
+ on:
4
+ pull_request:
5
+ types:
6
+ - opened
7
+ - edited
8
+ - reopened
9
+ - synchronize
10
+
11
+ jobs:
12
+ pr-lint:
13
+ runs-on: ubuntu-latest
14
+
15
+ steps:
16
+ - uses: seferov/pr-lint-action@master
17
+ with:
18
+ title-regex: '^\[RELEASE|NO-TICKET|DL|AD|DU|AR|IN|MT-\d*\](\ )'
data/.gitignore ADDED
@@ -0,0 +1,15 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ # "Do not check your Gemfile.lock into version control, since it enforces precision
11
+ # that does not exist in the gem command, which is used to install gems in practice."
12
+ # - https://yehudakatz.com/2010/12/16/clarifying-the-roles-of-the-gemspec-and-gemfile/
13
+ Gemfile.lock
14
+ .byebug_history
15
+ *.gem
data/.reek.yml ADDED
@@ -0,0 +1,136 @@
1
+ ---
2
+ detectors:
3
+ Attribute:
4
+ enabled: false
5
+ exclude: []
6
+ BooleanParameter:
7
+ enabled: false
8
+ exclude: []
9
+ ClassVariable:
10
+ enabled: true
11
+ exclude: []
12
+ ControlParameter:
13
+ enabled: false
14
+ exclude: []
15
+ DataClump:
16
+ enabled: true
17
+ exclude: []
18
+ max_copies: 3
19
+ min_clump_size: 4
20
+ DuplicateMethodCall:
21
+ enabled: true
22
+ allow_calls:
23
+ - 'self.class'
24
+ - 'self.class.name'
25
+ exclude: []
26
+ max_calls: 1
27
+ FeatureEnvy:
28
+ enabled: false
29
+ exclude: []
30
+ InstanceVariableAssumption:
31
+ enabled: false
32
+ IrresponsibleModule:
33
+ enabled: false
34
+ exclude: []
35
+ LongParameterList:
36
+ enabled: true
37
+ exclude: []
38
+ max_params: 5
39
+ overrides:
40
+ initialize:
41
+ max_params: 5
42
+ LongYieldList:
43
+ enabled: true
44
+ exclude: []
45
+ max_params: 3
46
+ ManualDispatch:
47
+ enabled: true
48
+ exclude:
49
+ # Acceptable code smell as we don't know the full extend of our configuration
50
+ # interface for the gem yet.
51
+ - ErpIntegration::Configuration
52
+ - ErpIntegration::Resource#initialize
53
+ MissingSafeMethod:
54
+ enabled: true
55
+ exclude: []
56
+ ModuleInitialize:
57
+ enabled: true
58
+ exclude: []
59
+ NestedIterators:
60
+ enabled: true
61
+ exclude: []
62
+ NilCheck:
63
+ enabled: false
64
+ exclude: []
65
+ RepeatedConditional:
66
+ enabled: true
67
+ exclude: []
68
+ max_ifs: 2
69
+ SubclassedFromCoreClass:
70
+ enabled: true
71
+ exclude: []
72
+ TooManyConstants:
73
+ enabled: true
74
+ exclude: []
75
+ max_constants: 5
76
+ TooManyInstanceVariables:
77
+ enabled: true
78
+ exclude: []
79
+ max_instance_variables: 4
80
+ TooManyMethods:
81
+ enabled: true
82
+ exclude: []
83
+ max_methods: 15
84
+ TooManyStatements:
85
+ enabled: true
86
+ exclude:
87
+ - initialize
88
+ max_statements: 25
89
+ UncommunicativeMethodName:
90
+ enabled: true
91
+ exclude: []
92
+ reject:
93
+ - "/[0-9]$/"
94
+ - "/[A-Z]/"
95
+ accept: []
96
+ UncommunicativeModuleName:
97
+ enabled: true
98
+ exclude: []
99
+ reject:
100
+ - "/^.$/"
101
+ - "/[0-9]$/"
102
+ accept: ["V1", "V2"]
103
+ UncommunicativeParameterName:
104
+ enabled: true
105
+ exclude: []
106
+ reject:
107
+ - "/^.$/"
108
+ - "/[0-9]$/"
109
+ - "/[A-Z]/"
110
+ - "/^_/"
111
+ accept: []
112
+ UncommunicativeVariableName:
113
+ enabled: true
114
+ exclude: ["e"]
115
+ reject:
116
+ - "/^.$/"
117
+ - "/[0-9]$/"
118
+ - "/[A-Z]/"
119
+ accept:
120
+ - "/^_$/"
121
+ UnusedParameters:
122
+ enabled: true
123
+ exclude: []
124
+ UnusedPrivateMethod:
125
+ enabled: false
126
+ exclude: []
127
+ UtilityFunction:
128
+ enabled: false
129
+
130
+ # Directories and files below will not be scanned at all
131
+ exclude_paths:
132
+ - spec
133
+ - bin
134
+ - .bundle
135
+ - .vendor
136
+ - .github
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,88 @@
1
+ AllCops:
2
+ TargetRubyVersion: 2.3
3
+
4
+ Layout/HashAlignment:
5
+ EnforcedColonStyle: key
6
+ EnforcedHashRocketStyle: key
7
+
8
+ Layout/LineLength:
9
+ Max: 120
10
+
11
+ Metrics/BlockLength:
12
+ Exclude:
13
+ - Rakefile
14
+ - erp_integration.gemspec
15
+ # Reasons to disable for the specs:
16
+ # 1. Specs tend to include big blocks (e.g. `RSpec.describe` or `it`).
17
+ # 2. `mejuri-web` also has disabled the `Metrics/BlockLength` for specs.
18
+ - spec/**/*
19
+ ExcludedMethods: ['class_eval']
20
+
21
+ Lint/AmbiguousBlockAssociation:
22
+ Enabled: true
23
+
24
+ Lint/RaiseException:
25
+ Enabled: true
26
+
27
+ Lint/StructNewOverride:
28
+ Enabled: true
29
+
30
+ Style/Documentation:
31
+ Enabled: false
32
+
33
+ Style/HashEachMethods:
34
+ Enabled: true
35
+
36
+ Style/ModuleFunction:
37
+ Enabled: false
38
+
39
+ Style/NumericPredicate:
40
+ Enabled: true
41
+ EnforcedStyle: comparison
42
+
43
+ Style/RedundantSelf:
44
+ Enabled: true
45
+
46
+ Style/HashTransformKeys:
47
+ Enabled: true
48
+
49
+ Style/HashTransformValues:
50
+ Enabled: true
51
+
52
+ Layout/CaseIndentation:
53
+ Enabled: true
54
+ EnforcedStyle: case
55
+ IndentOneStep: true
56
+
57
+ Style/GuardClause:
58
+ Enabled: true
59
+
60
+ # https://github.com/rubocop-hq/ruby-style-guide/issues/522
61
+ Style/BlockDelimiters:
62
+ EnforcedStyle: braces_for_chaining
63
+
64
+ Metrics/MethodLength:
65
+ Max: 15
66
+ Enabled: true
67
+
68
+ Metrics/AbcSize:
69
+ Max: 20
70
+ Enabled: true
71
+
72
+ Style/FrozenStringLiteralComment:
73
+ Enabled: true
74
+
75
+ Metrics/CyclomaticComplexity:
76
+ Enabled: true
77
+
78
+ Metrics/PerceivedComplexity:
79
+ Enabled: true
80
+
81
+ Naming/PredicateName:
82
+ Enabled: true
83
+
84
+ Metrics/ClassLength:
85
+ Enabled: true
86
+
87
+ Style/AndOr:
88
+ EnforcedStyle: conditionals
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 3.0.2
data/CHANGELOG.md ADDED
@@ -0,0 +1,20 @@
1
+ # Changelog
2
+
3
+ ## [v.0.1.0](https://github.com/mejuri-inc/erp-integration/tree/v.0.1.0) (2021-07-28)
4
+
5
+ [Full Changelog](https://github.com/mejuri-inc/erp-integration/compare/a411f1240265c1e67ed4f07275cb357ffbbdb681...v.0.1.0)
6
+
7
+ **Merged pull requests:**
8
+
9
+ - \[NO-TICKET\] Added pull-request-template [\#11](https://github.com/mejuri-inc/erp-integration/pull/11) ([germansvriz](https://github.com/germansvriz))
10
+ - \[NO-TICKET\] Updates ruby to v3.0.2 [\#9](https://github.com/mejuri-inc/erp-integration/pull/9) ([stefanvermaas](https://github.com/stefanvermaas))
11
+ - \[DU-81\] Create ERPIntegrationOrder [\#8](https://github.com/mejuri-inc/erp-integration/pull/8) ([germansvriz](https://github.com/germansvriz))
12
+ - \[NO-TICKET\] Configure Reek and Flay [\#7](https://github.com/mejuri-inc/erp-integration/pull/7) ([stefanvermaas](https://github.com/stefanvermaas))
13
+ - \[DU-80\] Add a HTTP client for communication to Fulfil [\#6](https://github.com/mejuri-inc/erp-integration/pull/6) ([stefanvermaas](https://github.com/stefanvermaas))
14
+ - \[DU-79\] Replace generic welcome for actionable todos. [\#3](https://github.com/mejuri-inc/erp-integration/pull/3) ([stefanvermaas](https://github.com/stefanvermaas))
15
+ - \[DU-79\] Adds Github's Dependabot [\#2](https://github.com/mejuri-inc/erp-integration/pull/2) ([stefanvermaas](https://github.com/stefanvermaas))
16
+ - \[DU-79\] Add GitHub actions [\#1](https://github.com/mejuri-inc/erp-integration/pull/1) ([stefanvermaas](https://github.com/stefanvermaas))
17
+
18
+
19
+
20
+ \* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*
@@ -0,0 +1,84 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
+
7
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
+
9
+ ## Our Standards
10
+
11
+ Examples of behavior that contributes to a positive environment for our community include:
12
+
13
+ * Demonstrating empathy and kindness toward other people
14
+ * Being respectful of differing opinions, viewpoints, and experiences
15
+ * Giving and gracefully accepting constructive feedback
16
+ * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
+ * Focusing on what is best not just for us as individuals, but for the overall community
18
+
19
+ Examples of unacceptable behavior include:
20
+
21
+ * The use of sexualized language or imagery, and sexual attention or
22
+ advances of any kind
23
+ * Trolling, insulting or derogatory comments, and personal or political attacks
24
+ * Public or private harassment
25
+ * Publishing others' private information, such as a physical or email
26
+ address, without their explicit permission
27
+ * Other conduct which could reasonably be considered inappropriate in a
28
+ professional setting
29
+
30
+ ## Enforcement Responsibilities
31
+
32
+ Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
33
+
34
+ Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
35
+
36
+ ## Scope
37
+
38
+ This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
39
+
40
+ ## Enforcement
41
+
42
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at stefanvermaas@me.com. All complaints will be reviewed and investigated promptly and fairly.
43
+
44
+ All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
+
46
+ ## Enforcement Guidelines
47
+
48
+ Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
49
+
50
+ ### 1. Correction
51
+
52
+ **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
53
+
54
+ **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
55
+
56
+ ### 2. Warning
57
+
58
+ **Community Impact**: A violation through a single incident or series of actions.
59
+
60
+ **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
61
+
62
+ ### 3. Temporary Ban
63
+
64
+ **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
65
+
66
+ **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
67
+
68
+ ### 4. Permanent Ban
69
+
70
+ **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71
+
72
+ **Consequence**: A permanent ban from any sort of public interaction within the community.
73
+
74
+ ## Attribution
75
+
76
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77
+ available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
78
+
79
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80
+
81
+ [homepage]: https://www.contributor-covenant.org
82
+
83
+ For answers to common questions about this code of conduct, see the FAQ at
84
+ https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
data/Gemfile ADDED
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2021 Stefan Vermaas
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,81 @@
1
+ # Mejuri's ERP integration
2
+
3
+ TODO: Add a accurate description for the gem.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'erp_integration'
11
+ ```
12
+
13
+ Or run the following command to add `ErpIntegration` to your Gemfile:
14
+
15
+ ```shell
16
+ $ bundle add erp_integration
17
+ ```
18
+
19
+ TODO: Write installation instructions here for the Github package registry.
20
+
21
+ ## Usage
22
+
23
+ ### Configuration
24
+
25
+ To configure the gem, create an initializer and add the following lines:
26
+
27
+ ```erb
28
+ # config/initializers/erp_integration.rb
29
+ ErpIntegration.configure do |config|
30
+ config.fulfil_api_key = '<your-api-key>'
31
+ config.fulfil_merchant_id = '<your-merchant-id>'
32
+ end
33
+ ```
34
+
35
+ ## Development
36
+
37
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
38
+
39
+ TODO: Write instructions for publishing the gem to the Github package registry.
40
+
41
+ ## Contributing
42
+
43
+ Bug reports and pull requests are welcome on GitHub at https://github.com/mejuri-inc/erp_integration. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/mejuri-inc/erp_integration/blob/main/CODE_OF_CONDUCT.md).
44
+
45
+ ## License
46
+
47
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
48
+
49
+ ## Code of Conduct
50
+
51
+ Everyone interacting in the ErpIntegration project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/mejuri-inc/erp_integration/blob/main/CODE_OF_CONDUCT.md).
52
+
53
+ ## Releasing
54
+
55
+ ### Prerequisites
56
+
57
+ To be able to publish a new release, you'll need to set up a Rubygems account.
58
+
59
+ > To begin, you’ll need to create an account on RubyGems.org. Visit the sign up page and supply an email address that you control, a handle (username) and a password.
60
+ >
61
+ > After creating the account, use your email and password when pushing the gem. (RubyGems saves the credentials in ~/.gem/credentials for you so you only need to log in once.)
62
+ > - [Publishing to RubyGems.org](https://guides.rubygems.org/publishing/)
63
+
64
+ It's important to note that you'll need the right privileges to publish the gem. Ask @germansvriz to add you as a gem owner.
65
+
66
+ ### Publish a new version
67
+
68
+ 1 - Run the prerelease script
69
+ ```shell
70
+ $ bin/prerelease 0.0.1
71
+ ```
72
+ 2 - Create Pull Request
73
+ 3 - Merge it to main
74
+ 4 - Run Release script
75
+ ```shell
76
+ $ bin/release 0.0.1
77
+ ```
78
+
79
+ We're following [semver](https://semver.org/) for the release process of this gem. Make sure to apply the correct semver version for a new release.
80
+
81
+ > **NOTE**: You don't have to add a `v` to the version you want to release. The release script will handle that for you.
data/Rakefile ADDED
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'bundler/gem_tasks'
4
+ require 'flay_task'
5
+ require 'reek/rake/task'
6
+ require 'rspec/core/rake_task'
7
+ require 'rubocop/rake_task'
8
+
9
+ FlayTask.new
10
+ Reek::Rake::Task.new
11
+ RSpec::Core::RakeTask.new(:spec)
12
+ RuboCop::RakeTask.new
13
+
14
+ task default: %i[spec rubocop flay reek]
data/bin/console ADDED
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require 'bundler/setup'
5
+ require 'erp_integration'
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__)
data/bin/flay ADDED
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ #
5
+ # This file was generated by Bundler.
6
+ #
7
+ # The application 'flay' is installed as part of a gem, and
8
+ # this file is here to facilitate running it.
9
+ #
10
+
11
+ require 'pathname'
12
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile',
13
+ Pathname.new(__FILE__).realpath)
14
+
15
+ bundle_binstub = File.expand_path('bundle', __dir__)
16
+
17
+ if File.file?(bundle_binstub)
18
+ if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
19
+ load(bundle_binstub)
20
+ else
21
+ abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
22
+ Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
23
+ end
24
+ end
25
+
26
+ require 'rubygems'
27
+ require 'bundler/setup'
28
+
29
+ load Gem.bin_path('flay', 'flay')
data/bin/prerelease ADDED
@@ -0,0 +1,20 @@
1
+ #!/usr/bin/env bash
2
+
3
+ VERSION=$1
4
+
5
+ # Use the latest dependencies for the new gem version.
6
+ bundle
7
+
8
+ # Run all the rake task to ensure we're publishing a publishable gem.
9
+ rake
10
+
11
+ # Update the gem version.
12
+ printf "module ErpIntegration\n VERSION = \"$VERSION\".freeze\nend\n" > ./lib/erp_integration/version.rb
13
+ git add lib/erp_integration/version.rb
14
+ git checkout -b "release_v.$VERSION"
15
+ git commit -m "[RELEASE] Bump version for v$VERSION"
16
+ git push origin "release_v.$VERSION"
17
+
18
+ # Tag the new gem version.
19
+ git tag v$VERSION
20
+ git push --tags