brief 1.17.5 → 1.17.7

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: 5c0bf1804dc960cb5fe620321aee94c57ad4b425
4
- data.tar.gz: b23f62d3868f6919c056ca65c1b7ed1ce709d81f
3
+ metadata.gz: 356b2a9a02cd2c9bcaf44018ff6c4b0d5b15c3de
4
+ data.tar.gz: e6c28ddd6bd784607850b3fe871deba52c1d341f
5
5
  SHA512:
6
- metadata.gz: f39f156b9fb05d8ebbe9793d96581d574355b7181294ccf5398be8ca93820e93a6c655c5d364ad79d89d339b49de1a39794138ba20d13094804170213ac597af
7
- data.tar.gz: 1092266423a6fce52d43a4570644cd041c929dcd9f36cb0e465064e9be0143256cba4cd507f57f5be26d51ae5618022c91975820abd8124ce1fc8c77b1e22346
6
+ metadata.gz: 1a497129d3190b78a62e8319236d09b0be6bb790825a077724cefdf823509ddce4795d97be88d08dfdbf30c0fadc9bd51b85c9a72ad00be34eb397673ef8c362
7
+ data.tar.gz: 5992ed22fb049d4f4114eb95cdf4b39d45b1a8f91076c35f77712e07a3e3d62b0b697772d9f6300b28c40eb1593bf01bf32c91c16cbba35a6b8094a746593a31
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- brief (1.17.4.1.geb1f9a7.1.dirty.20150703.001128)
4
+ brief (1.17.6)
5
5
  activesupport (> 3.2)
6
6
  commander (~> 4.3)
7
7
  em-websocket (~> 0.5)
@@ -118,7 +118,7 @@ class Brief::Apps::Blueprint::Epic
118
118
 
119
119
  content = raw_content_for_feature(feature_heading)
120
120
 
121
- data.to_yaml + "\n---\n" + content
121
+ data.stringify_keys.to_yaml + "---\n\n" + content
122
122
  end
123
123
 
124
124
  def feature_file_for(feature_heading)
@@ -1,6 +1,6 @@
1
- command "create app" do |c|
2
- c.syntax = "brief create app NAME"
3
- c.description = "create a new brief app"
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 "create briefcase" do |c|
37
- c.syntax = "brief create briefcase PATH"
38
- c.description = "create a new briefcase"
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("config.rb").open("w+") do |fh|
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.5
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-03 00:00:00.000000000 Z
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