humanized_id 0.2.0 → 0.4.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
- SHA1:
3
- metadata.gz: ae0f1548e28b86a0eb8ef77c60e2f443ee921d71
4
- data.tar.gz: ed2e71e69d3894663724123b8e6af446da5f1e4c
2
+ SHA256:
3
+ metadata.gz: 2114e86408727b2f8e25bb0659b03ce1cf9bc6f85b04c896766f0087364c1510
4
+ data.tar.gz: d652c7df4d502f3b32a6e3d1da09a17a2d798de0a86c49c7d84d72d04376e9ef
5
5
  SHA512:
6
- metadata.gz: f88c10da3c918d4801648690f132842919523684331668898d6d886fdcaf716f8d64993f707e7c85c357158bd00b396abd759a9c31b6442df90d53c55ac312ed
7
- data.tar.gz: 451492aef369a46fd67cd2b661246e4bfe543ca11fda7cff490b61ab757e6300dfddf92ccf9fd3c69da02c876e2bde1f95f740a29eeea05abac8c3f2c185cbf6
6
+ metadata.gz: d343977b1824c7b03b87ad4f4f7809af635b2f3aeafe91174e38ca3e18705fdc6d5b1ae99332c9e844f0c864fc17179643c5c3540e867b33f910803f405fb4ca
7
+ data.tar.gz: 883fcc4c45c306bcdd2c24fd37593fc95093a98da1901f9f77a8ebd2c9dfd522bd691599bb108a1efead81ae3b1f93adead1cd0bcb5b271db03f62d8cf044ea0
@@ -0,0 +1,59 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*"
7
+
8
+ jobs:
9
+ build:
10
+ name: Build
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - name: Checkout
14
+ uses: actions/checkout@v2
15
+ - uses: ruby/setup-ruby@v1
16
+ with:
17
+ bundler-cache: true
18
+ - run: bundle exec rake
19
+
20
+ release:
21
+ needs: build
22
+ name: Release
23
+ runs-on: ubuntu-latest
24
+ steps:
25
+ - name: Checkout
26
+ uses: actions/checkout@v2
27
+
28
+ - name: Generate Changelog
29
+ run: |
30
+ # Get version from github ref (remove 'refs/tags/' and prefix 'v')
31
+ version="${GITHUB_REF#refs/tags/v}"
32
+ npx changelog-parser CHANGELOG.md | jq -cr ".versions | .[] | select(.version == \"$version\") | .body" > ${{ github.workflow }}-CHANGELOG.txt
33
+
34
+ - name: Release
35
+ uses: softprops/action-gh-release@v1
36
+ with:
37
+ body_path: ${{ github.workflow }}-CHANGELOG.txt
38
+ env:
39
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40
+
41
+ publish:
42
+ needs: [build, release]
43
+ name: Publish
44
+ runs-on: ubuntu-latest
45
+
46
+ steps:
47
+ - uses: actions/checkout@v2
48
+ - uses: ruby/setup-ruby@v1
49
+
50
+ - name: Publish to RubyGems
51
+ run: |
52
+ mkdir -p $HOME/.gem
53
+ touch $HOME/.gem/credentials
54
+ chmod 0600 $HOME/.gem/credentials
55
+ printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
56
+ gem build *.gemspec
57
+ gem push *.gem
58
+ env:
59
+ GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_AUTH_TOKEN}}"
@@ -0,0 +1,21 @@
1
+ name: Build and Test
2
+ on: [push, pull_request]
3
+ jobs:
4
+ test:
5
+ strategy:
6
+ fail-fast: false
7
+ matrix:
8
+ ruby: ["3.0", "3.1", "3.2"]
9
+ runs-on: ubuntu-latest
10
+ steps:
11
+ - uses: actions/checkout@v2
12
+ - uses: ruby/setup-ruby@v1
13
+ with:
14
+ ruby-version: ${{ matrix.ruby }}
15
+ bundler-cache: true
16
+ - run: bundle exec rake
17
+ - name: Coveralls
18
+ uses: coverallsapp/github-action@master
19
+ with:
20
+ github-token: ${{ secrets.GITHUB_TOKEN }}
21
+ path-to-lcov: coverage/lcov.info
data/.rubocop.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  AllCops:
2
- TargetRubyVersion: 2.1
2
+ TargetRubyVersion: 3.2
3
3
 
4
4
  Metrics/LineLength:
5
5
  Max: 100
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.3.0
1
+ 3.2.0
data/CHANGELOG.md CHANGED
@@ -1,13 +1,22 @@
1
+ ## 0.4.0
2
+
3
+ - [PLAT-1175] Update to Ruby 3.2
4
+
5
+ ## 0.3.0
6
+
7
+ - Use coverage kit to enforce maximum coverage
8
+ - [TT-8610] Build with github actions, add ruby 3 to build matrix
9
+
1
10
  ## 0.2.0 (2016-02-11)
2
11
 
3
12
  Fixed:
4
13
 
5
- - Requires Ruby >= 2.1 (Ruby < 2.1 never worked)
14
+ - Requires Ruby >= 2.1 (Ruby < 2.1 never worked)
6
15
 
7
16
  Changed:
8
17
 
9
- - Refactors internal logic
10
- - Updates tests
18
+ - Refactors internal logic
19
+ - Updates tests
11
20
 
12
21
  ## 0.1.0 (2016-02-11)
13
22
 
@@ -1,14 +1,14 @@
1
1
  # HumanizedId
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/humanized_id.svg)](https://badge.fury.io/rb/humanized_id)
4
- [![Build Status](https://travis-ci.org/sealink/humanized_id.svg?branch=master)](https://travis-ci.org/sealink/humanized_id)
4
+ [![Build Status](https://github.com/sealink/humanized_id/workflows/Build%20and%20Test/badge.svg?branch=master)](https://github.com/sealink/humanized_id/actions)
5
5
  [![Coverage Status](https://coveralls.io/repos/github/sealink/humanized_id/badge.svg?branch=master)](https://coveralls.io/github/sealink/humanized_id?branch=master)
6
- [![Dependency Status](https://gemnasium.com/sealink/humanized_id.svg)](https://gemnasium.com/sealink/humanized_id)
7
6
  [![Code Climate](https://codeclimate.com/github/sealink/humanized_id/badges/gpa.svg)](https://codeclimate.com/github/sealink/humanized_id)
8
7
 
9
8
  HumanizedId is a gem designed to help you either:
10
- - Convert an existing numerical id into a 'human friendly' alphanumerical id
11
- - Generate a random 'human friendly' id that is of a specified or default length
9
+
10
+ - Convert an existing numerical id into a 'human friendly' alphanumerical id
11
+ - Generate a random 'human friendly' id that is of a specified or default length
12
12
 
13
13
  A 'humanized' (or 'human friendly') id is an id that is easy to read and is based
14
14
  off a character set that does not allow vague or vulgar references.
@@ -86,6 +86,18 @@ After checking out the repo, run `bin/setup` to install dependencies. Then, run
86
86
 
87
87
  To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release` to create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
88
88
 
89
+ ## Release
90
+
91
+ To publish a new version of this gem the following steps must be taken.
92
+
93
+ - Update the version in the following files
94
+ ```
95
+ CHANGELOG.md
96
+ lib/humanized_id/version.rb
97
+ ```
98
+ - Create a tag using the format v0.1.0
99
+ - Follow build progress in GitHub actions
100
+
89
101
  ## Contributing
90
102
 
91
103
  1. Fork it ( https://github.com/sealink/humanized_id/fork )
data/humanized_id.gemspec CHANGED
@@ -25,14 +25,13 @@ Gem::Specification.new do |spec|
25
25
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
26
26
  spec.require_paths = ['lib']
27
27
 
28
- spec.required_ruby_version = '>= 2.1'
28
+ spec.required_ruby_version = '>= 3.0'
29
+ spec.add_runtime_dependency 'securerandom'
29
30
 
30
31
  spec.add_development_dependency 'bundler'
31
32
  spec.add_development_dependency 'rake'
32
33
  spec.add_development_dependency 'rspec'
33
- spec.add_development_dependency 'simplecov'
34
- spec.add_development_dependency 'simplecov-rcov'
35
- spec.add_development_dependency 'coveralls'
34
+ spec.add_development_dependency 'coverage-kit'
36
35
  spec.add_development_dependency 'rubocop'
37
- spec.add_development_dependency 'travis'
36
+ spec.add_development_dependency 'pry'
38
37
  end
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module HumanizedId
3
- VERSION = '0.2.0'.freeze
3
+ VERSION = '0.4.0'
4
4
  end
data/lib/humanized_id.rb CHANGED
@@ -1,4 +1,6 @@
1
1
  # frozen_string_literal: true
2
+ require 'securerandom'
3
+
2
4
  module HumanizedId
3
5
  DEFAULT_GENERATION_LENGTH = 24
4
6
  SIMILAR_NUMBERS_LETTERS = %w(0 O 1 I L 5 S 8 B).freeze
metadata CHANGED
@@ -1,37 +1,23 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: humanized_id
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Akil Madan
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-02-12 00:00:00.000000000 Z
11
+ date: 2023-01-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: bundler
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ">="
18
- - !ruby/object:Gem::Version
19
- version: '0'
20
- type: :development
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - ">="
25
- - !ruby/object:Gem::Version
26
- version: '0'
27
- - !ruby/object:Gem::Dependency
28
- name: rake
14
+ name: securerandom
29
15
  requirement: !ruby/object:Gem::Requirement
30
16
  requirements:
31
17
  - - ">="
32
18
  - !ruby/object:Gem::Version
33
19
  version: '0'
34
- type: :development
20
+ type: :runtime
35
21
  prerelease: false
36
22
  version_requirements: !ruby/object:Gem::Requirement
37
23
  requirements:
@@ -39,7 +25,7 @@ dependencies:
39
25
  - !ruby/object:Gem::Version
40
26
  version: '0'
41
27
  - !ruby/object:Gem::Dependency
42
- name: rspec
28
+ name: bundler
43
29
  requirement: !ruby/object:Gem::Requirement
44
30
  requirements:
45
31
  - - ">="
@@ -53,7 +39,7 @@ dependencies:
53
39
  - !ruby/object:Gem::Version
54
40
  version: '0'
55
41
  - !ruby/object:Gem::Dependency
56
- name: simplecov
42
+ name: rake
57
43
  requirement: !ruby/object:Gem::Requirement
58
44
  requirements:
59
45
  - - ">="
@@ -67,7 +53,7 @@ dependencies:
67
53
  - !ruby/object:Gem::Version
68
54
  version: '0'
69
55
  - !ruby/object:Gem::Dependency
70
- name: simplecov-rcov
56
+ name: rspec
71
57
  requirement: !ruby/object:Gem::Requirement
72
58
  requirements:
73
59
  - - ">="
@@ -81,7 +67,7 @@ dependencies:
81
67
  - !ruby/object:Gem::Version
82
68
  version: '0'
83
69
  - !ruby/object:Gem::Dependency
84
- name: coveralls
70
+ name: coverage-kit
85
71
  requirement: !ruby/object:Gem::Requirement
86
72
  requirements:
87
73
  - - ">="
@@ -109,7 +95,7 @@ dependencies:
109
95
  - !ruby/object:Gem::Version
110
96
  version: '0'
111
97
  - !ruby/object:Gem::Dependency
112
- name: travis
98
+ name: pry
113
99
  requirement: !ruby/object:Gem::Requirement
114
100
  requirements:
115
101
  - - ">="
@@ -130,17 +116,18 @@ executables: []
130
116
  extensions: []
131
117
  extra_rdoc_files: []
132
118
  files:
119
+ - ".github/workflows/release.yml"
120
+ - ".github/workflows/ruby.yml"
133
121
  - ".gitignore"
134
122
  - ".rspec"
135
123
  - ".rubocop.yml"
136
124
  - ".ruby-version"
137
- - ".travis.yml"
138
125
  - CHANGELOG.md
139
126
  - CODE_OF_CONDUCT.md
140
127
  - Gemfile
141
128
  - LICENSE.txt
129
+ - README.md
142
130
  - Rakefile
143
- - Readme.md
144
131
  - bin/console
145
132
  - bin/setup
146
133
  - humanized_id.gemspec
@@ -160,15 +147,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
160
147
  requirements:
161
148
  - - ">="
162
149
  - !ruby/object:Gem::Version
163
- version: '2.1'
150
+ version: '3.0'
164
151
  required_rubygems_version: !ruby/object:Gem::Requirement
165
152
  requirements:
166
153
  - - ">="
167
154
  - !ruby/object:Gem::Version
168
155
  version: '0'
169
156
  requirements: []
170
- rubyforge_project:
171
- rubygems_version: 2.5.1
157
+ rubygems_version: 3.4.1
172
158
  signing_key:
173
159
  specification_version: 4
174
160
  summary: Gem to convert an existing id to a human friendly id or generate a new human
data/.travis.yml DELETED
@@ -1,13 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 2.1
4
- - 2.2
5
- - 2.3.0
6
- before_install: gem install bundler -v 1.11.2
7
- notifications:
8
- email:
9
- - support@travellink.com.au
10
- flowdock:
11
- secure: CkLwygzeYX5y3r0eg1bn8wFLYd7qLeOrbrawQb/c/sTehXvU95sE/yZMNdPKD/Mv+IQ+blVVr4NAt8MvbN20Nw/W5EtcsMo2S2msuCsVbwCkvj21Dqm+pTRoD8O2yf3zxX5T7wmZ7PoD7UfE+wIPQ5C7QunODxCPnpPlj/RCaOKejarmdQWXQaT6/lJpzoRDav2oj+bbyPCwQbYGSYWFPFwQ3FylGNp/7eCD3wSPJtmYdunJtx1yVW4wnInTEzqsQ4eJubpwEfQ8vsWq7KbeUf2Z0IaPVtSzwN7gjIncGJ1gS5MGhZkFSsNhY9BvVkWw366qkTcESB3CbF5O9vUrUyWAaiLIHZrqTaqhocZ+4Y6jWJG/gSfLGYTSlVx+qxQ/Pd75bXu6ovlL2HF9lYEL1mbVp4GrOGcQTnw2SLOnLRmsGtf5CEVBE4llQXR0ySzqLCc0Q6XBLgbvG5yg+iKsnDQRZijStUQze/rQVGbtOLxXXyv+mQolaKd475igJYZB29KS0gW3gCJrTQPLRm1D/PPIOHLFysKgPc6kE5UcPWmTrnH8hWKj2K0tiN+u5S4jostoh1riDBr+baLQ5eI9k6KVevM7t1ICiSb9A9WpRfbUtGRHirnte/MgAc0EJ/J/iAT5breaV9urnjzyaYvpH8YzXHMbuw/tlS8jdxlI8qs=
12
- sudo: false
13
- cache: bundler