mortar 0.13.3 → 0.13.4

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.
@@ -136,12 +136,6 @@ class Mortar::Command::Base
136
136
  #
137
137
  # if project id is not created, just pass in nil
138
138
  def register_do(name, is_public, is_embedded, project_id)
139
- if is_public
140
- unless confirm("Public projects allow anyone to view and fork the code in this project\'s repository. Are you sure? (y/n)")
141
- error("Mortar project was not registered")
142
- end
143
- end
144
-
145
139
  if is_embedded
146
140
  validate_project_structure()
147
141
 
@@ -177,8 +171,14 @@ class Mortar::Command::Base
177
171
 
178
172
  def register_api_call(name, is_public)
179
173
  project_id = nil
174
+ if is_public
175
+ unless confirm("Public projects allow anyone to view and fork the code in this project\'s repository. Are you sure? (y/n)")
176
+ error("Mortar project was not registered")
177
+ end
178
+ end
180
179
  is_private = !is_public # is private required by restful api
181
180
  validate_project_name(name)
181
+ 'registering project....\n'
182
182
  action("Sending request to register project: #{name}") do
183
183
  project_id = api.post_project(name, is_private).body["project_id"]
184
184
  end
@@ -186,7 +186,6 @@ class Mortar::Command::Base
186
186
  end
187
187
 
188
188
  def register_project(name, is_public, project_id)
189
- 'registering project....\n'
190
189
  if project_id == nil
191
190
  project_id = register_api_call(name, is_public)
192
191
  end
@@ -87,17 +87,14 @@ class Mortar::Command::Projects < Mortar::Command::Base
87
87
  unless name
88
88
  error("Usage: mortar projects:create PROJECTNAME\nMust specify PROJECTNAME")
89
89
  end
90
-
91
-
92
90
 
93
91
  args = [name,]
94
92
  is_public = false
95
93
  if options[:public]
96
94
  is_public= true
97
- end
95
+ end
98
96
  validate_project_name(name)
99
97
  project_id = register_api_call(name,is_public)
100
- # is_public is created for clarity in other sections of code
101
98
  Mortar::Command::run("generate:project", [name])
102
99
  FileUtils.cd(name)
103
100
  is_embedded = false
@@ -127,7 +124,8 @@ class Mortar::Command::Projects < Mortar::Command::Base
127
124
  error("Usage: mortar projects:register PROJECT\nMust specify PROJECT.")
128
125
  end
129
126
  validate_arguments!
130
- # nil is non existant project_id because it hasn't been posted yet
127
+
128
+ #nil is non existant project_id because it hasn't been posted yet
131
129
  register_do(name, options[:public], options[:embedded], nil)
132
130
 
133
131
  end
@@ -208,7 +206,7 @@ class Mortar::Command::Projects < Mortar::Command::Base
208
206
 
209
207
  # projects:fork GIT_URL PROJECT_NAME
210
208
  #
211
- # Used when you want to fork an existing Github repository into your own Mortar project.
209
+ # Used when you want to fork an existing Git repository into your own Mortar project.
212
210
  #
213
211
  # --public # Register a public project, which can be viewed and forked by anyone.
214
212
  #
@@ -228,15 +226,7 @@ class Mortar::Command::Projects < Mortar::Command::Base
228
226
  error("Currently in git repo. You can not fork a new project inside of an existing git repository.")
229
227
  end
230
228
  end
231
-
232
- if options[:public]
233
- unless confirm("Public projects allow anyone to view and fork the code in this project\'s repository. Are you sure? (y/n)")
234
- error("Mortar project was not registered")
235
- end
236
- is_public = true
237
- else
238
- is_public = false
239
- end
229
+ is_public = options[:public]
240
230
 
241
231
  git.clone(git_url, name, "base")
242
232
  Dir.chdir(name)
@@ -16,5 +16,5 @@
16
16
 
17
17
  module Mortar
18
18
  # see http://semver.org/
19
- VERSION = "0.13.3"
19
+ VERSION = "0.13.4"
20
20
  end
@@ -262,12 +262,10 @@ STDERR
262
262
  end
263
263
  end
264
264
 
265
- it "Confirms if user wants to create a public project, exits if not" do
265
+ it "Confirms if user wants to create a public project, exits when user says no" do
266
266
  project_name = "some_new_project"
267
267
  project_id = "1234"
268
268
  mock(Mortar::Auth.api).get_projects().returns(Excon::Response.new(:body => {"projects" => [project1, project2]}))
269
- mock(Mortar::Auth.api).get_projects().returns(Excon::Response.new(:body => {"projects" => [project1, project2]}))
270
- mock(Mortar::Auth.api).post_project("some_new_project", false) {Excon::Response.new(:body => {"project_id" => project_id})}
271
269
  any_instance_of(Mortar::Command::Projects) do |base|
272
270
  mock(base).ask.with_any_args.times(1) { 'n' }
273
271
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mortar
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.3
4
+ version: 0.13.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-01-28 00:00:00.000000000 Z
12
+ date: 2014-01-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rdoc
@@ -337,7 +337,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
337
337
  version: '0'
338
338
  requirements: []
339
339
  rubyforge_project:
340
- rubygems_version: 1.8.23
340
+ rubygems_version: 1.8.24
341
341
  signing_key:
342
342
  specification_version: 3
343
343
  summary: Client library and CLI to interact with the Mortar service.