gemplate 2.0.4 → 2.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circle-ruby +3 -0
- data/circle.yml +2 -8
- data/gemplate.gemspec +8 -8
- data/lib/gemplate/gem.rb +5 -4
- data/lib/gemplate/version.rb +2 -1
- data/spec/gemplate_spec.rb +13 -7
- data/spec/spec_helper.rb +3 -0
- data/template/.circle-ruby +3 -0
- data/template/circle.yml +2 -8
- metadata +20 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ad5b9b54c8d815b0cd9d1e50a1b72bcd04c58d24
|
4
|
+
data.tar.gz: de51f9d60bcf5f75fb90463f5363be2443126a73
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8308e4b6067f6db9ccf49dd82e30c334f2f1fa7146b2629f1a105a79f63081b8404ea0f04960d63867756c7dc389c6cc683455fe3853578876d0296d8a302d60
|
7
|
+
data.tar.gz: 4fcab8e10366e8aa54a488809a170e849f03210bc956ab2030d8281bc96bf3baf4cb7e3145e4cf2b6934827390016f8ae75899f4d1b55c6b4d1598946d9eae1d
|
data/.circle-ruby
ADDED
data/circle.yml
CHANGED
@@ -1,12 +1,6 @@
|
|
1
1
|
dependencies:
|
2
2
|
override:
|
3
|
-
|
4
|
-
- 'rvm-exec 2.0.0-p645 bundle install'
|
5
|
-
- 'rvm-exec 2.1.6 bundle install'
|
6
|
-
- 'rvm-exec 2.2.2 bundle install'
|
3
|
+
- 'for i in $(cat .circle-ruby) ; do rvm-exec $i bundle install || exit 1 ; done'
|
7
4
|
test:
|
8
5
|
override:
|
9
|
-
|
10
|
-
- 'rvm-exec 2.0.0-p645 bundle exec rake'
|
11
|
-
- 'rvm-exec 2.1.6 bundle exec rake'
|
12
|
-
- 'rvm-exec 2.2.2 bundle exec rake'
|
6
|
+
- 'for i in $(cat .circle-ruby) ; do rvm-exec $i bundle exec rake || exit 1 ; done'
|
data/gemplate.gemspec
CHANGED
@@ -17,18 +17,18 @@ Gem::Specification.new do |s|
|
|
17
17
|
s.test_files = `git ls-files spec/*`.split
|
18
18
|
s.executables = ['gemplate']
|
19
19
|
|
20
|
-
s.add_dependency 'rugged', '~> 0.
|
20
|
+
s.add_dependency 'rugged', '~> 0.24.0'
|
21
21
|
s.add_dependency 'userinput', '~> 1.0.0'
|
22
|
-
s.add_dependency 'octoauth', '~> 1.4.
|
23
|
-
s.add_dependency 'octokit', '~> 4.
|
22
|
+
s.add_dependency 'octoauth', '~> 1.4.5'
|
23
|
+
s.add_dependency 'octokit', '~> 4.3.0'
|
24
24
|
s.add_dependency 'curb', '~> 0.9.0'
|
25
25
|
s.add_dependency 'mercenary', '~> 0.3.4'
|
26
26
|
|
27
|
-
s.add_development_dependency 'rubocop', '~> 0.
|
28
|
-
s.add_development_dependency 'rake', '~>
|
27
|
+
s.add_development_dependency 'rubocop', '~> 0.42.0'
|
28
|
+
s.add_development_dependency 'rake', '~> 11.2.0'
|
29
29
|
s.add_development_dependency 'codecov', '~> 0.1.1'
|
30
|
-
s.add_development_dependency 'rspec', '~> 3.
|
31
|
-
s.add_development_dependency 'fuubar', '~> 2.
|
32
|
-
s.add_development_dependency 'webmock', '~> 1.
|
30
|
+
s.add_development_dependency 'rspec', '~> 3.5.0'
|
31
|
+
s.add_development_dependency 'fuubar', '~> 2.1.0'
|
32
|
+
s.add_development_dependency 'webmock', '~> 2.1.0' # SKIP WHEN COPYING TO TEMPLATE
|
33
33
|
s.add_development_dependency 'vcr', '~> 3.0.0' # SKIP WHEN COPYING TO TEMPLATE
|
34
34
|
end
|
data/lib/gemplate/gem.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
require 'rugged'
|
2
3
|
require 'pathname'
|
3
4
|
require 'fileutils'
|
@@ -8,8 +9,8 @@ require 'octokit'
|
|
8
9
|
##
|
9
10
|
# Bootstrap tool for new gems
|
10
11
|
module Gemplate
|
11
|
-
TEMPLATE = "#{Pathname.new(__FILE__).parent.parent.parent}/template"
|
12
|
-
LICENSE_URL = 'https://raw.githubusercontent.com/akerl/licenses/master'
|
12
|
+
TEMPLATE = "#{Pathname.new(__FILE__).parent.parent.parent}/template".freeze
|
13
|
+
LICENSE_URL = 'https://raw.githubusercontent.com/akerl/licenses/master'.freeze
|
13
14
|
|
14
15
|
##
|
15
16
|
# Gem directory object
|
@@ -38,7 +39,7 @@ module Gemplate
|
|
38
39
|
private
|
39
40
|
|
40
41
|
def create_directory
|
41
|
-
|
42
|
+
raise "#{@name} already exists" if File.exist? @name
|
42
43
|
FileUtils.cp_r TEMPLATE, @name
|
43
44
|
end
|
44
45
|
|
@@ -53,7 +54,7 @@ module Gemplate
|
|
53
54
|
File.open('LICENSE', 'w') do |fh|
|
54
55
|
license = Curl::Easy.perform(url)
|
55
56
|
if license.response_code == 404
|
56
|
-
|
57
|
+
raise ArgumentError, 'Invalid license name provided'
|
57
58
|
end
|
58
59
|
fh.write license.body_str
|
59
60
|
end
|
data/lib/gemplate/version.rb
CHANGED
data/spec/gemplate_spec.rb
CHANGED
@@ -1,8 +1,9 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
require 'spec_helper'
|
2
3
|
require 'fileutils'
|
3
4
|
|
4
5
|
ROOT = Dir.pwd
|
5
|
-
TEST_GEM_NAME = 'gemplate-test'
|
6
|
+
TEST_GEM_NAME = 'gemplate-test'.freeze
|
6
7
|
|
7
8
|
describe Gemplate do
|
8
9
|
describe '#new' do
|
@@ -28,12 +29,17 @@ describe Gemplate do
|
|
28
29
|
FileUtils.rm_rf TEST_GEM_NAME
|
29
30
|
end
|
30
31
|
|
32
|
+
after(:all) do
|
33
|
+
Dir.chdir "#{ROOT}/.test"
|
34
|
+
FileUtils.rm_rf TEST_GEM_NAME
|
35
|
+
end
|
36
|
+
|
31
37
|
describe '#create' do
|
32
38
|
it 'makes a directory from the template' do
|
33
39
|
VCR.use_cassette('subject_create') do
|
34
40
|
subject.create
|
35
41
|
end
|
36
|
-
expect(Dir.exist?
|
42
|
+
expect(Dir.exist?(TEST_GEM_NAME)).to be_truthy
|
37
43
|
end
|
38
44
|
|
39
45
|
it 'raises an error if the directory already exists' do
|
@@ -47,7 +53,7 @@ describe Gemplate do
|
|
47
53
|
VCR.use_cassette('subject_create') do
|
48
54
|
subject.create
|
49
55
|
end
|
50
|
-
expect(File.exist?
|
56
|
+
expect(File.exist?("#{TEST_GEM_NAME}/LICENSE")).to be_truthy
|
51
57
|
end
|
52
58
|
|
53
59
|
it 'fails if you try to pull a non-existent license' do
|
@@ -69,7 +75,7 @@ describe Gemplate do
|
|
69
75
|
subject.create
|
70
76
|
end
|
71
77
|
expect(
|
72
|
-
File.read
|
78
|
+
File.read("#{TEST_GEM_NAME}/README.md")
|
73
79
|
).to_not match(/^REPO_NAME/)
|
74
80
|
end
|
75
81
|
|
@@ -78,16 +84,16 @@ describe Gemplate do
|
|
78
84
|
subject.create
|
79
85
|
end
|
80
86
|
expect(
|
81
|
-
File.exist?
|
87
|
+
File.exist?("#{TEST_GEM_NAME}/#{TEST_GEM_NAME}.gemspec")
|
82
88
|
).to be_truthy
|
83
|
-
expect(File.exist?
|
89
|
+
expect(File.exist?("#{TEST_GEM_NAME}/REPO_NAME.gemspec")).to be_falsey
|
84
90
|
end
|
85
91
|
|
86
92
|
it 'makes the git repo' do
|
87
93
|
VCR.use_cassette('subject_create') do
|
88
94
|
subject.create
|
89
95
|
end
|
90
|
-
expect(Dir.exist?
|
96
|
+
expect(Dir.exist?("#{TEST_GEM_NAME}/.git")).to be_truthy
|
91
97
|
[
|
92
98
|
/remote\.origin\.url/,
|
93
99
|
/branch\.master\.remote=origin/,
|
data/spec/spec_helper.rb
CHANGED
data/template/circle.yml
CHANGED
@@ -1,12 +1,6 @@
|
|
1
1
|
dependencies:
|
2
2
|
override:
|
3
|
-
|
4
|
-
- 'rvm-exec 2.0.0-p645 bundle install'
|
5
|
-
- 'rvm-exec 2.1.6 bundle install'
|
6
|
-
- 'rvm-exec 2.2.2 bundle install'
|
3
|
+
- 'for i in $(cat .circle-ruby) ; do rvm-exec $i bundle install || exit 1 ; done'
|
7
4
|
test:
|
8
5
|
override:
|
9
|
-
|
10
|
-
- 'rvm-exec 2.0.0-p645 bundle exec rake'
|
11
|
-
- 'rvm-exec 2.1.6 bundle exec rake'
|
12
|
-
- 'rvm-exec 2.2.2 bundle exec rake'
|
6
|
+
- 'for i in $(cat .circle-ruby) ; do rvm-exec $i bundle exec rake || exit 1 ; done'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gemplate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.5
|
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: 2016-08-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rugged
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 0.24.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.
|
26
|
+
version: 0.24.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: userinput
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -44,28 +44,28 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 1.4.
|
47
|
+
version: 1.4.5
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 1.4.
|
54
|
+
version: 1.4.5
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: octokit
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 4.
|
61
|
+
version: 4.3.0
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 4.
|
68
|
+
version: 4.3.0
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: curb
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -100,28 +100,28 @@ dependencies:
|
|
100
100
|
requirements:
|
101
101
|
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: 0.
|
103
|
+
version: 0.42.0
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: 0.
|
110
|
+
version: 0.42.0
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: rake
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
115
|
- - "~>"
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version:
|
117
|
+
version: 11.2.0
|
118
118
|
type: :development
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
122
|
- - "~>"
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version:
|
124
|
+
version: 11.2.0
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: codecov
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
@@ -142,42 +142,42 @@ dependencies:
|
|
142
142
|
requirements:
|
143
143
|
- - "~>"
|
144
144
|
- !ruby/object:Gem::Version
|
145
|
-
version: 3.
|
145
|
+
version: 3.5.0
|
146
146
|
type: :development
|
147
147
|
prerelease: false
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
150
|
- - "~>"
|
151
151
|
- !ruby/object:Gem::Version
|
152
|
-
version: 3.
|
152
|
+
version: 3.5.0
|
153
153
|
- !ruby/object:Gem::Dependency
|
154
154
|
name: fuubar
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
156
156
|
requirements:
|
157
157
|
- - "~>"
|
158
158
|
- !ruby/object:Gem::Version
|
159
|
-
version: 2.
|
159
|
+
version: 2.1.0
|
160
160
|
type: :development
|
161
161
|
prerelease: false
|
162
162
|
version_requirements: !ruby/object:Gem::Requirement
|
163
163
|
requirements:
|
164
164
|
- - "~>"
|
165
165
|
- !ruby/object:Gem::Version
|
166
|
-
version: 2.
|
166
|
+
version: 2.1.0
|
167
167
|
- !ruby/object:Gem::Dependency
|
168
168
|
name: webmock
|
169
169
|
requirement: !ruby/object:Gem::Requirement
|
170
170
|
requirements:
|
171
171
|
- - "~>"
|
172
172
|
- !ruby/object:Gem::Version
|
173
|
-
version: 1.
|
173
|
+
version: 2.1.0
|
174
174
|
type: :development
|
175
175
|
prerelease: false
|
176
176
|
version_requirements: !ruby/object:Gem::Requirement
|
177
177
|
requirements:
|
178
178
|
- - "~>"
|
179
179
|
- !ruby/object:Gem::Version
|
180
|
-
version: 1.
|
180
|
+
version: 2.1.0
|
181
181
|
- !ruby/object:Gem::Dependency
|
182
182
|
name: vcr
|
183
183
|
requirement: !ruby/object:Gem::Requirement
|
@@ -199,6 +199,7 @@ executables:
|
|
199
199
|
extensions: []
|
200
200
|
extra_rdoc_files: []
|
201
201
|
files:
|
202
|
+
- ".circle-ruby"
|
202
203
|
- ".gitignore"
|
203
204
|
- ".prospectus"
|
204
205
|
- ".rspec"
|
@@ -221,6 +222,7 @@ files:
|
|
221
222
|
- spec/fixtures/cassettes/subject_create_twice.yml
|
222
223
|
- spec/gemplate_spec.rb
|
223
224
|
- spec/spec_helper.rb
|
225
|
+
- template/.circle-ruby
|
224
226
|
- template/.gitignore
|
225
227
|
- template/.prospectus
|
226
228
|
- template/.rspec
|