gemplate 0.1.8 → 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/.travis.yml +6 -6
- data/CHANGELOG.md +4 -0
- data/bin/gemplate +2 -2
- data/gemplate.gemspec +5 -6
- data/lib/gemplate.rb +3 -52
- data/spec/gemplate_spec.rb +0 -18
- data/template/.travis.yml +4 -1
- data/template/REPO_NAME.gemspec +1 -1
- metadata +10 -23
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 90c906bbf589e2b24bb2bd16ba8d98ccfbe230ac
|
4
|
+
data.tar.gz: 175794659750866fe5a749414ad0a2a07550329e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 13b823d87ccf165b11bc810d17afdac545bcdbaef6ed77e76f80d067331e0b55b5dd040d77584308e271972a0409ca928b9fc98b3234c9e18ea6d79fe5abc319
|
7
|
+
data.tar.gz: 72090c4fdaa653987c0bb3e5fc370ea98f25719c0e4a32b72394237905a7b9ad68cb4ac6c8b8c3e9bcb1ec81b9c5457e82edf2136a9b69da179f29cb7917256b
|
data/.travis.yml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
language: ruby
|
2
2
|
cache: bundler
|
3
|
+
sudo: false
|
3
4
|
rvm:
|
4
|
-
- 2.
|
5
|
-
- 2.1.
|
6
|
-
- 2.
|
7
|
-
-
|
8
|
-
- 1.9.3
|
5
|
+
- 2.2.0
|
6
|
+
- 2.1.5
|
7
|
+
- 2.0.0-p598
|
8
|
+
- 1.9.3-p551
|
9
9
|
notifications:
|
10
10
|
email: false
|
11
11
|
irc:
|
12
12
|
template:
|
13
13
|
- '%{repository}/%{branch}/%{build_number}: %{message} -- %{build_url}'
|
14
14
|
channels:
|
15
|
-
|
15
|
+
- irc.oftc.net#akerl
|
data/CHANGELOG.md
ADDED
data/bin/gemplate
CHANGED
@@ -18,10 +18,10 @@ email = Rugged::Config.global['user.email']
|
|
18
18
|
email = UserInput.new(message: 'Email address', default: email).ask
|
19
19
|
|
20
20
|
irc_command = `security find-generic-password -g -s TravisIRC 2>&1`.split "\n"
|
21
|
-
irc_stanza = irc_command.each_with_object([
|
21
|
+
irc_stanza = irc_command.each_with_object([nil, nil]) do |x, o|
|
22
22
|
o[1] = x.split[1][1..-2] if x.match(/^password/)
|
23
23
|
o[0] = x.split('=')[1][1..-2] if x.match(/^[\s"]*acct/)
|
24
|
-
end.join(',')
|
24
|
+
end.reject(&:empty?).join(',')
|
25
25
|
irc_stanza = UserInput.new(
|
26
26
|
message: 'IRC channel/key',
|
27
27
|
default: irc_stanza
|
data/gemplate.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'gemplate'
|
3
|
-
s.version = '0.
|
4
|
-
s.date = Time.now.strftime(
|
3
|
+
s.version = '1.0.0'
|
4
|
+
s.date = Time.now.strftime('%Y-%m-%d')
|
5
5
|
|
6
6
|
s.summary = 'Bootstrap tool for making gems'
|
7
7
|
s.description = 'Creates a basic repository layout for a new gem'
|
@@ -14,13 +14,12 @@ Gem::Specification.new do |s|
|
|
14
14
|
s.test_files = `git ls-files spec/*`.split
|
15
15
|
s.executables = ['gemplate']
|
16
16
|
|
17
|
-
s.add_dependency 'travis', '~> 1.7.1'
|
18
17
|
s.add_dependency 'rugged', '~> 0.21.0'
|
19
|
-
s.add_dependency 'userinput', '~> 0.0
|
18
|
+
s.add_dependency 'userinput', '~> 1.0.0'
|
20
19
|
s.add_dependency 'curb', '~> 0.8.6'
|
21
20
|
|
22
|
-
s.add_development_dependency 'rubocop', '~> 0.
|
23
|
-
s.add_development_dependency 'rake', '~> 10.
|
21
|
+
s.add_development_dependency 'rubocop', '~> 0.28.0'
|
22
|
+
s.add_development_dependency 'rake', '~> 10.4.0'
|
24
23
|
s.add_development_dependency 'coveralls', '~> 0.7.1'
|
25
24
|
s.add_development_dependency 'rspec', '~> 3.1.0'
|
26
25
|
s.add_development_dependency 'fuubar', '~> 2.0.0'
|
data/lib/gemplate.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
require 'travis'
|
2
1
|
require 'rugged'
|
3
2
|
require 'pathname'
|
4
3
|
require 'fileutils'
|
@@ -38,7 +37,6 @@ module Gemplate
|
|
38
37
|
process_templates
|
39
38
|
adjust_files
|
40
39
|
make_repo
|
41
|
-
configure_travis
|
42
40
|
Dir.chdir '..'
|
43
41
|
end
|
44
42
|
|
@@ -73,12 +71,13 @@ module Gemplate
|
|
73
71
|
[/REPO_NAME/, @name],
|
74
72
|
[/EMAIL_ADDRESS/, @email],
|
75
73
|
[/CURRENT_YEAR/, Time.now.strftime('%Y')],
|
76
|
-
[/#DEV_DEPS/, dependencies]
|
74
|
+
[/#DEV_DEPS/, dependencies],
|
75
|
+
[/IRC_STANZA/, @irc_stanza]
|
77
76
|
]
|
78
77
|
end
|
79
78
|
|
80
79
|
def process_templates
|
81
|
-
Dir.glob('**/*').each do |path|
|
80
|
+
Dir.glob('**/*', File::FNM_DOTMATCH).each do |path|
|
82
81
|
next unless File.file? path
|
83
82
|
text = File.read path
|
84
83
|
replacements.each { |regex, new| text.gsub! regex, new }
|
@@ -99,53 +98,5 @@ module Gemplate
|
|
99
98
|
`git config branch.master.remote origin`
|
100
99
|
`git config branch.master.merge refs/heads/master`
|
101
100
|
end
|
102
|
-
|
103
|
-
def configure_travis
|
104
|
-
crypter = Travis::CLI::Encrypt.new
|
105
|
-
crypter.parse travis_args
|
106
|
-
crypter.execute
|
107
|
-
rescue Travis::Client::NotLoggedIn
|
108
|
-
puts travis_help
|
109
|
-
end
|
110
|
-
|
111
|
-
private
|
112
|
-
|
113
|
-
def travis_args
|
114
|
-
[
|
115
|
-
'encrypt', '--skip-completion-check', '--no-interactive', '--explode',
|
116
|
-
'-p', '--add', 'notifications.irc.channels', "'#{@irc_stanza}'"
|
117
|
-
]
|
118
|
-
end
|
119
|
-
|
120
|
-
def travis_help
|
121
|
-
'Travis IRC configuration failed; ' + \
|
122
|
-
'make sure the repo exists on GitHub and Travis, then run:' + \
|
123
|
-
"\n travis #{travis_args.join ' '}"
|
124
|
-
end
|
125
|
-
end
|
126
|
-
end
|
127
|
-
|
128
|
-
module Travis
|
129
|
-
module CLI
|
130
|
-
##
|
131
|
-
# Adjust Travis to raise instead of shouting
|
132
|
-
class ApiCommand
|
133
|
-
def authenticate
|
134
|
-
fail Travis::Client::NotLoggedIn if access_token.nil?
|
135
|
-
end
|
136
|
-
end
|
137
|
-
end
|
138
|
-
end
|
139
|
-
|
140
|
-
##
|
141
|
-
# Reopen Travis
|
142
|
-
module Travis
|
143
|
-
module CLI
|
144
|
-
##
|
145
|
-
# Patch Encrypt to not print to stderr
|
146
|
-
class Encrypt
|
147
|
-
def info(*_)
|
148
|
-
end
|
149
|
-
end
|
150
101
|
end
|
151
102
|
end
|
data/spec/gemplate_spec.rb
CHANGED
@@ -76,24 +76,6 @@ describe Gemplate do
|
|
76
76
|
expect(`git config -f gemplate/.git/config -l`).to match(regex)
|
77
77
|
end
|
78
78
|
end
|
79
|
-
|
80
|
-
it 'configures the IRC key for Travis' do
|
81
|
-
subject.create
|
82
|
-
expect(File.read 'gemplate/.travis.yml').to match(/channels:/)
|
83
|
-
end
|
84
|
-
|
85
|
-
it 'warns if the Travis configuration fails' do
|
86
|
-
gem = Gemplate::Gem.new(
|
87
|
-
name: 'other_gem',
|
88
|
-
user: 'akerl',
|
89
|
-
full_name: 'my_full_name',
|
90
|
-
email: 'my_email@example.org',
|
91
|
-
irc_stanza: 'irc://irc.example.org:6697#channel,password',
|
92
|
-
license: 'MIT'
|
93
|
-
)
|
94
|
-
expect(gem).to receive(:puts).with(/Travis IRC configuration failed/)
|
95
|
-
gem.create
|
96
|
-
end
|
97
79
|
end
|
98
80
|
end
|
99
81
|
end
|
data/template/.travis.yml
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
language: ruby
|
2
2
|
cache: bundler
|
3
|
+
sudo: false
|
3
4
|
rvm:
|
4
5
|
- 2.1.0
|
5
6
|
- 2.0.0
|
@@ -7,5 +8,7 @@ rvm:
|
|
7
8
|
notifications:
|
8
9
|
email: false
|
9
10
|
irc:
|
11
|
+
channels:
|
12
|
+
- IRC_STANZA
|
10
13
|
template:
|
11
|
-
|
14
|
+
- '%{repository}/%{branch}/%{build_number}: %{message} -- %{build_url}'
|
data/template/REPO_NAME.gemspec
CHANGED
metadata
CHANGED
@@ -1,29 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gemplate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Les Aker
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-01-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: travis
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: 1.7.1
|
20
|
-
type: :runtime
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - "~>"
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: 1.7.1
|
27
13
|
- !ruby/object:Gem::Dependency
|
28
14
|
name: rugged
|
29
15
|
requirement: !ruby/object:Gem::Requirement
|
@@ -44,14 +30,14 @@ dependencies:
|
|
44
30
|
requirements:
|
45
31
|
- - "~>"
|
46
32
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0.0
|
33
|
+
version: 1.0.0
|
48
34
|
type: :runtime
|
49
35
|
prerelease: false
|
50
36
|
version_requirements: !ruby/object:Gem::Requirement
|
51
37
|
requirements:
|
52
38
|
- - "~>"
|
53
39
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0.0
|
40
|
+
version: 1.0.0
|
55
41
|
- !ruby/object:Gem::Dependency
|
56
42
|
name: curb
|
57
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -72,28 +58,28 @@ dependencies:
|
|
72
58
|
requirements:
|
73
59
|
- - "~>"
|
74
60
|
- !ruby/object:Gem::Version
|
75
|
-
version: 0.
|
61
|
+
version: 0.28.0
|
76
62
|
type: :development
|
77
63
|
prerelease: false
|
78
64
|
version_requirements: !ruby/object:Gem::Requirement
|
79
65
|
requirements:
|
80
66
|
- - "~>"
|
81
67
|
- !ruby/object:Gem::Version
|
82
|
-
version: 0.
|
68
|
+
version: 0.28.0
|
83
69
|
- !ruby/object:Gem::Dependency
|
84
70
|
name: rake
|
85
71
|
requirement: !ruby/object:Gem::Requirement
|
86
72
|
requirements:
|
87
73
|
- - "~>"
|
88
74
|
- !ruby/object:Gem::Version
|
89
|
-
version: 10.
|
75
|
+
version: 10.4.0
|
90
76
|
type: :development
|
91
77
|
prerelease: false
|
92
78
|
version_requirements: !ruby/object:Gem::Requirement
|
93
79
|
requirements:
|
94
80
|
- - "~>"
|
95
81
|
- !ruby/object:Gem::Version
|
96
|
-
version: 10.
|
82
|
+
version: 10.4.0
|
97
83
|
- !ruby/object:Gem::Dependency
|
98
84
|
name: coveralls
|
99
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -148,6 +134,7 @@ files:
|
|
148
134
|
- ".rubocop.yml"
|
149
135
|
- ".test/.gitignore"
|
150
136
|
- ".travis.yml"
|
137
|
+
- CHANGELOG.md
|
151
138
|
- Gemfile
|
152
139
|
- LICENSE
|
153
140
|
- README.md
|
@@ -188,7 +175,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
188
175
|
version: '0'
|
189
176
|
requirements: []
|
190
177
|
rubyforge_project:
|
191
|
-
rubygems_version: 2.
|
178
|
+
rubygems_version: 2.4.5
|
192
179
|
signing_key:
|
193
180
|
specification_version: 4
|
194
181
|
summary: Bootstrap tool for making gems
|