octopoller 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 395def9659b719a7458b7f498e35f02e52e4e898e4c2ab966f277c3f864bc0d5
4
- data.tar.gz: 6b3f90aeed014843ae63e763d9cc902779343638027a13a1bd7a2a612a3decca
3
+ metadata.gz: f208e25fceb01c8bfaa93d95fa6c9f7ea7fa3f364c1edc0e6560e21e60eab713
4
+ data.tar.gz: 55bb40825baf87505dcd14385c526bedb7cc60f0fcd105b9288daec4e1711042
5
5
  SHA512:
6
- metadata.gz: 5f65c542e58c21cb83c61baab6ba1d4d0b0ad580a3d8654e90974d6db56af4924f869fd7b6a8137938f58602671dab3628f16d9f421d861e1ca189ba4ca89c6e
7
- data.tar.gz: 0fc00e03a3f190db1bf98e80c2a7ff55978d83068614a8330774048d0a755e794ae1ab421fa5f2ab11f441256dadaff4f6d0f389ea89199e98f0da01bde45adf
6
+ metadata.gz: 0fbddcca87baec1bf16d14c34e0b92bfbace2050bad8d67d479ad41af76563bf7716f3b45e3cba31d8989a3517bdddcfcbdf39e7cb455c3d6ce8c35a3b973632
7
+ data.tar.gz: e926410535fa00cbc7f8d6247536f8faaba79fb2477e411a45028b0705d1ec982d09c264c4bab510aca63b51c9306864dc167e73a19d40d7ea4cf5ed4566f7c5
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- octopoller (0.2.0)
4
+ octopoller (0.3.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/RELEASE.md CHANGED
@@ -2,14 +2,17 @@
2
2
 
3
3
  1. Create a list of all the changes since the prior release
4
4
  1. Compare the previous release to `master` using `https://github.com/octokit/octopoller.rb/compare/`v1.3.3.7...master` (assuming that the last release was `v1.3.3.7`)
5
- 1. Ensure there are no breaking changes _(if there are breaking changes you'll need to create a release branch without those changes or bump the major version)_
6
- 1. Update the version
5
+ 2. Ensure there are no breaking changes _(if there are breaking changes you'll need to create a release branch without those changes or bump the major version)_
6
+ 3. Update the version
7
7
  1. Checkout `master`
8
- 1. Update the constant in `lib/octopoller/version.rb` (when `bundle` is executed the version in the `Gemfile.lock` will be updated)
9
- 1. Run `bin/setup` so that `Gemfile.lock` will be updated with the new version
10
- 1. Commit and push directly to `master`
11
- 1. Run the `script/release` script to cut a release
12
- 1. Draft a new release at <https://github.com/octokit/octopoller.rb/releases/new> containing the changelog from step 1
8
+ 2. Update the constant in `lib/octopoller/version.rb` (when `bundle` is executed the version in the `Gemfile.lock` will be updated)
9
+ 3. Run `bin/setup` so that `Gemfile.lock` will be updated with the new version
10
+ 4. Commit and push directly to `master`
11
+ 5. (Optional) Run `script/release` with no parameters to execute a dry run of a release
12
+ 6. Run the `script/release -r` script to cut a release (this will also run `script/validate` to perform the permission check)
13
+ 7. Draft a new release at <https://github.com/octokit/octopoller.rb/releases/new> containing the changelog from step 1
14
+
15
+ ----
13
16
 
14
17
  ## Prerequisites
15
18
 
@@ -1,3 +1,3 @@
1
1
  module Octopoller
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  end
data/script/package CHANGED
@@ -4,4 +4,15 @@
4
4
 
5
5
  mkdir -p pkg
6
6
  gem build *.gemspec
7
- mv *.gem pkg
7
+
8
+ ./script/validate || rm *.gem
9
+
10
+ echo "*** Packing and moving the octopoller gem ***"
11
+ if [ -f *.gem ]; then
12
+ mv *.gem pkg
13
+ echo -e '☑ success'
14
+ else
15
+ echo -e '☒ failure'
16
+ exit 1
17
+ fi
18
+
data/script/release CHANGED
@@ -5,12 +5,49 @@
5
5
 
6
6
  set -e
7
7
 
8
- version="$(script/package | grep Version: | awk '{print $2}')"
9
- [ -n "$version" ] || exit 1
10
-
11
- echo $version
12
- git commit --allow-empty -a -m "Release $version"
13
- git tag "v$version"
14
- git push origin
15
- git push origin "v$version"
16
- gem push pkg/*-${version}.gem
8
+ usage() {
9
+ echo "Usage: $0 [-r] Tags and releases/publishes Octopoller" 1>&2; exit 1;
10
+ }
11
+
12
+ while [ $# -gt 0 ]
13
+ do
14
+ case $1 in
15
+ '-r')
16
+ r=true
17
+ ;;
18
+ '-h')
19
+ usage
20
+ ;;
21
+ *)
22
+ echo "No valid parameter passed in, performing a dry run...";
23
+ ;;
24
+ esac
25
+ shift
26
+ done
27
+
28
+ if [ -z "${r}" ]; then
29
+ ./script/package
30
+ echo "*** Dry run: octopoller was not tagged or released ***"
31
+ echo -e '☑ success'
32
+ else
33
+
34
+ # We execite the script separately to get logging and proper exit conditions
35
+ ./script/package
36
+
37
+ # We need to pull the version from the actual file that is about to be published
38
+ file=$(ls pkg/*.gem| head -1)
39
+ version=$(echo $file | sed -e 's/.*octopoller-\(.*\).gem.*/\1/')
40
+
41
+ [ -n "$version" ] || exit 1
42
+
43
+ echo "*** Tagging and publishing $version of octopoller ***"
44
+
45
+ git commit --allow-empty -a -m "Release $version"
46
+ git tag "v$version"
47
+ git push origin
48
+ git push origin "v$version"
49
+ gem push pkg/*-${version}.gem
50
+ echo -e '☑ success'
51
+ fi
52
+
53
+
data/script/validate ADDED
@@ -0,0 +1,44 @@
1
+ #!/usr/bin/env bash
2
+ # Usage: script/gem
3
+ # Validates the packed gem to determine if file permissions are correct.
4
+
5
+ <<'###SCRIPT_COMMENT'
6
+ Purpose:
7
+ (Given octopoller.rb is currently shipped "manually")
8
+
9
+ Because different environments behave differently, it is recommended that the integrity and file permissions of the files packed in the gem are verified.
10
+ This is to help prevent things like releasing world writeable files in the gem. The simple check below looks at each file contained in the packed gem and
11
+ verifies that the files are only owner writeable.
12
+
13
+ Requirements:
14
+ This script expects that script/package, script/release or 'gem build *.gemspec' have been run
15
+
16
+ ###SCRIPT_COMMENT
17
+
18
+
19
+ FILE=$(ls *.gem| head -1)
20
+
21
+ echo "*** Validating file permissions in the octopoller gem ***"
22
+
23
+ if [ ! -f "$FILE" ]; then
24
+ echo "$FILE does not exist. Please run script/package, script/release or 'gem build *.gemspec' to generate the gem to be validated"
25
+ echo -e '☒ failure'
26
+ exit 1
27
+ fi
28
+
29
+ tar -xf "${FILE}"
30
+
31
+ # naive check to quickly see if any files in the gem are set to the wrong permissions
32
+ for f in $(tar --numeric-owner -tvf data.tar.gz )
33
+ do
34
+ if [ $f == "-rw-rw-rw-" ]; then
35
+ echo "World writeable files (-rw-rw-rw- | 666) detected in the gem. Please repack and make sure that all files in the gem are owner read write ( -rw-r--r-- | 644 )"
36
+ echo -e '☒ failure'
37
+ rm -f checksums.yaml.gz data.tar.gz metadata.gz
38
+ exit 1
39
+ fi
40
+ done
41
+
42
+ # Check clean up
43
+ echo -e '☑ success'
44
+ rm -f checksums.yaml.gz data.tar.gz metadata.gz
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: octopoller
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - BenEmdon
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-06-01 00:00:00.000000000 Z
11
+ date: 2022-06-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -81,11 +81,12 @@ files:
81
81
  - octopoller.gemspec
82
82
  - script/package
83
83
  - script/release
84
+ - script/validate
84
85
  homepage: https://github.com/octokit/octopoller.rb
85
86
  licenses:
86
87
  - MIT
87
88
  metadata: {}
88
- post_install_message:
89
+ post_install_message:
89
90
  rdoc_options: []
90
91
  require_paths:
91
92
  - lib
@@ -100,8 +101,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
100
101
  - !ruby/object:Gem::Version
101
102
  version: '0'
102
103
  requirements: []
103
- rubygems_version: 3.2.9
104
- signing_key:
104
+ rubygems_version: 3.1.2
105
+ signing_key:
105
106
  specification_version: 4
106
107
  summary: A Ruby gem for polling and retrying actions
107
108
  test_files: []