brief 1.17.5 → 1.17.7
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/Gemfile.lock +1 -1
- data/apps/blueprint/models/epic.rb +1 -1
- data/lib/brief/cli/{create.rb → generate.rb} +38 -9
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 356b2a9a02cd2c9bcaf44018ff6c4b0d5b15c3de
|
|
4
|
+
data.tar.gz: e6c28ddd6bd784607850b3fe871deba52c1d341f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1a497129d3190b78a62e8319236d09b0be6bb790825a077724cefdf823509ddce4795d97be88d08dfdbf30c0fadc9bd51b85c9a72ad00be34eb397673ef8c362
|
|
7
|
+
data.tar.gz: 5992ed22fb049d4f4114eb95cdf4b39d45b1a8f91076c35f77712e07a3e3d62b0b697772d9f6300b28c40eb1593bf01bf32c91c16cbba35a6b8094a746593a31
|
data/Gemfile.lock
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
command "
|
|
2
|
-
c.syntax = "brief
|
|
3
|
-
c.description = "
|
|
1
|
+
command "generate app" do |c|
|
|
2
|
+
c.syntax = "brief generate app NAME"
|
|
3
|
+
c.description = "generate a new brief app"
|
|
4
4
|
|
|
5
5
|
c.option '--clone EXISTING_APP', String, 'Clone an existing app'
|
|
6
6
|
|
|
@@ -33,9 +33,38 @@ command "create app" do |c|
|
|
|
33
33
|
end
|
|
34
34
|
end
|
|
35
35
|
|
|
36
|
-
command "
|
|
37
|
-
c.syntax = "brief
|
|
38
|
-
c.description = "
|
|
36
|
+
command "generate model" do |c|
|
|
37
|
+
c.syntax = "brief generate model MODEL_NAME"
|
|
38
|
+
c.description = "generate a new model"
|
|
39
|
+
|
|
40
|
+
c.option '--models-path PATH', String, 'Which folder to use?'
|
|
41
|
+
c.option '--force', nil, 'Required if PATH already exists'
|
|
42
|
+
|
|
43
|
+
c.action do |args, options|
|
|
44
|
+
options.default(models_path: Brief.pwd.join("models"))
|
|
45
|
+
|
|
46
|
+
model_name = args.first || (puts "Must pass a model name" and exit)
|
|
47
|
+
model_name = model_name.to_s.singularize.parameterize.underscore
|
|
48
|
+
|
|
49
|
+
FileUtils.mkdir_p(models_path)
|
|
50
|
+
|
|
51
|
+
path = Pathname(models_path).join("#{model_name}.rb")
|
|
52
|
+
|
|
53
|
+
if !options.force && path.exist?
|
|
54
|
+
raise 'Model already exists. Pass --force to continue'
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
data = "class #{ model_name }\n include Brief::Model\n meta do\n # define frontmatter attributes\n end\n\nend"
|
|
58
|
+
|
|
59
|
+
path.open do |fh|
|
|
60
|
+
fh.write(data)
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
command "generate briefcase" do |c|
|
|
66
|
+
c.syntax = "brief generate briefcase PATH"
|
|
67
|
+
c.description = "generate a new briefcase"
|
|
39
68
|
|
|
40
69
|
c.option '--app APP_NAME', String, 'Use the specified app'
|
|
41
70
|
c.option '--use-local-models', nil, 'When using an app, this option will copy over the models locally instead, so you can customize them.'
|
|
@@ -52,7 +81,7 @@ command "create briefcase" do |c|
|
|
|
52
81
|
|
|
53
82
|
FileUtils.mkdir_p(folder)
|
|
54
83
|
|
|
55
|
-
folder.join("
|
|
84
|
+
folder.join("brief.rb").open("w+") do |fh|
|
|
56
85
|
fh.write("config do\n set(:models_path, \"./models\") \nend")
|
|
57
86
|
end
|
|
58
87
|
|
|
@@ -67,7 +96,7 @@ command "create briefcase" do |c|
|
|
|
67
96
|
|
|
68
97
|
when options.app
|
|
69
98
|
folder.join("brief.rb").open("a") do |fh|
|
|
70
|
-
fh.write "\nuse #{ options.app }"
|
|
99
|
+
fh.write "\nuse \"#{ options.app }\""
|
|
71
100
|
end
|
|
72
101
|
end
|
|
73
102
|
|
|
@@ -75,6 +104,6 @@ command "create briefcase" do |c|
|
|
|
75
104
|
FileUtils.mkdir_p folder.join(subfolder)
|
|
76
105
|
end
|
|
77
106
|
|
|
78
|
-
puts "Created briefcase in #{ folder }"
|
|
107
|
+
puts "== Created briefcase in #{ folder }"
|
|
79
108
|
end
|
|
80
109
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: brief
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.17.
|
|
4
|
+
version: 1.17.7
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jonathan Soeder
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2015-07-
|
|
11
|
+
date: 2015-07-06 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: hashie
|
|
@@ -397,10 +397,10 @@ files:
|
|
|
397
397
|
- lib/brief/cli/01_extensions.rb
|
|
398
398
|
- lib/brief/cli/all.rb
|
|
399
399
|
- lib/brief/cli/browse.rb
|
|
400
|
-
- lib/brief/cli/create.rb
|
|
401
400
|
- lib/brief/cli/edit.rb
|
|
402
401
|
- lib/brief/cli/examples.rb
|
|
403
402
|
- lib/brief/cli/export.rb
|
|
403
|
+
- lib/brief/cli/generate.rb
|
|
404
404
|
- lib/brief/cli/parse.rb
|
|
405
405
|
- lib/brief/cli/render.rb
|
|
406
406
|
- lib/brief/cli/run.rb
|