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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 574fdd8a2e913618eb41f95db6ea7d3eaf16ee46
4
- data.tar.gz: c013a57234f5dc71e365a4e228056504d78b7502
3
+ metadata.gz: 18a7511205723f69c3f1975f528b5c7c77478cf7
4
+ data.tar.gz: 4cbd691685cc43fb2f8cd7500647497871224a12
5
5
  SHA512:
6
- metadata.gz: cfb8bcd4801d0dd214037d85d470d35be418eabe1b115305c16a75c565e64b8bae2db7d34453278fd62c63f657b0e28bcf2cd012229e800ce21dff3da653beb3
7
- data.tar.gz: 1de6bfb037df2cb87f47b4df54c30cab9c555a5d163f1658d3a283cecceda8c786c54d736203ff67480d79406a90d0ad34bff5ae7e67245a52348199af8f5075
6
+ metadata.gz: 4e436cecf19bdd288fa688bacd4b05ff0b46abb7e02c9e1082073102be4c7d516dcfbb584a65f7b455d077206e45febd00f50589fa3879e091ff5aa82c64cc93
7
+ data.tar.gz: 228c9d71c3aee58d6206cd249a46d844bfeac8385dedf16f1e19b842257497f5c3597233c0f28963900c60bf18b3064fb3d897f2f5f6cbb8ef6720cdd177cbea
data/.gitignore CHANGED
@@ -1,2 +1,3 @@
1
+ /coverage
1
2
  /Gemfile.lock
2
3
  *.gem
data/Gemfile CHANGED
@@ -4,6 +4,7 @@ source 'https://rubygems.org'
4
4
 
5
5
  gemspec
6
6
 
7
+ gem 'codecov', require: false
7
8
  gem 'fuubar'
8
9
  gem 'rake'
9
10
  gem 'rspec'
data/NEWS.md ADDED
@@ -0,0 +1,9 @@
1
+ # DDBuffer release notes
2
+
3
+ ## 1.0.0 (2017-10-21)
4
+
5
+ No changes (first stable release).
6
+
7
+ ## 0.1.0 (2017-08-05)
8
+
9
+ Initial release.
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.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class DDBuffer
4
- VERSION = '0.1.0'
4
+ VERSION = '1.0.0'
5
5
  end
data/lib/ddbuffer.rb CHANGED
@@ -12,7 +12,7 @@ class DDBuffer
12
12
  begin
13
13
  enum.each { |e| queue << e }
14
14
  queue << STOP_OK
15
- rescue => e
15
+ rescue StandardError => e
16
16
  queue << STOP_ERR
17
17
  queue << e
18
18
  end
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
@@ -2,6 +2,12 @@
2
2
 
3
3
  require 'ddbuffer'
4
4
 
5
+ require 'simplecov'
6
+ SimpleCov.start
7
+
8
+ require 'codecov'
9
+ SimpleCov.formatter = SimpleCov::Formatter::Codecov
10
+
5
11
  require 'fuubar'
6
12
 
7
13
  RSpec.configure do |config|
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: 0.1.0
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-08-05 00:00:00.000000000 Z
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.12
70
+ rubygems_version: 2.6.14
69
71
  signing_key:
70
72
  specification_version: 4
71
73
  summary: Buffer enumerables