bens-hello-world 0.3.8 → 4.10.2

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: '078f1a968e22bfb68175483cd0afed6585a39af03406e986235a696d4ac43b5e'
4
- data.tar.gz: b35a725ae9044c0632b5af9855ca51b2d87e82e6390e955bc67bcc659db28de8
3
+ metadata.gz: 77463a548a5ed111182a38263777fd453a27e4d54bee020cd12d4b39c7b7c2c9
4
+ data.tar.gz: 7e6746a72924383abc7609cdb5300200a476094731533affd57703a27d0edbfd
5
5
  SHA512:
6
- metadata.gz: fea128adfde7281df1f80f3da9dae34eb979506e73516386ea566275ae20a8c69258b178d614de513c78a4b0c98feb99c9a2e5cf401332fb4e79ec7152131600
7
- data.tar.gz: 709b62c197f60c09471e451b2b0150a87ef10d0fccc7c7592109f28e0581317a609f06b130084120533e11f192205bae9d5888c7b07f75f8e6317b8180b7490a
6
+ metadata.gz: de2e45f7f0d7f42a1ed1cc416ffa8c554daeb9955cdc7eb986f0217ee2649b8ac3a1bc31059949e191c430b836a7155bca1a04d472ece2e7848c03afbf2ddc59
7
+ data.tar.gz: 2b7e596be68233359b1baa06888e2a5a093af6c4dd9cc81f9f3dd6d949e1c2da8cbe29b054f07dc049376ac986c732648338708a5aad4e4be16bbcf625652820
@@ -1,23 +1,21 @@
1
1
 
2
- name: manual-release
2
+ name: publish-gem-and-tag
3
3
 
4
4
  on:
5
5
  workflow_dispatch:
6
6
 
7
7
  jobs:
8
- manual-release:
8
+ publish-gem-and-tag:
9
9
  runs-on: ubuntu-latest
10
10
 
11
11
  steps:
12
12
 
13
- - uses: actions/checkout@v2
14
- # checks out the default branch (which is master)
13
+ - uses: actions/checkout@v2 # checks out default branch
15
14
 
16
15
  - uses: ruby/setup-ruby@v1
17
16
  with:
18
17
  ruby-version: 3.0.0
19
- - run: bundle install
20
-
18
+ - run: bundle install
21
19
 
22
20
  - name: publish gem
23
21
  run: |
@@ -27,33 +25,42 @@ jobs:
27
25
  printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
28
26
  gem build *.gemspec
29
27
  gem push *.gem
30
- env:
31
- # Make sure to update the secret name
32
- # if yours isn't named RUBYGEMS_AUTH_TOKEN
28
+ env:
33
29
  GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_AUTH_TOKEN}}"
34
30
 
35
- # now, after the gem has been successfully published
36
- # we would need to automatically tag based on the current commit
37
- # ideally we would read the version in the gem file and commit that.
31
+ # now, after the gem has been successfully published
32
+ # we would need to automatically tag based on the current commit
38
33
 
39
- ## We wanna use this one for pagy
40
- # echo "::set-output name=version::$(sed -nr "s/.*VERSION\s*=\s*('|\")([^'\"]+).*$/\2/p" $(echo "$GITHUB_WORKSPACE/lib/pagy.rb"))"
34
+ # # We wanna use this one for pagy
35
+ # echo "::set-output name=version::$(sed -nr "s/.*VERSION\s*=\s*('|\")([^'\"]+).*$/\2/p" $(echo "$GITHUB_WORKSPACE/lib/pagy.rb"))"
41
36
 
42
37
  # - name: Get version number
43
38
  # id: version
44
39
  # run: |
45
40
  # echo "::set-output name=version::$(sed -nr "s/.*VERSION\s*=\s*('|\")([^'\"]+).*$/\2/p" $(echo "$GITHUB_WORKSPACE/lib/bens/hello/world/version.rb"))"
46
-
41
+ # - name: Create tag
42
+ # uses: actions/github-script@v3
43
+ # with:
44
+ # github-token: ${{ github.token }}
45
+ # script: |
46
+ # github.git.createRef({
47
+ # owner: context.repo.owner,
48
+ # repo: context.repo.repo,
49
+ # ref: `refs/tags/${{steps.version.outputs.version}}`,
50
+ # sha: context.sha
51
+ # })
52
+
47
53
  - name: Create tag
48
54
  uses: actions/github-script@v3
49
55
  with:
50
56
  github-token: ${{ github.token }}
51
57
  script: |
58
+ const fs = require("fs")
59
+ eval(fs.readFileSync("./lib/javascripts/pagy.js").toString())
60
+
52
61
  github.git.createRef({
53
62
  owner: context.repo.owner,
54
63
  repo: context.repo.repo,
55
- ref: "refs/tags/".concat(${{env.VERSION}}),
64
+ ref: `refs/tags/${Pagy.version}`,
56
65
  sha: context.sha
57
66
  })
58
- env:
59
- VERSION: echo $(sed -nr "s/.*VERSION\s*=\s*('|\")([^'\"]+).*$/\2/p" $(echo "$GITHUB_WORKSPACE/lib/bens/hello/world/version.rb"))
@@ -1,52 +1,52 @@
1
- name: release
1
+ # name: release
2
2
 
3
- on:
4
- push:
5
- branches:
6
- - master
3
+ # on:
4
+ # push:
5
+ # branches:
6
+ # - master
7
7
 
8
- jobs:
9
- release-please:
10
- runs-on: ubuntu-latest
11
- steps:
12
- - uses: GoogleCloudPlatform/release-please-action@v2
13
- id: release
14
- with:
15
- # The release type
16
- release-type: ruby
17
- # A name for the artifact releases are being created for
18
- # which is the name of our gem
19
- package-name: bens-hello-world
20
- # Should breaking changes before 1.0.0 produce minor bumps?
21
- bump-minor-pre-major: true
22
- # Path to our version file to increment
23
- version-file: "lib/bens/hello/world/version.rb"
8
+ # jobs:
9
+ # release-please:
10
+ # runs-on: ubuntu-latest
11
+ # steps:
12
+ # - uses: GoogleCloudPlatform/release-please-action@v2
13
+ # id: release
14
+ # with:
15
+ # # The release type
16
+ # release-type: ruby
17
+ # # A name for the artifact releases are being created for
18
+ # # which is the name of our gem
19
+ # package-name: bens-hello-world
20
+ # # Should breaking changes before 1.0.0 produce minor bumps?
21
+ # bump-minor-pre-major: true
22
+ # # Path to our version file to increment
23
+ # version-file: "lib/bens/hello/world/version.rb"
24
24
 
25
- # Checkout code if release was created
26
- - uses: actions/checkout@v2
27
- if: ${{ steps.release.outputs.release_created }}
28
- # Setup ruby if a release was created
29
- - uses: ruby/setup-ruby@v1
30
- with:
31
- ruby-version: 3.0.0
32
- if: ${{ steps.release.outputs.release_created }}
33
- # Bundle install
34
- - run: bundle install
35
- if: ${{ steps.release.outputs.release_created }}
25
+ # # Checkout code if release was created
26
+ # - uses: actions/checkout@v2
27
+ # if: ${{ steps.release.outputs.release_created }}
28
+ # # Setup ruby if a release was created
29
+ # - uses: ruby/setup-ruby@v1
30
+ # with:
31
+ # ruby-version: 3.0.0
32
+ # if: ${{ steps.release.outputs.release_created }}
33
+ # # Bundle install
34
+ # - run: bundle install
35
+ # if: ${{ steps.release.outputs.release_created }}
36
36
 
37
- # ## One can choose the publish the gem when the release is created too
38
- # - name: publish gem
39
- # run: |
40
- # mkdir -p $HOME/.gem
41
- # touch $HOME/.gem/credentials
42
- # chmod 0600 $HOME/.gem/credentials
43
- # printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
44
- # gem build *.gemspec
45
- # gem push *.gem
46
- # env:
47
- # # Make sure to update the secret name
48
- # # if yours isn't named RUBYGEMS_AUTH_TOKEN
49
- # GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_AUTH_TOKEN}}"
50
- # if: ${{ steps.release.outputs.release_created }}
37
+ # # ## One can choose the publish the gem when the release is created too
38
+ # # - name: publish gem
39
+ # # run: |
40
+ # # mkdir -p $HOME/.gem
41
+ # # touch $HOME/.gem/credentials
42
+ # # chmod 0600 $HOME/.gem/credentials
43
+ # # printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
44
+ # # gem build *.gemspec
45
+ # # gem push *.gem
46
+ # # env:
47
+ # # # Make sure to update the secret name
48
+ # # # if yours isn't named RUBYGEMS_AUTH_TOKEN
49
+ # # GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_AUTH_TOKEN}}"
50
+ # # if: ${{ steps.release.outputs.release_created }}
51
51
 
52
-
52
+ #
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bens-hello-world (0.3.8)
4
+ bens-hello-world (4.10.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,7 +1,7 @@
1
1
  module Bens
2
2
  module Hello
3
3
  module World
4
- VERSION = "0.3.8"
4
+ VERSION = "4.10.2"
5
5
  end
6
6
  end
7
7
  end
@@ -0,0 +1,122 @@
1
+ // See the Pagy documentation: https://ddnexus.github.io/pagy/extras#javascript
2
+
3
+ function Pagy(){}
4
+
5
+ Pagy.version = '4.10.2'
6
+
7
+ Pagy.delay = 100
8
+
9
+ Pagy.init =
10
+ function(arg) {
11
+ var target = arg instanceof Event || arg === undefined ? document : arg,
12
+ elements = target.querySelectorAll('[data-pagy-json]')
13
+ for (var i = 0, len = elements.length; i < len; i++) {
14
+ var args = JSON.parse(elements[i].getAttribute('data-pagy-json')),
15
+ fname = args.shift()
16
+ args.unshift(elements[i])
17
+ Pagy[fname].apply(null, args)
18
+ }
19
+ }
20
+
21
+ Pagy.nav =
22
+ function(pagyEl, tags, sequels, trimParam) {
23
+ var lastWidth,
24
+ pageREg = new RegExp(/__pagy_page__/g),
25
+ widths = []
26
+ for (var width in sequels) {
27
+ if (sequels.hasOwnProperty(width)) { widths.push(parseInt(width, 10)) }
28
+ }
29
+ widths.sort(function(a, b) { return b - a })
30
+
31
+ pagyEl.render =
32
+ function() {
33
+ var width, i, len
34
+ for (i = 0, len = widths.length; i < len; i++) {
35
+ if (this.parentElement.clientWidth > widths[i]) { width = widths[i]; break }
36
+ }
37
+ if (width !== lastWidth) {
38
+ var html = tags.before,
39
+ series = sequels[width]
40
+ for (i = 0, len = series.length; i < len; i++) {
41
+ var item = series[i]
42
+ if (typeof(trimParam) === 'string' && item === 1) { html += Pagy.trim(tags.link.replace(pageREg, item), trimParam) }
43
+ else if (typeof(item) === 'number') { html += tags.link.replace(pageREg, item) }
44
+ else if (item === 'gap') { html += tags.gap }
45
+ else if (typeof(item) === 'string') { html += tags.active.replace(pageREg, item) }
46
+ }
47
+ html += tags.after
48
+ this.innerHTML = ''
49
+ this.insertAdjacentHTML('afterbegin', html)
50
+ lastWidth = width
51
+ }
52
+ }.bind(pagyEl)
53
+ pagyEl.render()
54
+ }
55
+
56
+ Pagy.combo_nav =
57
+ function(pagyEl, page, link, trimParam) {
58
+ var input = pagyEl.getElementsByTagName('input')[0],
59
+ toPage =
60
+ function() {
61
+ if (page !== input.value) {
62
+ var html = link.replace(/__pagy_page__/, input.value)
63
+ if (typeof (trimParam) === 'string' && input.value === '1') { html = Pagy.trim(html, trimParam) }
64
+ pagyEl.insertAdjacentHTML('afterbegin', html)
65
+ pagyEl.getElementsByTagName('a')[0].click()
66
+ }
67
+ }
68
+ Pagy.addInputEventListeners(input, toPage)
69
+ }
70
+
71
+ Pagy.items_selector =
72
+ function(pagyEl, from, link, param) {
73
+ var input = pagyEl.getElementsByTagName('input')[0],
74
+ current = input.value,
75
+ toPage =
76
+ function() {
77
+ var items = input.value
78
+ if (current !== items) {
79
+ var page = Math.max(Math.ceil(from / items), 1),
80
+ html = link.replace(/__pagy_page__/, page).replace(/__pagy_items__/, items)
81
+ if (typeof (param) === 'string' && page === 1) { html = Pagy.trim(html, param) }
82
+ pagyEl.insertAdjacentHTML('afterbegin', html)
83
+ pagyEl.getElementsByTagName('a')[0].click()
84
+ }
85
+ }
86
+ Pagy.addInputEventListeners(input, toPage)
87
+ }
88
+
89
+ Pagy.addInputEventListeners =
90
+ function(input, toPage) {
91
+ // select the content on click: easier for typing a number
92
+ input.addEventListener('click', function() { this.select() })
93
+ // toPage when the input looses focus
94
+ input.addEventListener('focusout', toPage)
95
+ // … and when pressing enter inside the input
96
+ input.addEventListener('keyup', function(e) { if (e.which === 13) {toPage()} }.bind(this))
97
+ }
98
+
99
+ Pagy.trim =
100
+ function(html, param) {
101
+ var re = new RegExp('[?&]' + param + '=1\\b(?!&)|\\b' + param + '=1&')
102
+ return html.replace(re, '')
103
+ }
104
+
105
+ Pagy.renderNavs =
106
+ function() {
107
+ var navs = document.getElementsByClassName('pagy-njs') // 'pagy-njs' is common to all *nav_js helpers
108
+ for (var i = 0, len = navs.length; i < len; i++) { navs[i].render() }
109
+ }
110
+
111
+ Pagy.waitForMe =
112
+ function() {
113
+ if (typeof(Pagy.tid) === 'number') { clearTimeout(Pagy.tid) }
114
+ Pagy.tid = setTimeout(Pagy.renderNavs, Pagy.delay)
115
+ }
116
+
117
+
118
+ if (typeof window !== "undefined") {
119
+ window.addEventListener('resize', Pagy.waitForMe, true)
120
+ }
121
+
122
+
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bens-hello-world
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.8
4
+ version: 4.10.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - BK
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-07-30 00:00:00.000000000 Z
11
+ date: 2021-08-02 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: This is a pure dummy gem. Hello world. We wanna test out github actions
14
14
  and publishing ruby gems.
@@ -18,7 +18,7 @@ executables: []
18
18
  extensions: []
19
19
  extra_rdoc_files: []
20
20
  files:
21
- - ".github/workflows/manual-release.yml"
21
+ - ".github/workflows/publish-gem-and-tag.yml"
22
22
  - ".github/workflows/release.yml"
23
23
  - ".gitignore"
24
24
  - ".rspec"
@@ -35,6 +35,7 @@ files:
35
35
  - bin/setup
36
36
  - lib/bens/hello/world.rb
37
37
  - lib/bens/hello/world/version.rb
38
+ - lib/javascripts/pagy.js
38
39
  homepage: https://benkoshy.github.io/
39
40
  licenses:
40
41
  - MIT