togostanza 1.3.3 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/togostanza/cli.rb +57 -12
- data/lib/togostanza/version.rb +1 -1
- data/togostanza.gemspec +16 -16
- metadata +34 -34
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0d6c9a3a9ccf860f2aa7e4be7b748f280d16e41a
|
4
|
+
data.tar.gz: dad85fdf3ad6371ffd68c9c7764fc605938dd346
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6beb8ba2294ece80821dbfc351243e33c6eaa1fa7249550cf9ccaefdbc5c8941a59f119cbe77807664f93d65f9cb15c2034f7098c009ea493ef09e876295ea4d
|
7
|
+
data.tar.gz: fd63ce142f2cb4948a7ce351f5f9e29dc75100ae3ba431bc4324ce10fd3c83e56484de09ca3b1c0ebf5695d89fbabf16f8d4a43ae5d7bca83243ba7ff4aaef9c
|
data/lib/togostanza/cli.rb
CHANGED
@@ -74,6 +74,58 @@ module TogoStanza
|
|
74
74
|
end
|
75
75
|
end
|
76
76
|
|
77
|
+
class StanzaRemover < Thor::Group
|
78
|
+
include Thor::Actions
|
79
|
+
include Thor::Shell
|
80
|
+
|
81
|
+
argument :name, type: :string
|
82
|
+
|
83
|
+
def check_input
|
84
|
+
input = yes?("Do you want to remove #{file_name} [y] ?")
|
85
|
+
unless input
|
86
|
+
say("This operation is canceled")
|
87
|
+
exit
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
91
|
+
def check_exist
|
92
|
+
unless File.exist?("#{file_name}")
|
93
|
+
say("This provider doesn't have #{file_name}")
|
94
|
+
exit
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
98
|
+
def remove_files
|
99
|
+
remove_file("#{file_name}")
|
100
|
+
end
|
101
|
+
|
102
|
+
def prune_gem
|
103
|
+
gsub_file("Gemfile", "gem '#{file_name}', path: './#{file_name}'\n", "")
|
104
|
+
end
|
105
|
+
|
106
|
+
def prune_gem_lock
|
107
|
+
run "bundle install"
|
108
|
+
end
|
109
|
+
|
110
|
+
private
|
111
|
+
|
112
|
+
def chop_slash
|
113
|
+
if name[-1] == '/'
|
114
|
+
name.chop
|
115
|
+
else
|
116
|
+
name
|
117
|
+
end
|
118
|
+
end
|
119
|
+
|
120
|
+
def stanza_id
|
121
|
+
chop_slash.underscore.sub(/_stanza$/, '')
|
122
|
+
end
|
123
|
+
|
124
|
+
def file_name
|
125
|
+
stanza_id + '_stanza'
|
126
|
+
end
|
127
|
+
end
|
128
|
+
|
77
129
|
class NameModifier < Thor::Group
|
78
130
|
include Thor::Actions
|
79
131
|
|
@@ -88,13 +140,11 @@ module TogoStanza
|
|
88
140
|
name1_chopped = chop_slash(name1)
|
89
141
|
name2_chopped = chop_slash(name2)
|
90
142
|
|
91
|
-
gsub_file("#{files_name(name1_chopped)}/help.md", titles(name1_chopped), titles(name2_chopped))
|
92
|
-
gsub_file("#{files_name(name1_chopped)}/help.md", stanzas_id(name1_chopped), stanzas_id(name2_chopped))
|
93
143
|
gsub_file("#{files_name(name1_chopped)}/#{files_name(name1_chopped)}.gemspec", files_name(name1_chopped), files_name(name2_chopped))
|
94
144
|
gsub_file("#{files_name(name1_chopped)}/lib/#{files_name(name1_chopped)}.rb", classes_name(name1_chopped), classes_name(name2_chopped))
|
95
145
|
|
96
146
|
unless File.exist?("#{files_name(name1_chopped)}/metadata.json")
|
97
|
-
template 'metadata.json.erb', "#{
|
147
|
+
template 'metadata.json.erb', "#{files_name(name1_chopped)}/metadata.json"
|
98
148
|
end
|
99
149
|
|
100
150
|
gsub_file("#{files_name(name1_chopped)}/metadata.json", stanzas_id(name1_chopped), stanzas_id(name2_chopped))
|
@@ -130,15 +180,6 @@ module TogoStanza
|
|
130
180
|
end
|
131
181
|
end
|
132
182
|
|
133
|
-
def stanza_id
|
134
|
-
name1_chopped = chop_slash(name1)
|
135
|
-
name1_chopped.underscore.sub(/_stanza$/, '')
|
136
|
-
end
|
137
|
-
|
138
|
-
def file_name
|
139
|
-
stanza_id + '_stanza'
|
140
|
-
end
|
141
|
-
|
142
183
|
def stanzas_id(name)
|
143
184
|
name.underscore.sub(/_stanza$/, '')
|
144
185
|
end
|
@@ -194,6 +235,10 @@ module TogoStanza
|
|
194
235
|
register NameModifier, 'modify', 'modify OLD_NAME NEW_NAME', 'Modify a name of stanza'
|
195
236
|
end
|
196
237
|
|
238
|
+
class Stanza < Thor
|
239
|
+
register StanzaRemover, 'remove', 'remove NAME', 'Remove the stanza'
|
240
|
+
end
|
241
|
+
|
197
242
|
class Root < Thor
|
198
243
|
register NameRegister, 'name' , 'name NAME' , 'register your name'
|
199
244
|
end
|
data/lib/togostanza/version.rb
CHANGED
data/togostanza.gemspec
CHANGED
@@ -16,23 +16,23 @@ Gem::Specification.new do |spec|
|
|
16
16
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
17
17
|
spec.require_paths = ['lib']
|
18
18
|
|
19
|
-
spec.add_runtime_dependency 'activesupport'
|
20
|
-
spec.add_runtime_dependency 'flavour_saver'
|
21
|
-
spec.add_runtime_dependency 'haml'
|
22
|
-
spec.add_runtime_dependency 'hashie'
|
23
|
-
spec.add_runtime_dependency 'parallel'
|
24
|
-
spec.add_runtime_dependency 'sinatra'
|
25
|
-
spec.add_runtime_dependency 'sinatra-contrib'
|
26
|
-
spec.add_runtime_dependency 'sparql-client'
|
27
|
-
spec.add_runtime_dependency 'sprockets'
|
28
|
-
spec.add_runtime_dependency 'thor'
|
19
|
+
spec.add_runtime_dependency 'activesupport', '~> 0'
|
20
|
+
spec.add_runtime_dependency 'flavour_saver', '~> 0'
|
21
|
+
spec.add_runtime_dependency 'haml', '~> 0'
|
22
|
+
spec.add_runtime_dependency 'hashie', '~> 0'
|
23
|
+
spec.add_runtime_dependency 'parallel', '~> 0'
|
24
|
+
spec.add_runtime_dependency 'sinatra', '~> 0', '~> 0'
|
25
|
+
spec.add_runtime_dependency 'sinatra-contrib', '~> 0'
|
26
|
+
spec.add_runtime_dependency 'sparql-client', '~> 0'
|
27
|
+
spec.add_runtime_dependency 'sprockets', '~> 0'
|
28
|
+
spec.add_runtime_dependency 'thor', '~> 0'
|
29
29
|
|
30
|
-
spec.add_development_dependency 'appraisal'
|
31
|
-
spec.add_development_dependency 'bundler'
|
32
|
-
spec.add_development_dependency 'capybara'
|
33
|
-
spec.add_development_dependency 'rake'
|
34
|
-
spec.add_development_dependency 'rspec'
|
35
|
-
spec.add_development_dependency 'rspec-its'
|
30
|
+
spec.add_development_dependency 'appraisal', '~> 0'
|
31
|
+
spec.add_development_dependency 'bundler', '~> 0'
|
32
|
+
spec.add_development_dependency 'capybara', '~> 0'
|
33
|
+
spec.add_development_dependency 'rake', '~> 0'
|
34
|
+
spec.add_development_dependency 'rspec', '~> 0'
|
35
|
+
spec.add_development_dependency 'rspec-its', '~> 0'
|
36
36
|
|
37
37
|
spec.required_ruby_version = '>= 1.9.3'
|
38
38
|
end
|
metadata
CHANGED
@@ -1,237 +1,237 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: togostanza
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Keita Urashima
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-10-
|
11
|
+
date: 2015-10-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
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: :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
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: flavour_saver
|
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: :runtime
|
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
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: haml
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
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
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: hashie
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '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
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: parallel
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- - "
|
73
|
+
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '0'
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- - "
|
80
|
+
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: sinatra
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- - "
|
87
|
+
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: '0'
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- - "
|
94
|
+
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: sinatra-contrib
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- - "
|
101
|
+
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
103
|
version: '0'
|
104
104
|
type: :runtime
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- - "
|
108
|
+
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: sparql-client
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
|
-
- - "
|
115
|
+
- - "~>"
|
116
116
|
- !ruby/object:Gem::Version
|
117
117
|
version: '0'
|
118
118
|
type: :runtime
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
|
-
- - "
|
122
|
+
- - "~>"
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '0'
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: sprockets
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
128
128
|
requirements:
|
129
|
-
- - "
|
129
|
+
- - "~>"
|
130
130
|
- !ruby/object:Gem::Version
|
131
131
|
version: '0'
|
132
132
|
type: :runtime
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
|
-
- - "
|
136
|
+
- - "~>"
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: '0'
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
140
|
name: thor
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
142
142
|
requirements:
|
143
|
-
- - "
|
143
|
+
- - "~>"
|
144
144
|
- !ruby/object:Gem::Version
|
145
145
|
version: '0'
|
146
146
|
type: :runtime
|
147
147
|
prerelease: false
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
|
-
- - "
|
150
|
+
- - "~>"
|
151
151
|
- !ruby/object:Gem::Version
|
152
152
|
version: '0'
|
153
153
|
- !ruby/object:Gem::Dependency
|
154
154
|
name: appraisal
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
156
156
|
requirements:
|
157
|
-
- - "
|
157
|
+
- - "~>"
|
158
158
|
- !ruby/object:Gem::Version
|
159
159
|
version: '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
166
|
version: '0'
|
167
167
|
- !ruby/object:Gem::Dependency
|
168
168
|
name: bundler
|
169
169
|
requirement: !ruby/object:Gem::Requirement
|
170
170
|
requirements:
|
171
|
-
- - "
|
171
|
+
- - "~>"
|
172
172
|
- !ruby/object:Gem::Version
|
173
173
|
version: '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
180
|
version: '0'
|
181
181
|
- !ruby/object:Gem::Dependency
|
182
182
|
name: capybara
|
183
183
|
requirement: !ruby/object:Gem::Requirement
|
184
184
|
requirements:
|
185
|
-
- - "
|
185
|
+
- - "~>"
|
186
186
|
- !ruby/object:Gem::Version
|
187
187
|
version: '0'
|
188
188
|
type: :development
|
189
189
|
prerelease: false
|
190
190
|
version_requirements: !ruby/object:Gem::Requirement
|
191
191
|
requirements:
|
192
|
-
- - "
|
192
|
+
- - "~>"
|
193
193
|
- !ruby/object:Gem::Version
|
194
194
|
version: '0'
|
195
195
|
- !ruby/object:Gem::Dependency
|
196
196
|
name: rake
|
197
197
|
requirement: !ruby/object:Gem::Requirement
|
198
198
|
requirements:
|
199
|
-
- - "
|
199
|
+
- - "~>"
|
200
200
|
- !ruby/object:Gem::Version
|
201
201
|
version: '0'
|
202
202
|
type: :development
|
203
203
|
prerelease: false
|
204
204
|
version_requirements: !ruby/object:Gem::Requirement
|
205
205
|
requirements:
|
206
|
-
- - "
|
206
|
+
- - "~>"
|
207
207
|
- !ruby/object:Gem::Version
|
208
208
|
version: '0'
|
209
209
|
- !ruby/object:Gem::Dependency
|
210
210
|
name: rspec
|
211
211
|
requirement: !ruby/object:Gem::Requirement
|
212
212
|
requirements:
|
213
|
-
- - "
|
213
|
+
- - "~>"
|
214
214
|
- !ruby/object:Gem::Version
|
215
215
|
version: '0'
|
216
216
|
type: :development
|
217
217
|
prerelease: false
|
218
218
|
version_requirements: !ruby/object:Gem::Requirement
|
219
219
|
requirements:
|
220
|
-
- - "
|
220
|
+
- - "~>"
|
221
221
|
- !ruby/object:Gem::Version
|
222
222
|
version: '0'
|
223
223
|
- !ruby/object:Gem::Dependency
|
224
224
|
name: rspec-its
|
225
225
|
requirement: !ruby/object:Gem::Requirement
|
226
226
|
requirements:
|
227
|
-
- - "
|
227
|
+
- - "~>"
|
228
228
|
- !ruby/object:Gem::Version
|
229
229
|
version: '0'
|
230
230
|
type: :development
|
231
231
|
prerelease: false
|
232
232
|
version_requirements: !ruby/object:Gem::Requirement
|
233
233
|
requirements:
|
234
|
-
- - "
|
234
|
+
- - "~>"
|
235
235
|
- !ruby/object:Gem::Version
|
236
236
|
version: '0'
|
237
237
|
description:
|