ddbuffer 0.1.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/Gemfile +1 -0
- data/NEWS.md +9 -0
- data/README.md +5 -0
- data/lib/ddbuffer/version.rb +1 -1
- data/lib/ddbuffer.rb +1 -1
- data/scripts/release +100 -0
- data/spec/spec_helper.rb +6 -0
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 18a7511205723f69c3f1975f528b5c7c77478cf7
|
4
|
+
data.tar.gz: 4cbd691685cc43fb2f8cd7500647497871224a12
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4e436cecf19bdd288fa688bacd4b05ff0b46abb7e02c9e1082073102be4c7d516dcfbb584a65f7b455d077206e45febd00f50589fa3879e091ff5aa82c64cc93
|
7
|
+
data.tar.gz: 228c9d71c3aee58d6206cd249a46d844bfeac8385dedf16f1e19b842257497f5c3597233c0f28963900c60bf18b3064fb3d897f2f5f6cbb8ef6720cdd177cbea
|
data/.gitignore
CHANGED
data/Gemfile
CHANGED
data/NEWS.md
ADDED
data/README.md
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
[![Gem version](http://img.shields.io/gem/v/ddbuffer.svg)](http://rubygems.org/gems/ddbuffer)
|
2
|
+
[![Build status](http://img.shields.io/travis/ddfreyne/ddbuffer.svg)](https://travis-ci.org/ddfreyne/ddbuffer)
|
3
|
+
[![Code Climate](http://img.shields.io/codeclimate/github/ddfreyne/ddbuffer.svg)](https://codeclimate.com/github/ddfreyne/ddbuffer)
|
4
|
+
[![Code Coverage](https://img.shields.io/codecov/c/github/ddfreyne/ddbuffer.svg)](https://codecov.io/gh/ddfreyne/ddbuffer)
|
5
|
+
|
1
6
|
# DDBuffer
|
2
7
|
|
3
8
|
Provides a way to buffer Ruby enumerables/enumerators.
|
data/lib/ddbuffer/version.rb
CHANGED
data/lib/ddbuffer.rb
CHANGED
data/scripts/release
ADDED
@@ -0,0 +1,100 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
require 'fileutils'
|
5
|
+
require 'octokit'
|
6
|
+
|
7
|
+
CONFIG_GEM_NAME = 'ddbuffer'
|
8
|
+
CONFIG_REPO_NAME = 'ddfreyne/ddbuffer'
|
9
|
+
CONFIG_VERSION_FILE = '../lib/ddbuffer/version'
|
10
|
+
CONFIG_VERSION_PROC = -> { DDBuffer::VERSION }
|
11
|
+
|
12
|
+
def run(*args)
|
13
|
+
puts 'I will execute the following:'
|
14
|
+
puts ' ' + args.map { |a| a =~ /\s/ ? a.inspect : a }.join(' ')
|
15
|
+
print 'Is this correct? [y/N] '
|
16
|
+
res = gets
|
17
|
+
unless res.strip.casecmp('y').zero?
|
18
|
+
warn 'Answer was not Y; release aborted.'
|
19
|
+
exit 1
|
20
|
+
end
|
21
|
+
|
22
|
+
system('echo', *args)
|
23
|
+
system(*args)
|
24
|
+
|
25
|
+
print 'Continue? [y/N] '
|
26
|
+
res = gets
|
27
|
+
unless res.strip.casecmp('y').zero?
|
28
|
+
warn 'Answer was not Y; release aborted.'
|
29
|
+
exit 1
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
puts '=== Logging in to GitHub’s API…'
|
34
|
+
client = Octokit::Client.new(netrc: true)
|
35
|
+
puts
|
36
|
+
|
37
|
+
puts '=== Deleting old *.gem files…'
|
38
|
+
Dir['*.gem'].each do |fn|
|
39
|
+
puts " #{fn}…"
|
40
|
+
FileUtils.rm_f(fn)
|
41
|
+
end
|
42
|
+
puts
|
43
|
+
|
44
|
+
puts '=== Verifying presence of release date…'
|
45
|
+
unless File.readlines('NEWS.md').drop(2).first =~ / \(\d{4}-\d{2}-\d{2}\)$/
|
46
|
+
warn 'No proper release date found!'
|
47
|
+
exit 1
|
48
|
+
end
|
49
|
+
puts
|
50
|
+
|
51
|
+
puts '=== Building new gem…'
|
52
|
+
run('gem', 'build', "#{CONFIG_GEM_NAME}.gemspec")
|
53
|
+
puts
|
54
|
+
|
55
|
+
puts '=== Reading version…'
|
56
|
+
require_relative CONFIG_VERSION_FILE
|
57
|
+
puts "Version = #{CONFIG_VERSION_PROC.call}"
|
58
|
+
puts
|
59
|
+
|
60
|
+
puts '=== Verifying that release does not yet exist…'
|
61
|
+
releases = client.releases(CONFIG_REPO_NAME)
|
62
|
+
release = releases.find { |r| r.tag_name == CONFIG_VERSION_PROC.call }
|
63
|
+
if release
|
64
|
+
warn 'Release already exists!'
|
65
|
+
warn 'ABORTED!'
|
66
|
+
exit 1
|
67
|
+
end
|
68
|
+
puts
|
69
|
+
|
70
|
+
puts '=== Creating Git tag…'
|
71
|
+
run('git', 'tag', '--sign', '--annotate', CONFIG_VERSION_PROC.call, '--message', "Version #{CONFIG_VERSION_PROC.call}")
|
72
|
+
puts
|
73
|
+
|
74
|
+
puts '=== Pushing Git data…'
|
75
|
+
run('git', 'push', 'origin', '--tags')
|
76
|
+
puts
|
77
|
+
|
78
|
+
puts '=== Pushing gem…'
|
79
|
+
run('gem', 'push', "#{CONFIG_GEM_NAME}-#{CONFIG_VERSION_PROC.call}.gem")
|
80
|
+
puts
|
81
|
+
|
82
|
+
puts '=== Reading release notes…'
|
83
|
+
release_notes =
|
84
|
+
File.readlines('NEWS.md')
|
85
|
+
.drop(4)
|
86
|
+
.take_while { |l| l !~ /^## / }
|
87
|
+
.join
|
88
|
+
puts
|
89
|
+
|
90
|
+
puts '=== Creating release on GitHub…'
|
91
|
+
sleep 3 # Give GitHub some time to detect the new tag
|
92
|
+
is_prerelease = CONFIG_VERSION_PROC.call =~ /a|b|rc/ || CONFIG_VERSION_PROC.call =~ /^0/
|
93
|
+
client.create_release(
|
94
|
+
CONFIG_REPO_NAME, CONFIG_VERSION_PROC.call,
|
95
|
+
prerelease: !is_prerelease.nil?,
|
96
|
+
body: release_notes
|
97
|
+
)
|
98
|
+
puts
|
99
|
+
|
100
|
+
puts 'DONE!'
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ddbuffer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Denis Defreyne
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-10-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -38,11 +38,13 @@ files:
|
|
38
38
|
- CODE_OF_CONDUCT.md
|
39
39
|
- Gemfile
|
40
40
|
- LICENSE.txt
|
41
|
+
- NEWS.md
|
41
42
|
- README.md
|
42
43
|
- Rakefile
|
43
44
|
- ddbuffer.gemspec
|
44
45
|
- lib/ddbuffer.rb
|
45
46
|
- lib/ddbuffer/version.rb
|
47
|
+
- scripts/release
|
46
48
|
- spec/ddbuffer_spec.rb
|
47
49
|
- spec/spec_helper.rb
|
48
50
|
homepage: https://github.com/ddfreyne/ddbuffer
|
@@ -65,7 +67,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
65
67
|
version: '0'
|
66
68
|
requirements: []
|
67
69
|
rubyforge_project:
|
68
|
-
rubygems_version: 2.6.
|
70
|
+
rubygems_version: 2.6.14
|
69
71
|
signing_key:
|
70
72
|
specification_version: 4
|
71
73
|
summary: Buffer enumerables
|