boilerpl8 0.1.0 → 0.2.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: fb49c7054f7c6e79c7a1eae55ab92aff27410956
4
- data.tar.gz: 1b169216fba70c65332f0162885d6390de34d83f
3
+ metadata.gz: b7a503e0cf309d9af4a0d5f74ec266e415f9176e
4
+ data.tar.gz: d1eabe5d244e96bb9c3785b70b3da4b012958a84
5
5
  SHA512:
6
- metadata.gz: b34f424994767306c2d8aef57a6d3768b93f8e9568d02a14179053359f83f6ae48f7e66b0b12484bb40deef571462b0c190c919e0987dff5f7671429b6172d10
7
- data.tar.gz: 205fdebae935f1f716e85bc12a51e5d65c7210a5f37dedaf90d21929b76009a4ff4f17d2e5e4a725b8f1a62558014fea52ab84bf83a6503da33fe6948abcb639
6
+ metadata.gz: 0930b774221390bd433962af90ab0e748d76ad02c9acbe34249c60781af541005f72db25703ac5222d510023c9c801e88587bc2a1c7533964ea9d8a7de3431b3
7
+ data.tar.gz: 1e7b007da84dec65b50a126c026a808be470468900de9ef756af4c7ac380614c4c5dac2db97e590d36ee5a2dd6c7bcf8f7a87246ba3dcf1e1be7111c105435eb
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
  Boilerpl8.rb
3
3
  ============
4
4
 
5
- ($Release: 0.1.0 $)
5
+ ($Release: 0.2.0 $)
6
6
 
7
7
 
8
8
  Abount
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = 'boilerpl8'
5
- spec.version = '$Release: 0.1.0 $'.split()[1]
5
+ spec.version = '$Release: 0.2.0 $'.split()[1]
6
6
  spec.author = 'makoto kuwata'
7
7
  spec.email = 'kwa@kuwata-lab.com'
8
8
  spec.platform = Gem::Platform::RUBY
@@ -1,7 +1,7 @@
1
1
  # -*- coding: utf-8 -*-
2
2
 
3
3
  ###
4
- ### $Release: 0.1.0 $
4
+ ### $Release: 0.2.0 $
5
5
  ### $Copyright: copyright(c) 2016 kuwata-lab.com all rights reserved $
6
6
  ### $License: MIT License $
7
7
  ###
@@ -14,7 +14,7 @@ require 'fileutils'
14
14
  module Boilerpl8
15
15
 
16
16
 
17
- RELEASE = '$Release: 0.1.0 $'.split()[1]
17
+ RELEASE = '$Release: 0.2.0 $'.split()[1]
18
18
 
19
19
 
20
20
  module ShellHelper
@@ -133,11 +133,13 @@ module Boilerpl8
133
133
  end
134
134
 
135
135
  def self.create(boilerplate_name)
136
+ #; [!xr4c6] reports error when argument has no schema.
136
137
  boilerplate_name =~ /\A(\w+:)/ or
137
- err("#{args[0]}: expected 'github:' or 'file:' schema.")
138
+ err("#{boilerplate_name}: expected 'github:' or 'file:' schema.")
138
139
  schema = $1
140
+ #; [!95h3f] reports error when argument has unknown schema.
139
141
  klass = ALL.find {|cls| cls.const_get(:SCHEMA) == schema } or
140
- err("#{args[0]}: unknown schema.")
142
+ err("#{boilerplate_name}: unknown schema (expected 'github:' or 'file:').")
141
143
  return klass.new()
142
144
  end
143
145
 
@@ -238,9 +240,12 @@ module Boilerpl8
238
240
  return 0
239
241
  end
240
242
  #
241
- ! args.empty? or err("#{@script_name}: argument required.")
242
- boilerplate_name = args[0] # ex: "github:kwatch/hello-ruby"
243
- target_dir = args[1] # ex: "mygem1"
243
+ boilerplate_name = args[0] # ex: "github:kwatch/hello-ruby"
244
+ target_dir = args[1] # ex: "mygem1"
245
+ #; [!eqisx] reports error when boilerplate name or target dir is not specified.
246
+ boilerplate_name or raise err("#{@script_name}: argument required.")
247
+ target_dir or raise err("#{@script_name}: target directory name required.")
248
+ #
244
249
  op = Operation.create(boilerplate_name)
245
250
  op.do_everything(boilerplate_name, target_dir, options)
246
251
  return 0
@@ -95,6 +95,28 @@ END
95
95
  end
96
96
  end
97
97
 
98
+ it "[!xr4c6] reports error when argument has no schema." do
99
+ pr = proc { Boilerpl8::MainApp.new.run("kwatch/hello-ruby", "helo") }
100
+ ok {pr}.raise?(Boilerpl8::CommandOptionError,
101
+ "kwatch/hello-ruby: expected 'github:' or 'file:' schema.")
102
+ end
103
+
104
+ it "[!95h3f] reports error when argument has unknown schema." do
105
+ pr = proc { Boilerpl8::MainApp.new.run("gh:kwatch/hello-ruby", "helo") }
106
+ ok {pr}.raise?(Boilerpl8::CommandOptionError,
107
+ "gh:kwatch/hello-ruby: unknown schema (expected 'github:' or 'file:').")
108
+ end
109
+
110
+ it "[!eqisx] reports error when boilerplate name or target dir is not specified." do
111
+ pr = proc { Boilerpl8::MainApp.new.run() }
112
+ ok {pr}.raise?(Boilerpl8::CommandOptionError,
113
+ "boilerpl8_test.rb: argument required.")
114
+ #
115
+ pr = proc { Boilerpl8::MainApp.new.run("github:kwatch/hello-ruby") }
116
+ ok {pr}.raise?(Boilerpl8::CommandOptionError,
117
+ "boilerpl8_test.rb: target directory name required.")
118
+ end
119
+
98
120
  end
99
121
 
100
122
 
metadata CHANGED
@@ -1,57 +1,56 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: boilerpl8
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - makoto kuwata
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-22 00:00:00.000000000 Z
11
+ date: 2016-11-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ~>
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ~>
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: minitest-ok
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ~>
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ~>
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
- description: 'Scaffolding tool to download and expand boilerplate files.
42
-
43
- '
41
+ description: |
42
+ Scaffolding tool to download and expand boilerplate files.
44
43
  email: kwa@kuwata-lab.com
45
44
  executables:
46
45
  - boilerpl8
47
46
  extensions: []
48
47
  extra_rdoc_files: []
49
48
  files:
50
- - MIT-LICENSE
51
49
  - README.md
50
+ - MIT-LICENSE
52
51
  - Rakefile
53
- - bin/boilerpl8
54
52
  - boilerpl8.gemspec
53
+ - bin/boilerpl8
55
54
  - lib/boilerpl8.rb
56
55
  - test/boilerpl8_test.rb
57
56
  homepage: https://github.com/kwatch/boilerpl8/tree/ruby
@@ -64,17 +63,17 @@ require_paths:
64
63
  - lib
65
64
  required_ruby_version: !ruby/object:Gem::Requirement
66
65
  requirements:
67
- - - ">="
66
+ - - '>='
68
67
  - !ruby/object:Gem::Version
69
68
  version: '0'
70
69
  required_rubygems_version: !ruby/object:Gem::Requirement
71
70
  requirements:
72
- - - ">="
71
+ - - '>='
73
72
  - !ruby/object:Gem::Version
74
73
  version: '0'
75
74
  requirements: []
76
75
  rubyforge_project:
77
- rubygems_version: 2.5.1
76
+ rubygems_version: 2.0.14.1
78
77
  signing_key:
79
78
  specification_version: 4
80
79
  summary: download and expand boilerplate files