sinistra 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/sinistra/cui.rb +8 -13
- data/{bin → lib/sinistra}/shoreman.sh +1 -1
- metadata +2 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4bf488918bf8920335b2e231423f0956e4195ee0
|
4
|
+
data.tar.gz: 435fcc74f6b3d8409c5d7aed20588533900ff904
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1d05a908f4e6ec9268264e937e580614b4da399da840789e722dee2b4b4af57c49614b3327f9af00264df76678967138dd530889f69d43924bdae7fabac686e1
|
7
|
+
data.tar.gz: ae04b3cbabec85b11ff6cb2e9f7029ed648e36499f6ec0ead5f915236af930623f0ebdd0b5ae883cc9f07fc9b1bf0f04ef1c36cf39b166b6e8433de99814a255
|
data/lib/sinistra/cui.rb
CHANGED
@@ -1,10 +1,6 @@
|
|
1
1
|
require 'thor'
|
2
2
|
require 'yaml'
|
3
3
|
|
4
|
-
def join(*args)
|
5
|
-
File.join(*args)
|
6
|
-
end
|
7
|
-
|
8
4
|
module Sinistra
|
9
5
|
class CUI < Thor
|
10
6
|
|
@@ -99,7 +95,6 @@ eos
|
|
99
95
|
"hg" => false,
|
100
96
|
"sql" => false,
|
101
97
|
"rdoc" => false,
|
102
|
-
"logs" => false,
|
103
98
|
"tests" => false,
|
104
99
|
"vendor" => false
|
105
100
|
},
|
@@ -120,11 +115,11 @@ eos
|
|
120
115
|
config = YAML.load(IO.read("config.yml"))
|
121
116
|
name = config["name"]
|
122
117
|
|
123
|
-
makdir = [name.downcase, join(name.downcase, "controller"), join(name.downcase, "views"), join(name.downcase, "views", "layouts"), "lib", "public", "tmp"]
|
118
|
+
makdir = [name.downcase, File.join(name.downcase, "controller"), File.join(name.downcase, "views"), File.join(name.downcase, "views", "layouts"), "lib", "public", "tmp"]
|
124
119
|
|
125
120
|
# optional but default model
|
126
|
-
makdir << join(name.downcase, "models") if config["hooks"]["model"]
|
127
|
-
makdir << join(name.downcase, "helpers") if config["hooks"]["helper"]
|
121
|
+
makdir << File.join(name.downcase, "models") if config["hooks"]["model"]
|
122
|
+
makdir << File.join(name.downcase, "helpers") if config["hooks"]["helper"]
|
128
123
|
|
129
124
|
# extra hooks
|
130
125
|
makdir << "db" if config["hooks"]["sql"]
|
@@ -163,8 +158,8 @@ eos
|
|
163
158
|
IO.write("./#{name.downcase}/controller/main.rb", LIB_CTRLMAIN) unless File.exists?("./#{name.downcase}/controller/main.rb")
|
164
159
|
|
165
160
|
# optional base files
|
166
|
-
IO.write(join(name.downcase,"models","main.rb"), LIB_MDL_MAIN) if config["hooks"]["model"] && !File.exists?(join(name.downcase,"models","main.rb"))
|
167
|
-
IO.write(join(name.downcase,"helpers","main.rb"), LIB_HLP_MAIN) if config["hooks"]["helper"] && !File.exists?(join(name.downcase,"helpers","main.rb"))
|
161
|
+
IO.write(File.join(name.downcase,"models","main.rb"), LIB_MDL_MAIN) if config["hooks"]["model"] && !File.exists?(File.join(name.downcase,"models","main.rb"))
|
162
|
+
IO.write(File.join(name.downcase,"helpers","main.rb"), LIB_HLP_MAIN) if config["hooks"]["helper"] && !File.exists?(File.join(name.downcase,"helpers","main.rb"))
|
168
163
|
|
169
164
|
# create misc files
|
170
165
|
IO.write("README", README) if config["hooks"]["readme"] && !File.exists?("README")
|
@@ -188,13 +183,13 @@ eos
|
|
188
183
|
# git creation args
|
189
184
|
if config["hooks"]["git"]
|
190
185
|
%x{ git init } unless File.exists?(".git")
|
191
|
-
IO.write(".gitignore", "/tmp/*\n
|
186
|
+
IO.write(".gitignore", "/tmp/*\n") unless File.exists?(".gitignore")
|
192
187
|
end
|
193
188
|
|
194
189
|
# mercurial creation args
|
195
190
|
if config["hooks"]["hg"]
|
196
191
|
%x{ hg init } unless File.exists?(".hg")
|
197
|
-
IO.write(".hgignore", "syntax: glob\n/tmp/*\n
|
192
|
+
IO.write(".hgignore", "syntax: glob\n/tmp/*\n") unless File.exists?(".hgignore")
|
198
193
|
end
|
199
194
|
|
200
195
|
if config["proc"]["enabled"]
|
@@ -227,7 +222,7 @@ eos
|
|
227
222
|
desc "start", "runs the sinistra application"
|
228
223
|
def start
|
229
224
|
script = File.dirname(File.expand_path(__FILE__))
|
230
|
-
script = join(script,"..","..","bin","shoreman.sh")
|
225
|
+
script = File.join(script,"..","..","bin","shoreman.sh")
|
231
226
|
exec "\"#{script}\""
|
232
227
|
end
|
233
228
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sinistra
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Christian Ferraz Lemos de Sousa / @kress95
|
@@ -28,14 +28,13 @@ description: Builds Sinatra apps with a enforced structure.
|
|
28
28
|
email: cferraz95@gmail.com
|
29
29
|
executables:
|
30
30
|
- sinistra
|
31
|
-
- shoreman.sh
|
32
31
|
extensions: []
|
33
32
|
extra_rdoc_files: []
|
34
33
|
files:
|
35
34
|
- lib/sinistra.rb
|
36
35
|
- lib/sinistra/cui.rb
|
36
|
+
- lib/sinistra/shoreman.sh
|
37
37
|
- bin/sinistra
|
38
|
-
- bin/shoreman.sh
|
39
38
|
homepage: https://github.com/kress95/sinistra
|
40
39
|
licenses:
|
41
40
|
- MIT
|